]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ceph: use calc_pages_for() in start_read()
authorAlex Elder <elder@inktank.com>
Sat, 2 Mar 2013 00:00:15 +0000 (18:00 -0600)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:16:21 +0000 (21:16 -0700)
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 <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
fs/ceph/addr.c

index 2a571fb4803b8e296f10ad2e21eaf3124769b742..e53f24b15b12dc0c1be74a90b84bedf26c65440d 100644 (file)
@@ -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;
        if (!pages)