diff options
author | Alex Elder <elder@inktank.com> | 2013-03-02 01:00:15 +0100 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 06:16:21 +0200 |
commit | cf7b7e1492e97dd0c44479239742eb4cb752eeed (patch) | |
tree | 83ed8068f3b0c1138601a763657aa3a2335fd24e /fs/ceph/addr.c | |
parent | libceph: no need for alignment for mds message (diff) | |
download | linux-cf7b7e1492e97dd0c44479239742eb4cb752eeed.tar.xz linux-cf7b7e1492e97dd0c44479239742eb4cb752eeed.zip |
ceph: use calc_pages_for() in start_read()
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>
Diffstat (limited to '')
-rw-r--r-- | fs/ceph/addr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 2a571fb4803b..e53f24b15b12 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; if (!pages) |