All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Shimmin <tes@sgi.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com,
	kernel-janitors@vger.kernel.org
Subject: Re: [xfs-masters] [PATCH] fs/xfs: remove duplicated defines
Date: Mon, 12 Nov 2007 00:09:13 +0000	[thread overview]
Message-ID: <473799A9.9000200@sgi.com> (raw)
In-Reply-To: <473796EF.6050104@sandeen.net>

Eric Sandeen wrote:
> Nicolas Kaiser wrote:
>> Remove duplicated defines.
>>
>> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
>> ---
> 
> Heh, each defined twice, but used 0 times in the kernel.  Could probably
> just remove them altogether (though I guess btoc is used in
> xfstests/ltp/doio.c in userspace/xfstests, but that's the *only* place)
> 
Yes, that's what I was just noticing - how they are not used anyway.

 > grep -Ir btoc . | egrep -v 'tag|anot'
./linux-2.6/xfs_linux.h:#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoc64(x)       (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoct64(x)      ((__uint64_t)(x)>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
./linux-2.6/xfs_buf.c:  page_count = xfs_buf_btoc(end) - xfs_buf_btoct(bp->b_file_offset);
./linux-2.6/xfs_buf.c:          page = bp->b_pages[xfs_buf_btoct(boff + bp->b_offset)];
./linux-2.6/xfs_buf.h:#define xfs_buf_btoc(dd)  (((dd) + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT)
./linux-2.6/xfs_buf.h:#define xfs_buf_btoct(dd) ((dd) >> PAGE_CACHE_SHIFT)

--Tim

> -Eric
> 
>>  fs/xfs/linux-2.6/xfs_linux.h |    4 ----
>>  1 file changed, 4 deletions(-)
>>
>> --- a/fs/xfs/linux-2.6/xfs_linux.h	2007-11-07 11:26:20.000000000 +0100
>> +++ b/fs/xfs/linux-2.6/xfs_linux.h	2007-11-11 13:07:11.000000000 +0100
>> @@ -167,12 +167,8 @@
>>  
>>  /* clicks to bytes */
>>  #define	ctob(x)		((__psunsigned_t)(x)<<BPCSHIFT)
>> -#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
>>  #define	ctob64(x)	((__uint64_t)(x)<<BPCSHIFT)
>>  
>> -/* bytes to clicks */
>> -#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
>> -
>>  #define ENOATTR		ENODATA		/* Attribute not found */
>>  #define EWRONGFS	EINVAL		/* Mount with wrong filesystem type */
>>  #define EFSCORRUPTED	EUCLEAN		/* Filesystem is corrupted */
>>
>>
> 


WARNING: multiple messages have this Message-ID (diff)
From: Timothy Shimmin <tes@sgi.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com,
	kernel-janitors@vger.kernel.org
Subject: Re: [xfs-masters] [PATCH] fs/xfs: remove duplicated defines
Date: Mon, 12 Nov 2007 11:09:13 +1100	[thread overview]
Message-ID: <473799A9.9000200@sgi.com> (raw)
In-Reply-To: <473796EF.6050104@sandeen.net>

Eric Sandeen wrote:
> Nicolas Kaiser wrote:
>> Remove duplicated defines.
>>
>> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
>> ---
> 
> Heh, each defined twice, but used 0 times in the kernel.  Could probably
> just remove them altogether (though I guess btoc is used in
> xfstests/ltp/doio.c in userspace/xfstests, but that's the *only* place)
> 
Yes, that's what I was just noticing - how they are not used anyway.

 > grep -Ir btoc . | egrep -v 'tag|anot'
./linux-2.6/xfs_linux.h:#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoc64(x)       (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoct64(x)      ((__uint64_t)(x)>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
./linux-2.6/xfs_linux.h:#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
./linux-2.6/xfs_buf.c:  page_count = xfs_buf_btoc(end) - xfs_buf_btoct(bp->b_file_offset);
./linux-2.6/xfs_buf.c:          page = bp->b_pages[xfs_buf_btoct(boff + bp->b_offset)];
./linux-2.6/xfs_buf.h:#define xfs_buf_btoc(dd)  (((dd) + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT)
./linux-2.6/xfs_buf.h:#define xfs_buf_btoct(dd) ((dd) >> PAGE_CACHE_SHIFT)

--Tim

> -Eric
> 
>>  fs/xfs/linux-2.6/xfs_linux.h |    4 ----
>>  1 file changed, 4 deletions(-)
>>
>> --- a/fs/xfs/linux-2.6/xfs_linux.h	2007-11-07 11:26:20.000000000 +0100
>> +++ b/fs/xfs/linux-2.6/xfs_linux.h	2007-11-11 13:07:11.000000000 +0100
>> @@ -167,12 +167,8 @@
>>  
>>  /* clicks to bytes */
>>  #define	ctob(x)		((__psunsigned_t)(x)<<BPCSHIFT)
>> -#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
>>  #define	ctob64(x)	((__uint64_t)(x)<<BPCSHIFT)
>>  
>> -/* bytes to clicks */
>> -#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
>> -
>>  #define ENOATTR		ENODATA		/* Attribute not found */
>>  #define EWRONGFS	EINVAL		/* Mount with wrong filesystem type */
>>  #define EFSCORRUPTED	EUCLEAN		/* Filesystem is corrupted */
>>
>>
> 

  reply	other threads:[~2007-11-12  0:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 12:43 [PATCH] fs/xfs: remove duplicated defines Nicolas Kaiser
2007-11-11 23:57 ` [xfs-masters] " Eric Sandeen
2007-11-11 23:57   ` Eric Sandeen
2007-11-12  0:09   ` Timothy Shimmin [this message]
2007-11-12  0:09     ` Timothy Shimmin
2007-11-12  0:28 ` Timothy Shimmin
2007-11-12  0:33 ` [xfs-masters] " Timothy Shimmin
2007-11-12  2:04 ` David Chinner
2007-11-13  5:35 ` Timothy Shimmin
2007-11-13 21:30 ` David Chinner
2007-11-14  2:46 ` Timothy Shimmin
2007-11-14  5:41 ` David Chinner
2007-11-15  0:54 ` Timothy Shimmin
2007-11-15  6:27 ` David Chinner
2007-11-16  5:34   ` [PATCH] remove BPCSHIFT and NB?P? macros - was fs/xfs: remove duplicated Timothy Shimmin
2007-11-16  6:15     ` [xfs-masters] [PATCH] remove BPCSHIFT and NB?P? macros - was Lachlan McIlroy
2007-11-16  6:15       ` [xfs-masters] [PATCH] remove BPCSHIFT and NB?P? macros - was fs/xfs: remove duplicated defines Lachlan McIlroy

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=473799A9.9000200@sgi.com \
    --to=tes@sgi.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xfs@oss.sgi.com \
    /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.