drbd: DIV_ROUND_UP not needed here
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 13 Sep 2010 11:27:10 +0000 (13:27 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 14 Oct 2010 16:38:39 +0000 (18:38 +0200)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_worker.c

index daa672fc46e9baa137af97ece73c8f46938d5e30..83ba63ab23580fd24488612f482b979b048f8afa 100644 (file)
@@ -915,7 +915,7 @@ static void move_to_net_ee_or_free(struct drbd_conf *mdev, struct drbd_epoch_ent
 {
        if (drbd_ee_has_active_page(e)) {
                /* This might happen if sendpage() has not finished */
-               int i = DIV_ROUND_UP(e->size, PAGE_SIZE);
+               int i = (e->size + PAGE_SIZE -1) >> PAGE_SHIFT;
                atomic_add(i, &mdev->pp_in_use_by_net);
                atomic_sub(i, &mdev->pp_in_use);
                spin_lock_irq(&mdev->req_lock);