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_worker.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_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 0f9956f4e9c4..af3051dd8912 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -1030,7 +1030,7 @@ static void move_to_net_ee_or_free(struct drbd_device *device, struct drbd_peer_ { if (drbd_peer_req_has_active_page(peer_req)) { /* This might happen if sendpage() has not finished */ - int i = (peer_req->i.size + PAGE_SIZE -1) >> PAGE_SHIFT; + int i = PFN_UP(peer_req->i.size); atomic_add(i, &device->pp_in_use_by_net); atomic_sub(i, &device->pp_in_use); spin_lock_irq(&device->resource->req_lock); |