misc typedef removal
Hi all,
this series removes a bunch of almost unused typedefs. I had these lying around in an otherwise unrelated branch and would like to offload them.
PATCH 1/3 xfs: remove the xfs_dinode_t typedef
Remove the few leftover instances of the xfs_dinode_t typedef.
--- fs/xfs/libxfs/xfs_format.h | 4 ++-- fs/xfs/libxfs/xfs_inode_buf.c | 6 +++--- fs/xfs/libxfs/xfs_inode_fork.c | 16 ++++++++-------- fs/xfs/xfs_buf_item_recover.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-)
fs/xfs/libxfs/xfs_format.h +2 -2
@@ -977,7 +977,7 @@ static inline time64_t xfs_bigtime_to_unix(uint64_t ondisk_seconds)* padding field for v3 inodes. */ #define XFS_DINODE_MAGIC 0x494e/* 'IN' */ -typedef struct xfs_dinode { +struct xfs_dinode {__be16 di_magic;/* inode magic # = XFS_DINODE_MAGIC */ __be16 di_mode;/* mode and type of file */ __u8 di_version;/* inode version */
@@ -1022,7 +1022,7 @@ typedef struct xfs_dinode {uuid_t di_uuid;/* UUID of the filesystem */ /* structure must be padded to 64 bit alignment */ -} xfs_dinode_t; +};#define XFS_DINODE_CRC_OFF offsetof(struct xfs_dinode, di_crc)
fs/xfs/libxfs/xfs_inode_buf.c +3 -3
@@ -51,9 +51,9 @@ xfs_inode_buf_verify( agno =xfs_daddr_to_agno (mp,XFS_BUF_ADDR (bp)); ni =XFS_BB_TO_FSB (mp, bp->b_length) * mp->m_sb.sb_inopblock;for (i =0 ; i < ni; i++) { -int di_ok; -xfs_dinode_t *dip; -xfs_agino_t unlinked_ino; +struct xfs_dinode *dip; +xfs_agino_t unlinked_ino; +int di_ok; dip =xfs_buf_offset (bp, (i << mp->m_sb.sb_inodelog)); unlinked_ino =be32_to_cpu (dip->di_next_unlinked);
fs/xfs/libxfs/xfs_inode_fork.c +8 -8
@@ -67,10 +67,10 @@ xfs_init_local_fork(*/ STATIC intxfs_iformat_local ( -xfs_inode_t *ip, -xfs_dinode_t *dip, -int whichfork, -int size) +struct xfs_inode *ip, +struct xfs_dinode *dip, +int whichfork, +int size) {/* * If the size is unreasonable, then something
@@ -162,8 +162,8 @@ xfs_iformat_extents(*/ STATIC intxfs_iformat_btree ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,int whichfork) {struct xfs_mount *mp = ip->i_mount;
@@ -580,8 +580,8 @@ xfs_iextents_copy(*/ void xfs_iflush_fork ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,struct xfs_inode_log_item *iip,int whichfork) {
fs/xfs/xfs_buf_item_recover.c +1 -1
@@ -603,7 +603,7 @@ xlog_recover_do_inode_buffer( inodes_per_buf =BBTOB (bp->b_length) >> mp->m_sb.sb_inodelog;for (i =0 ; i < inodes_per_buf; i++) { next_unlinked_offset = (i * mp->m_sb.sb_inodesize) + - offsetof(xfs_dinode_t , di_next_unlinked); + offsetof(struct xfs_dinode , di_next_unlinked);while (next_unlinked_offset >= (reg_buf_offset + reg_buf_bytes)) {
Signature · 1 line
2.30.2
Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef
fs/xfs/libxfs/xfs_inode_fork.c xfs_iformat_extents( · line 167
Quoted 11 lines · Christoph Hellwig
/*
* If the size is unreasonable, then somethingfs/xfs/libxfs/xfs_inode_fork.c +2
-2@@ -162,8 +162,8 @@ xfs_iformat_extents(*/ STATIC intxfs_iformat_btree ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,int whichfork)
Hi,
since you are also removing xfs_inode_t I'd like to ask if it is a good idea to send a separate patch removing all other instances of xfs_inode_t? (I'm happy to do it).
Patch applies, builds and LGTM.
Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef
Quoted 16 lines · Pavel Reichl
fs/xfs/libxfs/xfs_inode_fork.c xfs_iformat_extents( · line 167
Quoted 11 lines · Christoph Hellwig
/*
* If the size is unreasonable, then somethingfs/xfs/libxfs/xfs_inode_fork.c +2
-2@@ -162,8 +162,8 @@ xfs_iformat_extents(*/ STATIC intxfs_iformat_btree ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,int whichfork)Hi,
Quoted 1 line
since you are also removing
xfs_inode_tI'd like to ask if it is a good idea
[assuming you meant xfs_dinode_t here]
Quoted 2 lines
to send a separate patch removing all other instances of
xfs_inode_t? (I'm happy to do it).
Seems like a reasonable thing to me.
--D
Quoted 5 lines
Patch applies, builds and LGTM.
Reviewed-by Pavel Reichl <[email protected]>
Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef
Quoted 15 lines · Darrick J. Wong
Quoted 14 lines · Pavel Reichl
fs/xfs/libxfs/xfs_inode_fork.c xfs_iformat_extents( · line 167
Quoted 11 lines · Christoph Hellwig
/*
* If the size is unreasonable, then somethingfs/xfs/libxfs/xfs_inode_fork.c +2
-2@@ -162,8 +162,8 @@ xfs_iformat_extents(*/ STATIC intxfs_iformat_btree ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,int whichfork)Hi,
Quoted 2 lines
Quoted 1 line
since you are also removing
xfs_inode_tI'd like to ask if it is a good idea[assuming you meant
xfs_dinode_there]
Hmm, I'm sorry but I really did mean xfs_inode_t.
Since the patch is named "remove the xfs_dinode_t typedef" removing xfs_dinode_t is quite expected. But removing xfs_inode_t not so much, hence I'm asking if I should send a patch that removes completely xfs_inode_t as is done for xfs_dinode_t by this very patch.
I hope I'm not missing something :-).
Quoted 5 lines
Quoted 3 lines
to send a separate patch removing all other instances of
xfs_inode_t? (I'm happy to do it).Seems like a reasonable thing to me.
Great, thanks!
Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef
Quoted 20 lines · Pavel Reichl
Quoted 15 lines · Darrick J. Wong
Quoted 14 lines · Pavel Reichl
fs/xfs/libxfs/xfs_inode_fork.c xfs_iformat_extents( · line 167
Quoted 11 lines · Christoph Hellwig
/*
* If the size is unreasonable, then somethingfs/xfs/libxfs/xfs_inode_fork.c +2
-2@@ -162,8 +162,8 @@ xfs_iformat_extents(*/ STATIC intxfs_iformat_btree ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,int whichfork)Hi,
Quoted 2 lines
Quoted 1 line
since you are also removing
xfs_inode_tI'd like to ask if it is a good idea[assuming you meant
xfs_dinode_there]
Quoted 8 lines
Hmm, I'm sorry but I really did mean
xfs_inode_t.Since the patch is named "remove the xfs_dinode_t typedef" removing
xfs_dinode_tis quite expected. But removingxfs_inode_tnot so much, hence I'm asking if I should send a patch that removes completelyxfs_inode_tas is done forxfs_dinode_tby this very patch.I hope I'm not missing something :-).
OH, you were referencing specifically the conversion of the xfs_inode_t in that hunk, not the general theme of removing xfs_dinode_t. Ok, no worries. :)
--D
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
to send a separate patch removing all other instances of
xfs_inode_t? (I'm happy to do it).Seems like a reasonable thing to me.
Great, thanks!
Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
Remove the few leftover instances of the
xfs_dinode_ttypedef.Signed-off-by Christoph Hellwig <[email protected]>
--D
Quoted 103 lines
--- fs/xfs/libxfs/xfs_format.h | 4 ++-- fs/xfs/libxfs/xfs_inode_buf.c | 6 +++--- fs/xfs/libxfs/xfs_inode_fork.c | 16 ++++++++-------- fs/xfs/xfs_buf_item_recover.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-)fs/xfs/libxfs/xfs_format.h +2
-2@@ -977,7 +977,7 @@ static inline time64_t xfs_bigtime_to_unix(uint64_t ondisk_seconds)* padding field for v3 inodes. */ #define XFS_DINODE_MAGIC 0x494e/* 'IN' */ -typedef struct xfs_dinode { +struct xfs_dinode {__be16 di_magic;/* inode magic # = XFS_DINODE_MAGIC */ __be16 di_mode;/* mode and type of file */ __u8 di_version;/* inode version */ @@ -1022,7 +1022,7 @@ typedef struct xfs_dinode {uuid_t di_uuid;/* UUID of the filesystem */ /* structure must be padded to 64 bit alignment */ -} xfs_dinode_t; +};#define XFS_DINODE_CRC_OFF offsetof(struct xfs_dinode, di_crc)fs/xfs/libxfs/xfs_inode_buf.c +3
-3@@ -51,9 +51,9 @@ xfs_inode_buf_verify( agno =xfs_daddr_to_agno (mp,XFS_BUF_ADDR (bp)); ni =XFS_BB_TO_FSB (mp, bp->b_length) * mp->m_sb.sb_inopblock;for (i =0 ; i < ni; i++) { -int di_ok; -xfs_dinode_t *dip; -xfs_agino_t unlinked_ino; +struct xfs_dinode *dip; +xfs_agino_t unlinked_ino; +int di_ok; dip =xfs_buf_offset (bp, (i << mp->m_sb.sb_inodelog)); unlinked_ino =be32_to_cpu (dip->di_next_unlinked);fs/xfs/libxfs/xfs_inode_fork.c +8
-8@@ -67,10 +67,10 @@ xfs_init_local_fork(*/ STATIC intxfs_iformat_local ( -xfs_inode_t *ip, -xfs_dinode_t *dip, -int whichfork, -int size) +struct xfs_inode *ip, +struct xfs_dinode *dip, +int whichfork, +int size) {/* * If the size is unreasonable, then something @@ -162,8 +162,8 @@ xfs_iformat_extents(*/ STATIC intxfs_iformat_btree ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,int whichfork) {struct xfs_mount *mp = ip->i_mount;@@ -580,8 +580,8 @@ xfs_iextents_copy(*/ void xfs_iflush_fork ( -xfs_inode_t *ip, -xfs_dinode_t *dip, +struct xfs_inode *ip, +struct xfs_dinode *dip,struct xfs_inode_log_item *iip,int whichfork) {fs/xfs/xfs_buf_item_recover.c +1
-1@@ -603,7 +603,7 @@ xlog_recover_do_inode_buffer( inodes_per_buf =BBTOB (bp->b_length) >> mp->m_sb.sb_inodelog;for (i =0 ; i < inodes_per_buf; i++) { next_unlinked_offset = (i * mp->m_sb.sb_inodesize) + - offsetof(xfs_dinode_t , di_next_unlinked); + offsetof(struct xfs_dinode , di_next_unlinked);while (next_unlinked_offset >= (reg_buf_offset + reg_buf_bytes)) {Signature · 1 line
2.30.2
Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
Remove the few leftover instances of the
xfs_dinode_ttypedef.Signed-off-by Christoph Hellwig <[email protected]>
True for the kernel, but there are:
$ git grep xfs_dinode_t |wc -l 126
A *lot* of userspace uses of this typedef. So either the typedef stays defined in libxfs, or this also needs a patch for the removal of the typedef from xfsprogs as well.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH 2/3 xfs: remove the xfs_dsb_t typedef
In reply to Christoph HellwigRemove the few leftover instances of the xfs_dinode_t typedef.
--- fs/xfs/libxfs/xfs_format.h | 5 ++--- fs/xfs/libxfs/xfs_sb.c | 4 ++-- fs/xfs/xfs_trans.c | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-)
fs/xfs/libxfs/xfs_format.h +2 -3
@@ -184,7 +184,7 @@ typedef struct xfs_sb {* Superblock - on disk version. Must match the in core version above. * Must be padded to 64 bit alignment. */ -typedef struct xfs_dsb { +struct xfs_dsb {__be32 sb_magicnum;/* magic number == XFS_SB_MAGIC */ __be32 sb_blocksize;/* logical block size, bytes */ __be64 sb_dblocks;/* number of data blocks */
@@ -263,8 +263,7 @@ typedef struct xfs_dsb {uuid_t sb_meta_uuid;/* metadata file system unique id */ /* must be padded to 64 bit alignment */ -} xfs_dsb_t; - +};/* * Misc. Flags - warning - these will be cleared by xfs_repair unless
fs/xfs/libxfs/xfs_sb.c +2 -2
@@ -391,7 +391,7 @@ xfs_sb_quota_from_disk(struct xfs_sb *sbp)static void __xfs_sb_from_disk (struct xfs_sb *to, -xfs_dsb_t *from, +struct xfs_dsb *from,bool convert_xquota) { to->sb_magicnum =be32_to_cpu (from->sb_magicnum);
@@ -466,7 +466,7 @@ __xfs_sb_from_disk(void xfs_sb_from_disk (struct xfs_sb *to, -xfs_dsb_t *from) +struct xfs_dsb *from) {__xfs_sb_from_disk (to, from, true); }
fs/xfs/xfs_trans.c +4 -4
@@ -477,7 +477,7 @@ STATIC voidxfs_trans_apply_sb_deltas ( xfs_trans_t *tp) { -xfs_dsb_t *sbp; +struct xfs_dsb *sbp;struct xfs_buf *bp;int whole =0 ;
@@ -541,14 +541,14 @@ xfs_trans_apply_sb_deltas(/* * Log the whole thing, the fields are noncontiguous. */ -xfs_trans_log_buf (tp, bp,0 ,sizeof (xfs_dsb_t) -1 ); +xfs_trans_log_buf (tp, bp,0 ,sizeof (struct xfs_dsb ) -1 ); else/* * Since all the modifiable fields are contiguous, we * can get away with this. */ -xfs_trans_log_buf (tp ,bp ,offsetof (xfs_dsb_t ,sb_icount ), - offsetof(xfs_dsb_t, sb_frextents) + +xfs_trans_log_buf (tp ,bp ,offsetof (struct xfs_dsb ,sb_icount ), + offsetof(struct xfs_dsb, sb_frextents) + sizeof(sbp->sb_frextents) - 1); }
Signature · 1 line
2.30.2
Re: [PATCH 2/3] xfs: remove the xfs_dsb_t typedef
Patch applies, builds and LGTM.
Re: [PATCH 2/3] xfs: remove the xfs_dsb_t typedef
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
Remove the few leftover instances of the
xfs_dinode_ttypedef.Signed-off-by Christoph Hellwig <[email protected]>
Fix the description: s/xfs_dinode_t/xfs_dsb_t/
Quoted 83 lines
--- fs/xfs/libxfs/xfs_format.h | 5 ++--- fs/xfs/libxfs/xfs_sb.c | 4 ++-- fs/xfs/xfs_trans.c | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-)fs/xfs/libxfs/xfs_format.h +2
-3@@ -184,7 +184,7 @@ typedef struct xfs_sb {* Superblock - on disk version. Must match the in core version above. * Must be padded to 64 bit alignment. */ -typedef struct xfs_dsb { +struct xfs_dsb {__be32 sb_magicnum;/* magic number == XFS_SB_MAGIC */ __be32 sb_blocksize;/* logical block size, bytes */ __be64 sb_dblocks;/* number of data blocks */ @@ -263,8 +263,7 @@ typedef struct xfs_dsb {uuid_t sb_meta_uuid;/* metadata file system unique id */ /* must be padded to 64 bit alignment */ -} xfs_dsb_t; - +};/* * Misc. Flags - warning - these will be cleared by xfs_repair unless fs/xfs/libxfs/xfs_sb.c +2
-2@@ -391,7 +391,7 @@ xfs_sb_quota_from_disk(struct xfs_sb *sbp)static void __xfs_sb_from_disk (struct xfs_sb *to, -xfs_dsb_t *from, +struct xfs_dsb *from,bool convert_xquota) { to->sb_magicnum =be32_to_cpu (from->sb_magicnum);@@ -466,7 +466,7 @@ __xfs_sb_from_disk(void xfs_sb_from_disk (struct xfs_sb *to, -xfs_dsb_t *from) +struct xfs_dsb *from) {__xfs_sb_from_disk (to, from, true); }fs/xfs/xfs_trans.c +4
-4@@ -477,7 +477,7 @@ STATIC voidxfs_trans_apply_sb_deltas ( xfs_trans_t *tp) { -xfs_dsb_t *sbp; +struct xfs_dsb *sbp;struct xfs_buf *bp;int whole =0 ;@@ -541,14 +541,14 @@ xfs_trans_apply_sb_deltas(/* * Log the whole thing, the fields are noncontiguous. */ -xfs_trans_log_buf (tp, bp,0 ,sizeof (xfs_dsb_t) -1 ); +xfs_trans_log_buf (tp, bp,0 ,sizeof (struct xfs_dsb ) -1 ); else/* * Since all the modifiable fields are contiguous, we * can get away with this. */ -xfs_trans_log_buf (tp ,bp ,offsetof (xfs_dsb_t ,sb_icount ), - offsetof(xfs_dsb_t, sb_frextents) + +xfs_trans_log_buf (tp ,bp ,offsetof (struct xfs_dsb ,sb_icount ), + offsetof(struct xfs_dsb, sb_frextents) + sizeof(sbp->sb_frextents) - 1); }
Re: [PATCH 2/3] xfs: remove the xfs_dsb_t typedef
In reply to Christoph HellwigQuoted 1 line · Christoph Hellwig
Remove the few leftover instances of the
xfs_dinode_ttypedef.
With the commit message fixed,
--D
Quoted 87 lines
Signed-off-by Christoph Hellwig <[email protected]>--- fs/xfs/libxfs/xfs_format.h | 5 ++--- fs/xfs/libxfs/xfs_sb.c | 4 ++-- fs/xfs/xfs_trans.c | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-)fs/xfs/libxfs/xfs_format.h +2
-3@@ -184,7 +184,7 @@ typedef struct xfs_sb {* Superblock - on disk version. Must match the in core version above. * Must be padded to 64 bit alignment. */ -typedef struct xfs_dsb { +struct xfs_dsb {__be32 sb_magicnum;/* magic number == XFS_SB_MAGIC */ __be32 sb_blocksize;/* logical block size, bytes */ __be64 sb_dblocks;/* number of data blocks */ @@ -263,8 +263,7 @@ typedef struct xfs_dsb {uuid_t sb_meta_uuid;/* metadata file system unique id */ /* must be padded to 64 bit alignment */ -} xfs_dsb_t; - +};/* * Misc. Flags - warning - these will be cleared by xfs_repair unless fs/xfs/libxfs/xfs_sb.c +2
-2@@ -391,7 +391,7 @@ xfs_sb_quota_from_disk(struct xfs_sb *sbp)static void __xfs_sb_from_disk (struct xfs_sb *to, -xfs_dsb_t *from, +struct xfs_dsb *from,bool convert_xquota) { to->sb_magicnum =be32_to_cpu (from->sb_magicnum);@@ -466,7 +466,7 @@ __xfs_sb_from_disk(void xfs_sb_from_disk (struct xfs_sb *to, -xfs_dsb_t *from) +struct xfs_dsb *from) {__xfs_sb_from_disk (to, from, true); }fs/xfs/xfs_trans.c +4
-4@@ -477,7 +477,7 @@ STATIC voidxfs_trans_apply_sb_deltas ( xfs_trans_t *tp) { -xfs_dsb_t *sbp; +struct xfs_dsb *sbp;struct xfs_buf *bp;int whole =0 ;@@ -541,14 +541,14 @@ xfs_trans_apply_sb_deltas(/* * Log the whole thing, the fields are noncontiguous. */ -xfs_trans_log_buf (tp, bp,0 ,sizeof (xfs_dsb_t) -1 ); +xfs_trans_log_buf (tp, bp,0 ,sizeof (struct xfs_dsb ) -1 ); else/* * Since all the modifiable fields are contiguous, we * can get away with this. */ -xfs_trans_log_buf (tp ,bp ,offsetof (xfs_dsb_t ,sb_icount ), - offsetof(xfs_dsb_t, sb_frextents) + +xfs_trans_log_buf (tp ,bp ,offsetof (struct xfs_dsb ,sb_icount ), + offsetof(struct xfs_dsb, sb_frextents) + sizeof(sbp->sb_frextents) - 1); }Signature · 1 line
2.30.2
PATCH 3/3 xfs: remove the xfs_dqblk_t typedef
In reply to Christoph HellwigRemove the few leftover instances of the xfs_dinode_t typedef.
--- fs/xfs/libxfs/xfs_dquot_buf.c | 4 ++-- fs/xfs/libxfs/xfs_format.h | 4 ++-- fs/xfs/xfs_dquot.c | 2 +- fs/xfs/xfs_qm.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
fs/xfs/libxfs/xfs_dquot_buf.c +2 -2
@@ -22,7 +22,7 @@ xfs_calc_dquots_per_chunk( unsigned int nbblks) /* basic block units */ {ASSERT (nbblks >0 ); -return BBTOB (nbblks) /sizeof (xfs_dqblk_t); +return BBTOB (nbblks) /sizeof (struct xfs_dqblk ); }/*
@@ -127,7 +127,7 @@ xfs_dqblk_repair(* Typically, a repair is only requested by quotacheck. */ ASSERT (id !=-1 ); -memset (dqb,0 ,sizeof (xfs_dqblk_t)); +memset (dqb,0 ,sizeof (struct xfs_dqblk )); dqb->dd_diskdq.d_magic =cpu_to_be16 (XFS_DQUOT_MAGIC ); dqb->dd_diskdq.d_version =XFS_DQUOT_VERSION ;
fs/xfs/libxfs/xfs_format.h +2 -2
@@ -1411,7 +1411,7 @@ struct xfs_disk_dquot {* This is what goes on disk. This is separated from the xfs_disk_dquot because * carrying the unnecessary padding would be a waste of memory. */ -typedef struct xfs_dqblk { +struct xfs_dqblk {struct xfs_disk_dquot dd_diskdq;/* portion living incore as well */ char dd_fill[4 ];/* filling for posterity */
@@ -1421,7 +1421,7 @@ typedef struct xfs_dqblk {__be32 dd_crc;/* checksum */ __be64 dd_lsn;/* last modification in log */ uuid_t dd_uuid;/* location information */ -} xfs_dqblk_t; +};#define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)
fs/xfs/xfs_dquot.c +1 -1
@@ -471,7 +471,7 @@ xfs_dquot_alloc(* Offset of dquot in the (fixed sized) dquot chunk. */ dqp->q_bufoffset = (id % mp->m_quotainfo->qi_dqperchunk) * -sizeof (xfs_dqblk_t); +sizeof (struct xfs_dqblk );/* * Because we want to use a counting completion, complete
fs/xfs/xfs_qm.c +1 -1
@@ -850,7 +850,7 @@ xfs_qm_reset_dqcounts(*/ #ifdef DEBUG j = (int )XFS_FSB_TO_B (mp,XFS_DQUOT_CLUSTER_SIZE_FSB ) / -sizeof (xfs_dqblk_t); +sizeof (struct xfs_dqblk );ASSERT (mp->m_quotainfo->qi_dqperchunk == j);#endif dqb = bp->b_addr;
Signature · 1 line
2.30.2
Re: [PATCH 3/3] xfs: remove the xfs_dqblk_t typedef
Patch applies, builds and LGTM.
Re: [PATCH 3/3] xfs: remove the xfs_dqblk_t typedef
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
Remove the few leftover instances of the
xfs_dinode_ttypedef.Signed-off-by Christoph Hellwig <[email protected]>
Fix the description: s/xfs_dinode_t/xfs_dqblk_t/
Quoted 78 lines
--- fs/xfs/libxfs/xfs_dquot_buf.c | 4 ++-- fs/xfs/libxfs/xfs_format.h | 4 ++-- fs/xfs/xfs_dquot.c | 2 +- fs/xfs/xfs_qm.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_dquot_buf.c +2
-2@@ -22,7 +22,7 @@ xfs_calc_dquots_per_chunk( unsigned int nbblks) /* basic block units */ {ASSERT (nbblks >0 ); -return BBTOB (nbblks) /sizeof (xfs_dqblk_t); +return BBTOB (nbblks) /sizeof (struct xfs_dqblk ); }/* @@ -127,7 +127,7 @@ xfs_dqblk_repair(* Typically, a repair is only requested by quotacheck. */ ASSERT (id !=-1 ); -memset (dqb,0 ,sizeof (xfs_dqblk_t)); +memset (dqb,0 ,sizeof (struct xfs_dqblk )); dqb->dd_diskdq.d_magic =cpu_to_be16 (XFS_DQUOT_MAGIC ); dqb->dd_diskdq.d_version =XFS_DQUOT_VERSION ;fs/xfs/libxfs/xfs_format.h +2
-2@@ -1411,7 +1411,7 @@ struct xfs_disk_dquot {* This is what goes on disk. This is separated from the xfs_disk_dquot because * carrying the unnecessary padding would be a waste of memory. */ -typedef struct xfs_dqblk { +struct xfs_dqblk {struct xfs_disk_dquot dd_diskdq;/* portion living incore as well */ char dd_fill[4 ];/* filling for posterity */ @@ -1421,7 +1421,7 @@ typedef struct xfs_dqblk {__be32 dd_crc;/* checksum */ __be64 dd_lsn;/* last modification in log */ uuid_t dd_uuid;/* location information */ -} xfs_dqblk_t; +};#define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)fs/xfs/xfs_dquot.c +1
-1@@ -471,7 +471,7 @@ xfs_dquot_alloc(* Offset of dquot in the (fixed sized) dquot chunk. */ dqp->q_bufoffset = (id % mp->m_quotainfo->qi_dqperchunk) * -sizeof (xfs_dqblk_t); +sizeof (struct xfs_dqblk );/* * Because we want to use a counting completion, complete fs/xfs/xfs_qm.c +1
-1@@ -850,7 +850,7 @@ xfs_qm_reset_dqcounts(*/ #ifdef DEBUG j = (int )XFS_FSB_TO_B (mp,XFS_DQUOT_CLUSTER_SIZE_FSB ) / -sizeof (xfs_dqblk_t); +sizeof (struct xfs_dqblk );ASSERT (mp->m_quotainfo->qi_dqperchunk == j);#endif dqb = bp->b_addr;
Re: [PATCH 3/3] xfs: remove the xfs_dqblk_t typedef
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
Remove the few leftover instances of the
xfs_dinode_ttypedef.Signed-off-by Christoph Hellwig <[email protected]>
With the commit message fixed,
--D
Quoted 80 lines
--- fs/xfs/libxfs/xfs_dquot_buf.c | 4 ++-- fs/xfs/libxfs/xfs_format.h | 4 ++-- fs/xfs/xfs_dquot.c | 2 +- fs/xfs/xfs_qm.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_dquot_buf.c +2
-2@@ -22,7 +22,7 @@ xfs_calc_dquots_per_chunk( unsigned int nbblks) /* basic block units */ {ASSERT (nbblks >0 ); -return BBTOB (nbblks) /sizeof (xfs_dqblk_t); +return BBTOB (nbblks) /sizeof (struct xfs_dqblk ); }/* @@ -127,7 +127,7 @@ xfs_dqblk_repair(* Typically, a repair is only requested by quotacheck. */ ASSERT (id !=-1 ); -memset (dqb,0 ,sizeof (xfs_dqblk_t)); +memset (dqb,0 ,sizeof (struct xfs_dqblk )); dqb->dd_diskdq.d_magic =cpu_to_be16 (XFS_DQUOT_MAGIC ); dqb->dd_diskdq.d_version =XFS_DQUOT_VERSION ;fs/xfs/libxfs/xfs_format.h +2
-2@@ -1411,7 +1411,7 @@ struct xfs_disk_dquot {* This is what goes on disk. This is separated from the xfs_disk_dquot because * carrying the unnecessary padding would be a waste of memory. */ -typedef struct xfs_dqblk { +struct xfs_dqblk {struct xfs_disk_dquot dd_diskdq;/* portion living incore as well */ char dd_fill[4 ];/* filling for posterity */ @@ -1421,7 +1421,7 @@ typedef struct xfs_dqblk {__be32 dd_crc;/* checksum */ __be64 dd_lsn;/* last modification in log */ uuid_t dd_uuid;/* location information */ -} xfs_dqblk_t; +};#define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)fs/xfs/xfs_dquot.c +1
-1@@ -471,7 +471,7 @@ xfs_dquot_alloc(* Offset of dquot in the (fixed sized) dquot chunk. */ dqp->q_bufoffset = (id % mp->m_quotainfo->qi_dqperchunk) * -sizeof (xfs_dqblk_t); +sizeof (struct xfs_dqblk );/* * Because we want to use a counting completion, complete fs/xfs/xfs_qm.c +1
-1@@ -850,7 +850,7 @@ xfs_qm_reset_dqcounts(*/ #ifdef DEBUG j = (int )XFS_FSB_TO_B (mp,XFS_DQUOT_CLUSTER_SIZE_FSB ) / -sizeof (xfs_dqblk_t); +sizeof (struct xfs_dqblk );ASSERT (mp->m_quotainfo->qi_dqperchunk == j);#endif dqb = bp->b_addr;Signature · 1 line
2.30.2