Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759966Ab3HOAcN (ORCPT ); Wed, 14 Aug 2013 20:32:13 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:50175 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753863Ab3HOAcH (ORCPT ); Wed, 14 Aug 2013 20:32:07 -0400 From: Wanpeng Li To: Andrew Morton Cc: Rik van Riel , Dave Hansen , Fengguang Wu , Joonsoo Kim , Johannes Weiner , Tejun Heo , Yasuaki Ishimatsu , David Rientjes , KOSAKI Motohiro , Jiri Kosina , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 4/4] mm/vmalloc: use wrapper function get_vm_area_size to caculate size of vm area Date: Thu, 15 Aug 2013 08:31:43 +0800 Message-Id: <1376526703-2081-4-git-send-email-liwanp@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1376526703-2081-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1376526703-2081-1-git-send-email-liwanp@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13081500-5140-0000-0000-000003AD2CF3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 951 Lines: 28 Use wrapper function get_vm_area_size to calculate size of vm area. Signed-off-by: Wanpeng Li --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 93d3182..553368c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1553,7 +1553,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, unsigned int nr_pages, array_size, i; gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO; - nr_pages = (area->size - PAGE_SIZE) >> PAGE_SHIFT; + nr_pages = get_vm_area_size(area) >> PAGE_SHIFT; array_size = (nr_pages * sizeof(struct page *)); area->nr_pages = nr_pages; -- 1.8.1.2 -- 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/