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 <jiangguoqing@kylinos.cn> Link: https://lore.kernel.org/r/20210721025315.1729118-1-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
99d26de2f6
commit
018eca456c
@@ -27,9 +27,6 @@
|
|||||||
|
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
#define PAGE_SECTORS_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
|
|
||||||
#define PAGE_SECTORS (1 << PAGE_SECTORS_SHIFT)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each block ramdisk device has a radix_tree brd_pages of pages that stores
|
* Each block ramdisk device has a radix_tree brd_pages of pages that stores
|
||||||
* the pages containing the block device's contents. A brd page's ->index is
|
* the pages containing the block device's contents. A brd page's ->index is
|
||||||
|
|||||||
@@ -11,10 +11,6 @@
|
|||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include "null_blk.h"
|
#include "null_blk.h"
|
||||||
|
|
||||||
#define PAGE_SECTORS_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
|
|
||||||
#define PAGE_SECTORS (1 << PAGE_SECTORS_SHIFT)
|
|
||||||
#define SECTOR_MASK (PAGE_SECTORS - 1)
|
|
||||||
|
|
||||||
#define FREE_BATCH 16
|
#define FREE_BATCH 16
|
||||||
|
|
||||||
#define TICKS_PER_SEC 50ULL
|
#define TICKS_PER_SEC 50ULL
|
||||||
|
|||||||
@@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
#include "closure.h"
|
#include "closure.h"
|
||||||
|
|
||||||
#define PAGE_SECTORS (PAGE_SIZE / 512)
|
|
||||||
|
|
||||||
struct closure;
|
struct closure;
|
||||||
|
|
||||||
#ifdef CONFIG_BCACHE_DEBUG
|
#ifdef CONFIG_BCACHE_DEBUG
|
||||||
|
|||||||
@@ -939,6 +939,10 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
|
|||||||
#define SECTOR_SIZE (1 << SECTOR_SHIFT)
|
#define SECTOR_SIZE (1 << SECTOR_SHIFT)
|
||||||
#endif
|
#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_pos() : the current sector
|
||||||
* blk_rq_bytes() : bytes left in the entire request
|
* blk_rq_bytes() : bytes left in the entire request
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ typedef size_t (*dm_dax_copy_iter_fn)(struct dm_target *ti, pgoff_t pgoff,
|
|||||||
void *addr, size_t bytes, struct iov_iter *i);
|
void *addr, size_t bytes, struct iov_iter *i);
|
||||||
typedef int (*dm_dax_zero_page_range_fn)(struct dm_target *ti, pgoff_t pgoff,
|
typedef int (*dm_dax_zero_page_range_fn)(struct dm_target *ti, pgoff_t pgoff,
|
||||||
size_t nr_pages);
|
size_t nr_pages);
|
||||||
#define PAGE_SECTORS (PAGE_SIZE / 512)
|
|
||||||
|
|
||||||
void dm_error(const char *message);
|
void dm_error(const char *message);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user