From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Tue, 13 Feb 2018 17:54:15 +0900 From: Sergey Senozhatsky To: Bart Van Assche Cc: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , "David S . Miller" , "Martin K . Petersen" , Mike Snitzer , Dan Williams , Minchan Kim , Nitin Gupta , Sergey Senozhatsky Subject: Re: [PATCH] block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into Message-ID: <20180213085415.GB1953@jagdpanzerIV> References: <20180212190535.30057-1-bart.vanassche@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180212190535.30057-1-bart.vanassche@wdc.com> List-ID: On (02/12/18 11:05), Bart Van Assche wrote: [..] > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index ac4740cf74be..cf17626604c2 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1026,14 +1026,25 @@ static inline int blk_rq_cur_bytes(const struct request *rq) > > extern unsigned int blk_rq_err_bytes(const struct request *rq); > > +/* > + * Variables of type sector_t represent an offset or size that is a multiple of > + * 2**9 bytes. Hence these two constants. > + */ > +#ifndef SECTOR_SHIFT > +enum { SECTOR_SHIFT = 9 }; > +#endif > +#ifndef SECTOR_SIZE > +enum { SECTOR_SIZE = 512 }; > +#endif Shouldn't SECTOR_SIZE depend on SECTOR_SHIFT? 1 << SECTOR_SHIFT -ss