summaryrefslogtreecommitdiff
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorGuoqing Jiang <[email protected]>2021-07-21 10:53:15 +0800
committerJens Axboe <[email protected]>2021-08-11 19:40:28 -0600
commit018eca456c4b4dca56aaf1ec27f309c74d0fe246 (patch)
tree4e5c4eafcb904525cf9a822b8d6221d2d059e412 /include/linux/blkdev.h
parent99d26de2f6d79badc80f55b54bd90d4cb9d1ad90 (diff)
block: move some macros to blkdev.h
Move them (PAGE_SECTORS_SHIFT, PAGE_SECTORS and SECTOR_MASK) to the generic header file to remove redundancy. Signed-off-by: Guoqing Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 07eef02325b4..df404c1fb087 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -939,6 +939,10 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
#define SECTOR_SIZE (1 << SECTOR_SHIFT)
#endif
+#define PAGE_SECTORS_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
+#define PAGE_SECTORS (1 << PAGE_SECTORS_SHIFT)
+#define SECTOR_MASK (PAGE_SECTORS - 1)
+
/*
* blk_rq_pos() : the current sector
* blk_rq_bytes() : bytes left in the entire request