All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandan Babu R <chandanrlinux@gmail.com>
To: linux-xfs@vger.kernel.org
Cc: Chandan Babu R <chandanrlinux@gmail.com>, djwong@kernel.org
Subject: [PATCH V2 09/12] xfsprogs: Rename XFS_IOC_BULKSTAT to XFS_IOC_BULKSTAT_V5
Date: Mon, 26 Jul 2021 17:17:21 +0530	[thread overview]
Message-ID: <20210726114724.24956-10-chandanrlinux@gmail.com> (raw)
In-Reply-To: <20210726114724.24956-1-chandanrlinux@gmail.com>

This commit renames XFS_IOC_BULKSTAT to XFS_IOC_BULKSTAT_V5 to allow a future
commit to extend bulkstat facility to support 64-bit extent counters. To this
end, this commit also renames xfs_bulkstat->bs_extents field to
xfs_bulkstat->bs_extents32.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 fsr/xfs_fsr.c      | 4 ++--
 io/bulkstat.c      | 2 +-
 libfrog/bulkstat.c | 8 ++++----
 libxfs/xfs_fs.h    | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index bb5d4a2c0..3446944cb 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -606,7 +606,7 @@ cmp(const void *s1, const void *s2)
 		(bs1->bs_version == XFS_BULKSTAT_VERSION_V5 &&
 		bs2->bs_version == XFS_BULKSTAT_VERSION_V5));
 
-	return (bs2->bs_extents - bs1->bs_extents);
+	return (bs2->bs_extents32 - bs1->bs_extents32);
 }
 
 /*
@@ -670,7 +670,7 @@ fsrfs(char *mntdir, xfs_ino_t startino, int targetrange)
 		for (p = buf, endp = (buf + buflenout); p < endp ; p++) {
 			/* Do some obvious checks now */
 			if (((p->bs_mode & S_IFMT) != S_IFREG) ||
-			     (p->bs_extents < 2))
+			     (p->bs_extents32 < 2))
 				continue;
 
 			ret = open_handle(&file_fd, fshandlep, p,
diff --git a/io/bulkstat.c b/io/bulkstat.c
index 4ae275864..378048379 100644
--- a/io/bulkstat.c
+++ b/io/bulkstat.c
@@ -49,7 +49,7 @@ dump_bulkstat(
 	printf("\tbs_extsize_blks = %"PRIu32"\n", bstat->bs_extsize_blks);
 
 	printf("\tbs_nlink = %"PRIu32"\n", bstat->bs_nlink);
-	printf("\tbs_extents = %"PRIu32"\n", bstat->bs_extents);
+	printf("\tbs_extents = %"PRIu32"\n", bstat->bs_extents32);
 	printf("\tbs_aextents = %"PRIu32"\n", bstat->bs_aextents);
 	printf("\tbs_version = %"PRIu16"\n", bstat->bs_version);
 	printf("\tbs_forkoff = %"PRIu16"\n", bstat->bs_forkoff);
diff --git a/libfrog/bulkstat.c b/libfrog/bulkstat.c
index 195f6ea05..5a967d4b1 100644
--- a/libfrog/bulkstat.c
+++ b/libfrog/bulkstat.c
@@ -61,7 +61,7 @@ xfrog_bulkstat_single5(
 		return ret;
 
 	req->hdr.flags = flags;
-	ret = ioctl(xfd->fd, XFS_IOC_BULKSTAT, req);
+	ret = ioctl(xfd->fd, XFS_IOC_BULKSTAT_V5, req);
 	if (ret) {
 		ret = -errno;
 		goto free;
@@ -260,7 +260,7 @@ xfrog_bulkstat5(
 {
 	int			ret;
 
-	ret = ioctl(xfd->fd, XFS_IOC_BULKSTAT, req);
+	ret = ioctl(xfd->fd, XFS_IOC_BULKSTAT_V5, req);
 	if (ret)
 		return -errno;
 	return 0;
@@ -366,7 +366,7 @@ xfrog_bulkstat_v5_to_v1(
 	bs1->bs_blocks = bs5->bs_blocks;
 	bs1->bs_xflags = bs5->bs_xflags;
 	bs1->bs_extsize = cvt_off_fsb_to_b(xfd, bs5->bs_extsize_blks);
-	bs1->bs_extents = bs5->bs_extents;
+	bs1->bs_extents = bs5->bs_extents32;
 	bs1->bs_gen = bs5->bs_gen;
 	bs1->bs_projid_lo = bs5->bs_projectid & 0xFFFF;
 	bs1->bs_forkoff = bs5->bs_forkoff;
@@ -407,7 +407,7 @@ xfrog_bulkstat_v1_to_v5(
 	bs5->bs_blocks = bs1->bs_blocks;
 	bs5->bs_xflags = bs1->bs_xflags;
 	bs5->bs_extsize_blks = cvt_b_to_off_fsbt(xfd, bs1->bs_extsize);
-	bs5->bs_extents = bs1->bs_extents;
+	bs5->bs_extents32 = bs1->bs_extents;
 	bs5->bs_gen = bs1->bs_gen;
 	bs5->bs_projectid = bstat_get_projid(bs1);
 	bs5->bs_forkoff = bs1->bs_forkoff;
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index 2594fb647..d760a9695 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -394,7 +394,7 @@ struct xfs_bulkstat {
 	uint32_t	bs_extsize_blks; /* extent size hint, blocks	*/
 
 	uint32_t	bs_nlink;	/* number of links		*/
-	uint32_t	bs_extents;	/* number of extents		*/
+	uint32_t	bs_extents32;	/* number of extents		*/
 	uint32_t	bs_aextents;	/* attribute number of extents	*/
 	uint16_t	bs_version;	/* structure version		*/
 	uint16_t	bs_forkoff;	/* inode fork offset in bytes	*/
@@ -853,7 +853,7 @@ struct xfs_scrub_metadata {
 #define XFS_IOC_FSGEOMETRY_V4	     _IOR ('X', 124, struct xfs_fsop_geom_v4)
 #define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, uint32_t)
 #define XFS_IOC_FSGEOMETRY	     _IOR ('X', 126, struct xfs_fsop_geom)
-#define XFS_IOC_BULKSTAT	     _IOR ('X', 127, struct xfs_bulkstat_req)
+#define XFS_IOC_BULKSTAT_V5	     _IOR ('X', 127, struct xfs_bulkstat_req)
 #define XFS_IOC_INUMBERS	     _IOR ('X', 128, struct xfs_inumbers_req)
 /*	FIEXCHANGE_RANGE ----------- hoisted 129	 */
 /*	XFS_IOC_GETFSUUID ---------- deprecated 140	 */
-- 
2.30.2


  parent reply	other threads:[~2021-07-26 11:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 11:47 [PATCH V2 00/12] xfsprogs: Extend per-inode extent counters Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 01/12] xfsprogs: Move extent count limits to xfs_format.h Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 02/12] xfsprogs: Rename MAXEXTNUM, MAXAEXTNUM to XFS_IFORK_EXTCNT_MAXS32, XFS_IFORK_EXTCNT_MAXS16 Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 03/12] xfsprogs: Introduce xfs_iext_max() helper Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 04/12] xfsprogs: Use xfs_extnum_t instead of basic data types Chandan Babu R
2021-07-27 23:11   ` Darrick J. Wong
2021-07-26 11:47 ` [PATCH V2 05/12] xfsprogs: Introduce xfs_dfork_nextents() helper Chandan Babu R
2021-07-27 23:14   ` Darrick J. Wong
2021-07-28  7:34     ` Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 06/12] xfsprogs: xfs_dfork_nextents: Return extent count via an out argument Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 07/12] xfsprogs: Rename inode's extent counter fields based on their width Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 08/12] xfsprogs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively Chandan Babu R
2021-07-27 23:15   ` Darrick J. Wong
2021-07-26 11:47 ` Chandan Babu R [this message]
2021-07-26 11:47 ` [PATCH V2 10/12] xfsprogs: Enable bulkstat ioctl to support 64-bit extent counters Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 11/12] xfsprogs: Extend per-inode extent counter widths Chandan Babu R
2021-07-28 19:11   ` Darrick J. Wong
2021-07-29  7:26     ` Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 12/12] xfsprogs: Add extcnt64bit mkfs option Chandan Babu R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210726114724.24956-10-chandanrlinux@gmail.com \
    --to=chandanrlinux@gmail.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.