Skip to contentSkip to conversation

misc typedef removal

PATCH In review Christoph Hellwig 5 participants 16 messages Aug 12, 2021 XFS filesystem

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw

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
index 5d8a129150d547..f601049b65f465 100644
@@ -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
index 84ea2e0af9f026..891940cc16f905 100644
@@ -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
index 1d174909f9bdf5..08a390a259491c 100644
@@ -67,10 +67,10 @@ xfs_init_local_fork(
  */
 STATIC int
 xfs_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 int
 xfs_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
index 4775485b406233..55ee89a88f5549 100644
@@ -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
Reviewed-by on v1 1/3
#2 lore raw

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 something

fs/xfs/libxfs/xfs_inode_fork.c +2 -2
@@ -162,8 +162,8 @@ xfs_iformat_extents(
   */
  STATIC int
  xfs_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.

#3 lore raw

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 something

fs/xfs/libxfs/xfs_inode_fork.c +2 -2
@@ -162,8 +162,8 @@ xfs_iformat_extents(
   */
  STATIC int
  xfs_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_t I'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.

#4 lore raw

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 something

fs/xfs/libxfs/xfs_inode_fork.c +2 -2
@@ -162,8 +162,8 @@ xfs_iformat_extents(
    */
   STATIC int
   xfs_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_t I'd like to ask if it is a good idea

[assuming you meant xfs_dinode_t here]

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!

#5 lore raw

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 something

fs/xfs/libxfs/xfs_inode_fork.c +2 -2
@@ -162,8 +162,8 @@ xfs_iformat_extents(
    */
   STATIC int
   xfs_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_t I'd like to ask if it is a good idea

[assuming you meant xfs_dinode_t here]

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_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 :-).

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!

Reviewed-by on v1 1/3
#6 lore raw

Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef

In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Remove the few leftover instances of the xfs_dinode_t typedef.

--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
index 5d8a129150d547..f601049b65f465 100644
@@ -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
index 84ea2e0af9f026..891940cc16f905 100644
@@ -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
index 1d174909f9bdf5..08a390a259491c 100644
@@ -67,10 +67,10 @@ xfs_init_local_fork(
  */
 STATIC int
 xfs_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 int
 xfs_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
index 4775485b406233..55ee89a88f5549 100644
@@ -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
#7 lore raw

Re: [PATCH 1/3] xfs: remove the xfs_dinode_t typedef

In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Remove the few leftover instances of the xfs_dinode_t typedef.

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]
#8 lore raw

PATCH 2/3 xfs: remove the xfs_dsb_t typedef

In reply to Christoph Hellwig

Remove 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
index f601049b65f465..5819c25c1478d0 100644
@@ -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
index 04f5386446dbb0..56d241cb17ee1b 100644
@@ -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
index 83abaa21961605..7f4f431bc256ce 100644
@@ -477,7 +477,7 @@ STATIC void
 xfs_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
#10 lore raw

Re: [PATCH 2/3] xfs: remove the xfs_dsb_t typedef

In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Remove the few leftover instances of the xfs_dinode_t typedef.

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
index f601049b65f465..5819c25c1478d0 100644
@@ -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
index 04f5386446dbb0..56d241cb17ee1b 100644
@@ -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
index 83abaa21961605..7f4f431bc256ce 100644
@@ -477,7 +477,7 @@ STATIC void
 xfs_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);
 }
 
Reviewed-by on v1 2/3
#11 lore raw

Re: [PATCH 2/3] xfs: remove the xfs_dsb_t typedef

In reply to Christoph Hellwig
Quoted 1 line · Christoph Hellwig

Remove the few leftover instances of the xfs_dinode_t typedef.

With the commit message fixed,

--D

Quoted 87 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
index f601049b65f465..5819c25c1478d0 100644
@@ -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
index 04f5386446dbb0..56d241cb17ee1b 100644
@@ -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
index 83abaa21961605..7f4f431bc256ce 100644
@@ -477,7 +477,7 @@ STATIC void
 xfs_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
#12 lore raw

PATCH 3/3 xfs: remove the xfs_dqblk_t typedef

In reply to Christoph Hellwig

Remove 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
index 6766417d5ba448..7691e44d38b9ac 100644
@@ -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
index 5819c25c1478d0..61e454e4381e42 100644
@@ -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
index c301b18b7685b1..a86665bdd4afb5 100644
@@ -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
index 2bef4735d03031..95fdbe1b7016da 100644
@@ -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
#14 lore raw

Re: [PATCH 3/3] xfs: remove the xfs_dqblk_t typedef

In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Remove the few leftover instances of the xfs_dinode_t typedef.

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
index 6766417d5ba448..7691e44d38b9ac 100644
@@ -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
index 5819c25c1478d0..61e454e4381e42 100644
@@ -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
index c301b18b7685b1..a86665bdd4afb5 100644
@@ -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
index 2bef4735d03031..95fdbe1b7016da 100644
@@ -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;
Reviewed-by on v1 3/3
#15 lore raw

Re: [PATCH 3/3] xfs: remove the xfs_dqblk_t typedef

In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Remove the few leftover instances of the xfs_dinode_t typedef.

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
index 6766417d5ba448..7691e44d38b9ac 100644
@@ -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
index 5819c25c1478d0..61e454e4381e42 100644
@@ -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
index c301b18b7685b1..a86665bdd4afb5 100644
@@ -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
index 2bef4735d03031..95fdbe1b7016da 100644
@@ -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