From: Chandan Babu R <chandanrlinux@gmail.com>
To: linux-xfs@vger.kernel.org
Cc: Chandan Babu R <chandanrlinux@gmail.com>, sandeen@sandeen.net
Subject: [PATCH V1.1] xfsprogs: xfs_fsr: Limit the scope of cmp()
Date: Tue, 26 Jan 2021 10:12:22 +0530 [thread overview]
Message-ID: <20210126044222.2676922-1-chandanrlinux@gmail.com> (raw)
In-Reply-To: <eec86b5f-7a4c-c6e6-e8a0-1e4e9a7e042e@sandeen.net>
cmp() function is being referred to from within fsr/xfs_fsr.c. Hence
this commit limits its scope to the current file.
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
fsr/xfs_fsr.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 635e4c70..b885395e 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -81,7 +81,6 @@ char * gettmpname(char *fname);
char * getparent(char *fname);
int fsrprintf(const char *fmt, ...);
int read_fd_bmap(int, struct xfs_bstat *, int *);
-int cmp(const void *, const void *);
static void tmp_init(char *mnt);
static char * tmp_next(char *mnt);
static void tmp_close(char *mnt);
@@ -577,6 +576,16 @@ fsrall_cleanup(int timeout)
}
}
+/*
+ * To compare bstat structs for qsort.
+ */
+static int
+cmp(const void *s1, const void *s2)
+{
+ return( ((struct xfs_bulkstat *)s2)->bs_extents -
+ ((struct xfs_bulkstat *)s1)->bs_extents);
+}
+
/*
* fsrfs -- reorganize a file system
*/
@@ -696,16 +705,6 @@ out0:
return 0;
}
-/*
- * To compare bstat structs for qsort.
- */
-int
-cmp(const void *s1, const void *s2)
-{
- return( ((struct xfs_bulkstat *)s2)->bs_extents -
- ((struct xfs_bulkstat *)s1)->bs_extents);
-}
-
/*
* reorganize by directory hierarchy.
* Stay in dev (a restriction based on structure of this program -- either
--
2.29.2
next prev parent reply other threads:[~2021-01-26 23:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 9:58 [PATCH 1/2] xfsprogs: xfs_fsr: Interpret arguments of qsort's compare function correctly Chandan Babu R
2021-01-25 9:58 ` [PATCH 2/2] xfsprogs: xfs_fsr: Limit the scope of cmp() Chandan Babu R
2021-01-25 14:19 ` Eric Sandeen
2021-01-26 4:42 ` Chandan Babu R [this message]
2021-02-02 20:21 ` [PATCH V1.1] " Eric Sandeen
2021-01-25 14:17 ` [PATCH 1/2] xfsprogs: xfs_fsr: Interpret arguments of qsort's compare function correctly Eric Sandeen
2021-01-26 5:14 ` Chandan Babu R
2021-01-26 17:58 ` Darrick J. Wong
2021-01-26 18:12 ` 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=20210126044222.2676922-1-chandanrlinux@gmail.com \
--to=chandanrlinux@gmail.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox