[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190719121336.GB28960@lst.de>
Date: Fri, 19 Jul 2019 14:13:37 +0200
From: Christoph Hellwig <hch@....de>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Jani Nikula <jani.nikula@...el.com>,
Randy Dunlap <rdunlap@...radead.org>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
Hannes Reinecke <hare@...e.com>,
Omar Sandoval <osandov@...com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH] [v2] blkdev: always export SECTOR_SHIFT
> +/*
> + * The basic unit of block I/O is a sector. It is used in a number of contexts
> + * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9
> + * bytes. Variables of type sector_t represent an offset or size that is a
> + * multiple of 512 bytes. Hence these two constants.
> + */
> +#ifndef SECTOR_SHIFT
> +#define SECTOR_SHIFT 9
> +#endif
> +#ifndef SECTOR_SIZE
> +#define SECTOR_SIZE (1 << SECTOR_SHIFT)
> +#endif
While we're at it we really should drop the ifndefs.
Otherwise looks good.
In fact given that sector_t is in linux/types.h I wonder if these
should just move there.
Powered by blists - more mailing lists