Re: [PATCH 1/4] block: Move SECTORS_PER_PAGE and SECTORS_PER_PAGE_SHIFT definitions into

2020-05-05 Thread Leizhen (ThunderTown)
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 <<

Re: [PATCH 1/4] block: Move SECTORS_PER_PAGE and SECTORS_PER_PAGE_SHIFT definitions into

2020-05-05 Thread Matthew Wilcox
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

[PATCH 1/4] block: Move SECTORS_PER_PAGE and SECTORS_PER_PAGE_SHIFT definitions into

2020-05-05 Thread Zhen Lei
This is similar to commit 233bde21a ("block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into "), prepare to clear dozens of duplicated codes. Signed-off-by: Zhen Lei --- drivers/block/zram/zram_drv.h | 2 -- include/linux/blkdev.h| 10 -- 2 files changed, 8 insertions(+), 4