Message ID | 1603100845-12205-1-git-send-email-kaixuxia@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xfs: remove the unused BBMASK macro | expand |
On 10/19/20 4:47 AM, xiakaixu1987@gmail.com wrote: > From: Kaixu Xia <kaixuxia@tencent.com> > > There are no callers of the BBMASK macro, so remove it. > > Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> > --- > fs/xfs/libxfs/xfs_fs.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h > index 2a2e3cfd94f0..8fd1e20f0d73 100644 > --- a/fs/xfs/libxfs/xfs_fs.h > +++ b/fs/xfs/libxfs/xfs_fs.h > @@ -847,7 +847,6 @@ struct xfs_scrub_metadata { > */ > #define BBSHIFT 9 > #define BBSIZE (1<<BBSHIFT) > -#define BBMASK (BBSIZE-1) > #define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT) > #define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT) > #define BBTOB(bbs) ((bbs) << BBSHIFT) This header is shared with userspace, and the macro is used there, though only once. This header is also shipped as part of the "install-dev" fileset, and defines a public API, though I don't think BBMSK is actually used in any userspace interface. -Eric
On Mon, Oct 19, 2020 at 08:54:28AM -0500, Eric Sandeen wrote: > On 10/19/20 4:47 AM, xiakaixu1987@gmail.com wrote: > > From: Kaixu Xia <kaixuxia@tencent.com> > > > > There are no callers of the BBMASK macro, so remove it. > > > > Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> > > --- > > fs/xfs/libxfs/xfs_fs.h | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h > > index 2a2e3cfd94f0..8fd1e20f0d73 100644 > > --- a/fs/xfs/libxfs/xfs_fs.h > > +++ b/fs/xfs/libxfs/xfs_fs.h > > @@ -847,7 +847,6 @@ struct xfs_scrub_metadata { > > */ > > #define BBSHIFT 9 > > #define BBSIZE (1<<BBSHIFT) > > -#define BBMASK (BBSIZE-1) > > #define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT) > > #define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT) > > #define BBTOB(bbs) ((bbs) << BBSHIFT) > > > This header is shared with userspace, and the macro is used there, > though only once. > > This header is also shipped as part of the "install-dev" fileset, and > defines a public API, though I don't think BBMSK is actually used > in any userspace interface. $ grep BBMASK /usr/include/ /usr/include/xfs/xfs_fs.h:868:#define BBMASK (BBSIZE-1) This ships in a user-visible header file, so it can only be removed by going through the deprecation process. --D > > -Eric
On 2020/10/19 21:54, Eric Sandeen wrote: > On 10/19/20 4:47 AM, xiakaixu1987@gmail.com wrote: >> From: Kaixu Xia <kaixuxia@tencent.com> >> >> There are no callers of the BBMASK macro, so remove it. >> >> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> >> --- >> fs/xfs/libxfs/xfs_fs.h | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h >> index 2a2e3cfd94f0..8fd1e20f0d73 100644 >> --- a/fs/xfs/libxfs/xfs_fs.h >> +++ b/fs/xfs/libxfs/xfs_fs.h >> @@ -847,7 +847,6 @@ struct xfs_scrub_metadata { >> */ >> #define BBSHIFT 9 >> #define BBSIZE (1<<BBSHIFT) >> -#define BBMASK (BBSIZE-1) >> #define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT) >> #define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT) >> #define BBTOB(bbs) ((bbs) << BBSHIFT) > > > This header is shared with userspace, and the macro is used there, > though only once. > > This header is also shipped as part of the "install-dev" fileset, and > defines a public API, though I don't think BBMSK is actually used > in any userspace interface. Right...I didn't consider this situation, will drop this patch. Thanks, Kaixu > > -Eric >
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
On Mon, Oct 19, 2020 at 09:08:02AM -0700, Darrick J. Wong wrote: > $ grep BBMASK /usr/include/ > /usr/include/xfs/xfs_fs.h:868:#define BBMASK (BBSIZE-1) > > This ships in a user-visible header file, so it can only be removed by > going through the deprecation process. I don't think we had such a strong process before. Not that I'm going to complain much.
diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 2a2e3cfd94f0..8fd1e20f0d73 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -847,7 +847,6 @@ struct xfs_scrub_metadata { */ #define BBSHIFT 9 #define BBSIZE (1<<BBSHIFT) -#define BBMASK (BBSIZE-1) #define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT) #define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT) #define BBTOB(bbs) ((bbs) << BBSHIFT)