Re: [PATCH 2/2] xfsprogs: xfs_fsr: Limit the scope of cmp()
From: Eric Sandeen <hidden>
Date: 2021-01-26 05:18:22
On 1/25/21 3:58 AM, Chandan Babu R wrote:
cmp() function is being referred to by only from within fsr/xfs_fsr.c. Hence this commit limits its scope to the current file. Signed-off-by: Chandan Babu R <redacted>
Might be nice to move cmp just ahead of fsrfs() so we don't need the forward declaration but *shrug* Reviewed-by: Eric Sandeen <redacted>
quoted hunk ↗ jump to hunk
--- fsr/xfs_fsr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 635e4c70..2d070320 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c@@ -81,7 +81,7 @@ 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 int cmp(const void *, const void *); static void tmp_init(char *mnt); static char * tmp_next(char *mnt); static void tmp_close(char *mnt);@@ -699,7 +699,7 @@ out0: /* * To compare bstat structs for qsort. */ -int +static int cmp(const void *s1, const void *s2) { return( ((struct xfs_bulkstat *)s2)->bs_extents -