From patchwork Mon Mar 4 18:15:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2213741 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AC24BDF2F2 for ; Mon, 4 Mar 2013 18:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758172Ab3CDSPV (ORCPT ); Mon, 4 Mar 2013 13:15:21 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:53696 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757858Ab3CDSPV (ORCPT ); Mon, 4 Mar 2013 13:15:21 -0500 Received: by mail-ie0-f175.google.com with SMTP id c12so6572965ieb.34 for ; Mon, 04 Mar 2013 10:15:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=4ohguEkr3gREd+RIxTvpcZlG6LuSyOgQjF/CPVRfo9Y=; b=GM4lbCJzK52ybOPT1iaWr/Diglja+VPjgTdb3RD6iQmz8/YTr+DpQjfW1O6VvUBsPI JAieSsMHDps4GaQhVELJOELfdd0FpZFzlBb1KYokTZ0GFcUyFkQ4ZowyEmw2Fw8kwOuL L2/1KV5K+hNB/q6pkM49LkCavuzm8hL719LxILrPfNehvUzb6xbDi8e+BakPHN135BOZ D6hA4l86fmbAJUt9nTOE6jJKBQjI3p3bdBQkHoOLR3RJDkWt2BM2h+85CUTdHq0TehGP 1Vh2ftGhgT9QitOodf0mUqSWTO5zWlPQOtoZUG83j1gw3wjkMDrd+/d2CjONFpEI6Zhs MvUg== X-Received: by 10.50.184.132 with SMTP id eu4mr3208623igc.19.1362420920459; Mon, 04 Mar 2013 10:15:20 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id i10sm10395295igz.9.2013.03.04.10.15.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Mar 2013 10:15:19 -0800 (PST) Message-ID: <5134E4B8.5090908@inktank.com> Date: Mon, 04 Mar 2013 12:15:20 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 1/3] ceph: use calc_pages_for() in start_read() References: <5134E25E.4030701@inktank.com> <5134E46C.9020402@inktank.com> In-Reply-To: <5134E46C.9020402@inktank.com> X-Gm-Message-State: ALoCoQnCf8QBfBQQj9GZUTwmNfZJo/H1mIqKZkTBpSGhPN8u0NWKIVv0ixzkOXMTRJBkM2X17r7s Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org There's a spot that computes the number of pages to allocate for a page-aligned length by just shifting it. Use calc_pages_for() instead, to be consistent with usage everywhere else. The result is the same. The reason for this is to make it clearer in an upcoming patch that this calculation is duplicated. Signed-off-by: Alex Elder --- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) if (!pages) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index cfef3e0..a284a1f 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -314,7 +314,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max) return PTR_ERR(req); /* build page vector */ - nr_pages = len >> PAGE_CACHE_SHIFT; + nr_pages = calc_pages_for(0, len); pages = kmalloc(sizeof(*pages) * nr_pages, GFP_NOFS); ret = -ENOMEM;