Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755530AbbK0VaV (ORCPT ); Fri, 27 Nov 2015 16:30:21 -0500 Received: from mailrelay119.isp.belgacom.be ([195.238.20.146]:2817 "EHLO mailrelay119.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755513AbbK0VaF (ORCPT ); Fri, 27 Nov 2015 16:30:05 -0500 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BqBgC5ylhW/6YUtFtegmlSgUK8BYIogWSGDwKBPjsSAQEBAQEBAYEKhDUBAQQnLyMQUTkeGYgyAbJwig4BLIZUiiWEEgWWV404jzGNMCgDOIIRHYFXPTSFUgEBAQ From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Philipp Reisner , Fabian Frederick , Lars Ellenberg , drbd-dev@lists.linbit.com Subject: [PATCH 19/21] drbd: remove bm_vk_free() Date: Fri, 27 Nov 2015 22:29:34 +0100 Message-Id: <1448659775-13596-10-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448659775-13596-1-git-send-email-fabf@skynet.be> References: <1448659575-13485-1-git-send-email-fabf@skynet.be> <1448659775-13596-1-git-send-email-fabf@skynet.be> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2247 Lines: 69 Commit 51fa48018a12 ("tree wide: use kvfree() than conditional kfree()/vfree()") simplified bm_vk_free() to one single call. Signed-off-by: Fabian Frederick --- drivers/block/drbd/drbd_bitmap.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 17e5e60..36c180f 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -364,11 +364,6 @@ static void bm_free_pages(struct page **pages, unsigned long number) } } -static inline void bm_vk_free(void *ptr) -{ - kvfree(ptr); -} - /* * "have" and "want" are NUMBER OF PAGES. */ @@ -407,7 +402,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want) page = alloc_page(GFP_NOIO | __GFP_HIGHMEM); if (!page) { bm_free_pages(new_pages + have, i - have); - bm_vk_free(new_pages); + kvfree(new_pages); return NULL; } /* we want to know which page it is @@ -459,7 +454,7 @@ void drbd_bm_cleanup(struct drbd_device *device) if (!expect(device->bitmap)) return; bm_free_pages(device->bitmap->bm_pages, device->bitmap->bm_number_of_pages); - bm_vk_free(device->bitmap->bm_pages); + kvfree(device->bitmap->bm_pages); kfree(device->bitmap); device->bitmap = NULL; } @@ -659,7 +654,7 @@ int drbd_bm_resize(struct drbd_device *device, sector_t capacity, int set_new_bi b->bm_dev_capacity = 0; spin_unlock_irq(&b->bm_lock); bm_free_pages(opages, onpages); - bm_vk_free(opages); + kvfree(opages); goto out; } bits = BM_SECT_TO_BIT(ALIGN(capacity, BM_SECT_PER_BIT)); @@ -732,7 +727,7 @@ int drbd_bm_resize(struct drbd_device *device, sector_t capacity, int set_new_bi spin_unlock_irq(&b->bm_lock); if (opages != npages) - bm_vk_free(opages); + kvfree(opages); if (!growing) b->bm_set = bm_count_bits(b); drbd_info(device, "resync bitmap: bits=%lu words=%lu pages=%lu\n", bits, words, want); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/