kill XFS_LITINO
PATCH 1/3 kill XFS_LITINO
No point having a macro that just derefences a member of the struct pointer passed in.
Signed-off-by Christoph Hellwig <[email protected]>
fs/xfs/xfs_attr_leaf.c +3 -3
@@ -106,7 +106,7 @@ xfs_attr_namesp_match(int arg_flags, int/*======================================================================== -* External routines when attribute fork size < XFS_LITINO(mp). +* External routines when attribute fork size < mp->m_litino. *========================================================================*/ /*
@@ -127,7 +127,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_tint dsize;xfs_mount_t *mp = dp->i_mount; - offset = (XFS_LITINO (mp) - bytes) >>3 ;/* rounded down */ + offset = (mp->m_litino - bytes) >>3 ;/* rounded down */ switch (dp->i_d.di_format) {case XFS_DINODE_FMT_DEV :
@@ -184,7 +184,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_t minforkoff =roundup (minforkoff,8 ) >>3 ;/* attr fork btree root can have at least this many key/ptr pairs */ - maxforkoff =XFS_LITINO (mp) -XFS_BMDR_SPACE_CALC (MINABTPTRS ); + maxforkoff = mp->m_litino -XFS_BMDR_SPACE_CALC (MINABTPTRS ); maxforkoff = maxforkoff >>3 ;/* rounded down */ if (offset >= minforkoff && offset < maxforkoff)
fs/xfs/xfs_attr_leaf.h +1 -1
@@ -218,7 +218,7 @@ typedef struct xfs_attr_inactive_list {*========================================================================*/ /* -* Internal routines when attribute fork size < XFS_LITINO(mp). +* Internal routines when attribute fork size < mp->m_litino. */ void xfs_attr_shortform_create (struct xfs_da_args *args);void xfs_attr_shortform_add (struct xfs_da_args *args,int forkoff);
fs/xfs/xfs_dinode.h +2 -10
@@ -76,10 +76,6 @@ typedef struct xfs_dinode_core { typedef struct xfs_dinode { xfs_dinode_core_t di_core; - /* - * In adding anything between the core and the union, be - * sure to update the macros like XFS_LITINO below. - */ __be32 di_next_unlinked;/* agi unlinked list ptr */ union { xfs_bmdr_block_t di_bmbt; /* btree root block */
@@ -160,10 +156,6 @@ typedef enum xfs_dinode_fmt#define XFS_DINODE_MIN_SIZE (1 << XFS_DINODE_MIN_LOG)#define XFS_DINODE_MAX_SIZE (1 << XFS_DINODE_MAX_LOG) -/* -* Inode size for given fs. -*/ -#define XFS_LITINO (mp) ((mp)->m_litino)#define XFS_BROOT_SIZE_ADJ \ (XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t))
@@ -176,10 +168,10 @@ typedef enum xfs_dinode_fmt#define XFS_DFORK_DSIZE (dip,mp) \ (XFS_DFORK_Q(dip) ? \ XFS_DFORK_BOFF(dip) : \ - XFS_LITINO(mp)) + (mp)->m_litino)#define XFS_DFORK_ASIZE (dip,mp) \ (XFS_DFORK_Q(dip) ? \ - XFS_LITINO(mp) - XFS_DFORK_BOFF(dip) : \ + (mp)->m_litino - XFS_DFORK_BOFF(dip) : \ 0)#define XFS_DFORK_SIZE (dip,mp,w) \ ((w) == XFS_DATA_FORK ? \
fs/xfs/xfs_inode.h +2 -2
@@ -177,10 +177,10 @@ typedef struct xfs_icdinode {#define XFS_IFORK_DSIZE (ip) \ (XFS_IFORK_Q(ip) ? \ XFS_IFORK_BOFF(ip) : \ - XFS_LITINO((ip)->i_mount)) + (ip)->i_mount->m_litino)#define XFS_IFORK_ASIZE (ip) \ (XFS_IFORK_Q(ip) ? \ - XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \ + (ip)->i_mount->m_litino - XFS_IFORK_BOFF(ip) : \ 0)#define XFS_IFORK_SIZE (ip,w) \ ((w) == XFS_DATA_FORK ? \
fs/xfs/xfs_mount.c +3 -3
@@ -590,8 +590,8 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sbASSERT (sbp->sb_inodesize >=256 && sbp->sb_inodesize <=2048 );switch (sbp->sb_inodesize) {case 256 : - mp->m_attroffset =XFS_LITINO (mp) - -XFS_BMDR_SPACE_CALC (MINABTPTRS ); + mp->m_attroffset = + mp->m_litino -XFS_BMDR_SPACE_CALC (MINABTPTRS );break ;case 512 :case 1024 :
@@ -601,7 +601,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sbdefault :ASSERT (0 ); } -ASSERT (mp->m_attroffset <XFS_LITINO (mp)); +ASSERT (mp->m_attroffset < mp->m_litino); mp->m_alloc_mxr[0 ] =xfs_allocbt_maxrecs (mp, sbp->sb_blocksize,1 ); mp->m_alloc_mxr[1 ] =xfs_allocbt_maxrecs (mp, sbp->sb_blocksize,0 );
fs/xfs/xfs_vnodeops.c +1 -1
@@ -2406,7 +2406,7 @@ xfs_symlink(* The symlink will fit into the inode data fork? * There can't be any attributes so we get the whole variable part. */ -if (pathlen <=XFS_LITINO (mp)) +if (pathlen <= mp->m_litino) fs_blocks =0 ;else fs_blocks =XFS_B_TO_FSB (mp, pathlen);
Quoted 2 lines · Christoph Hellwig
No point having a macro that just derefences a member of the struct pointer passed in.
Looks ok.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
After some discusson in IRC I'll take this patch back. We need to do this calculation per inode, and for that XFS_LITINO needs to be replaced with a per-inode macro and not a direct dereference of a xfs_mount member. I'll post versions of the other two patches that don't need this one ASAP.