diff mbox series

xfs: remove the unused BBMASK macro

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

Commit Message

Kaixu Xia Oct. 19, 2020, 9:47 a.m. UTC
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(-)

Comments

Eric Sandeen Oct. 19, 2020, 1:54 p.m. UTC | #1
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
Darrick J. Wong Oct. 19, 2020, 4:08 p.m. UTC | #2
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
Kaixu Xia Oct. 20, 2020, 2:59 a.m. UTC | #3
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
>
Christoph Hellwig Oct. 27, 2020, 6:44 p.m. UTC | #4
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig Oct. 27, 2020, 6:46 p.m. UTC | #5
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 mbox series

Patch

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)