diff options
author | Cai Huoqing <caihuoqing@baidu.com> | 2022-04-06 21:07:12 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 03:54:24 +0200 |
commit | ba6bee98d0c539a1e78fe62949fe16032e8f68fb (patch) | |
tree | 6b8f1a33a297b8ca50710bb7db58bab30724e1a2 /drivers/block/drbd/drbd_receiver.c | |
parent | block: drbd: drbd_receiver: Remove redundant assignment to err (diff) | |
download | linux-ba6bee98d0c539a1e78fe62949fe16032e8f68fb.tar.xz linux-ba6bee98d0c539a1e78fe62949fe16032e8f68fb.zip |
drbd: Make use of PFN_UP helper macro
it's a refactor to make use of PFN_UP helper macro
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20220406190715.1938174-5-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index ef812ea3b4c5..c66864324f25 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -364,7 +364,7 @@ drbd_alloc_peer_req(struct drbd_peer_device *peer_device, u64 id, sector_t secto struct drbd_device *device = peer_device->device; struct drbd_peer_request *peer_req; struct page *page = NULL; - unsigned nr_pages = (payload_size + PAGE_SIZE -1) >> PAGE_SHIFT; + unsigned nr_pages = PFN_UP(payload_size); if (drbd_insert_fault(device, DRBD_FAULT_AL_EE)) return NULL; @@ -1630,7 +1630,7 @@ int drbd_submit_peer_request(struct drbd_device *device, sector_t sector = peer_req->i.sector; unsigned data_size = peer_req->i.size; unsigned n_bios = 0; - unsigned nr_pages = (data_size + PAGE_SIZE -1) >> PAGE_SHIFT; + unsigned nr_pages = PFN_UP(data_size); /* TRIM/DISCARD: for now, always use the helper function * blkdev_issue_zeroout(..., discard=true). |