[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8ec2a734-d23a-83ef-fe06-6b2895a2d392@huawei.com>
Date: Wed, 6 May 2020 12:06:12 +0800
From: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
To: Matthew Wilcox <willy@...radead.org>
CC: Minchan Kim <minchan@...nel.org>, Nitin Gupta <ngupta@...are.org>,
"Sergey Senozhatsky" <sergey.senozhatsky.work@...il.com>,
Jens Axboe <axboe@...nel.dk>,
linux-block <linux-block@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-mm <linux-mm@...ck.org>, Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
dm-devel <dm-devel@...hat.com>, Song Liu <song@...nel.org>,
linux-raid <linux-raid@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] block: Move SECTORS_PER_PAGE and
SECTORS_PER_PAGE_SHIFT definitions into <linux/blkdev.h>
On 2020/5/5 20:10, Matthew Wilcox wrote:
> On Tue, May 05, 2020 at 07:55:40PM +0800, Zhen Lei wrote:
>> +#ifndef SECTORS_PER_PAGE_SHIFT
>> +#define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
>> +#endif
>> +#ifndef SECTORS_PER_PAGE
>> +#define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT)
>> #endif
>
> I find SECTORS_PER_PAGE_SHIFT quite hard to read. I had a quick skim
> of your other patches, and it seems to me that we could replace
> '<< SECTORS_PER_PAGE_SHIFT' with '* SECTORS_PER_PAGE' and it would be
> more readable in every case.
OK, I will delete SECTORS_PER_PAGE_SHIFT, and replace the shift with {*|/} SECTORS_PER_PAGE if it's
not suitable to be replaced by sectors_to_page()/page_to_sectors().
>
> .
>
Powered by blists - more mailing lists