~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/xfs/libxfs/xfs_trans_resv.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
  4  * All Rights Reserved.
  5  */
  6 #ifndef __XFS_TRANS_RESV_H__
  7 #define __XFS_TRANS_RESV_H__
  8 
  9 struct xfs_mount;
 10 
 11 /*
 12  * structure for maintaining pre-calculated transaction reservations.
 13  */
 14 struct xfs_trans_res {
 15         uint    tr_logres;      /* log space unit in bytes per log ticket */
 16         int     tr_logcount;    /* number of log operations per log ticket */
 17         int     tr_logflags;    /* log flags, currently only used for indicating
 18                                  * a reservation request is permanent or not */
 19 };
 20 
 21 struct xfs_trans_resv {
 22         struct xfs_trans_res    tr_write;       /* extent alloc trans */
 23         struct xfs_trans_res    tr_itruncate;   /* truncate trans */
 24         struct xfs_trans_res    tr_rename;      /* rename trans */
 25         struct xfs_trans_res    tr_link;        /* link trans */
 26         struct xfs_trans_res    tr_remove;      /* unlink trans */
 27         struct xfs_trans_res    tr_symlink;     /* symlink trans */
 28         struct xfs_trans_res    tr_create;      /* create trans */
 29         struct xfs_trans_res    tr_create_tmpfile; /* create O_TMPFILE trans */
 30         struct xfs_trans_res    tr_mkdir;       /* mkdir trans */
 31         struct xfs_trans_res    tr_ifree;       /* inode free trans */
 32         struct xfs_trans_res    tr_ichange;     /* inode update trans */
 33         struct xfs_trans_res    tr_growdata;    /* fs data section grow trans */
 34         struct xfs_trans_res    tr_addafork;    /* add inode attr fork trans */
 35         struct xfs_trans_res    tr_writeid;     /* write setuid/setgid file */
 36         struct xfs_trans_res    tr_attrinval;   /* attr fork buffer
 37                                                  * invalidation */
 38         struct xfs_trans_res    tr_attrsetm;    /* set/create an attribute at
 39                                                  * mount time */
 40         struct xfs_trans_res    tr_attrsetrt;   /* set/create an attribute at
 41                                                  * runtime */
 42         struct xfs_trans_res    tr_attrrm;      /* remove an attribute */
 43         struct xfs_trans_res    tr_clearagi;    /* clear agi unlinked bucket */
 44         struct xfs_trans_res    tr_growrtalloc; /* grow realtime allocations */
 45         struct xfs_trans_res    tr_growrtzero;  /* grow realtime zeroing */
 46         struct xfs_trans_res    tr_growrtfree;  /* grow realtime freeing */
 47         struct xfs_trans_res    tr_qm_setqlim;  /* adjust quota limits */
 48         struct xfs_trans_res    tr_qm_dqalloc;  /* allocate quota on disk */
 49         struct xfs_trans_res    tr_sb;          /* modify superblock */
 50         struct xfs_trans_res    tr_fsyncts;     /* update timestamps on fsync */
 51 };
 52 
 53 /* shorthand way of accessing reservation structure */
 54 #define M_RES(mp)       (&(mp)->m_resv)
 55 
 56 /*
 57  * Per-directory log reservation for any directory change.
 58  * dir blocks: (1 btree block per level + data block + free block) * dblock size
 59  * bmap btree: (levels + 2) * max depth * block size
 60  * v2 directory blocks can be fragmented below the dirblksize down to the fsb
 61  * size, so account for that in the DAENTER macros.
 62  */
 63 #define XFS_DIROP_LOG_RES(mp)   \
 64         (XFS_FSB_TO_B(mp, XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK)) + \
 65          (XFS_FSB_TO_B(mp, XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)))
 66 #define XFS_DIROP_LOG_COUNT(mp) \
 67         (XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \
 68          XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)
 69 
 70 /*
 71  * Various log count values.
 72  */
 73 #define XFS_DEFAULT_LOG_COUNT           1
 74 #define XFS_DEFAULT_PERM_LOG_COUNT      2
 75 #define XFS_ITRUNCATE_LOG_COUNT         2
 76 #define XFS_INACTIVE_LOG_COUNT          2
 77 #define XFS_CREATE_LOG_COUNT            2
 78 #define XFS_CREATE_TMPFILE_LOG_COUNT    2
 79 #define XFS_MKDIR_LOG_COUNT             3
 80 #define XFS_SYMLINK_LOG_COUNT           3
 81 #define XFS_REMOVE_LOG_COUNT            2
 82 #define XFS_LINK_LOG_COUNT              2
 83 #define XFS_RENAME_LOG_COUNT            2
 84 #define XFS_WRITE_LOG_COUNT             2
 85 #define XFS_ADDAFORK_LOG_COUNT          2
 86 #define XFS_ATTRINVAL_LOG_COUNT         1
 87 #define XFS_ATTRSET_LOG_COUNT           3
 88 #define XFS_ATTRRM_LOG_COUNT            3
 89 
 90 /*
 91  * Original log operation counts were overestimated in the early days of
 92  * reflink.  These are retained here purely for minimum log size calculations
 93  * and must not be used for runtime reservations.
 94  */
 95 #define XFS_ITRUNCATE_LOG_COUNT_REFLINK 8
 96 #define XFS_WRITE_LOG_COUNT_REFLINK     8
 97 
 98 void xfs_trans_resv_calc(struct xfs_mount *mp, struct xfs_trans_resv *resp);
 99 uint xfs_allocfree_block_count(struct xfs_mount *mp, uint num_ops);
100 
101 unsigned int xfs_calc_itruncate_reservation_minlogsize(struct xfs_mount *mp);
102 unsigned int xfs_calc_write_reservation_minlogsize(struct xfs_mount *mp);
103 unsigned int xfs_calc_qm_dqalloc_reservation_minlogsize(struct xfs_mount *mp);
104 
105 #endif  /* __XFS_TRANS_RESV_H__ */
106 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php