aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2015-11-06 19:28:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-06 20:50:42 -0500
commitc62d25556be6c965dc14288e796a576e8e39a7e9 (patch)
treed82b41091f4dd8d378e2e2c841c90093da1485e0 /fs/ceph
parent89903327607232de32f05100cf03f9390b858e0b (diff)
mm, fs: introduce mapping_gfp_constraint()
There are many places which use mapping_gfp_mask to restrict a more generic gfp mask which would be used for allocations which are not directly related to the page cache but they are performed in the same context. Let's introduce a helper function which makes the restriction explicit and easier to track. This patch doesn't introduce any functional changes. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Michal Hocko <mhocko@suse.com> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/addr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 9d23e788d1df..b7d218a168fb 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1283,8 +1283,8 @@ static int ceph_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1283 int ret1; 1283 int ret1;
1284 struct address_space *mapping = inode->i_mapping; 1284 struct address_space *mapping = inode->i_mapping;
1285 struct page *page = find_or_create_page(mapping, 0, 1285 struct page *page = find_or_create_page(mapping, 0,
1286 mapping_gfp_mask(mapping) & 1286 mapping_gfp_constraint(mapping,
1287 ~__GFP_FS); 1287 ~__GFP_FS));
1288 if (!page) { 1288 if (!page) {
1289 ret = VM_FAULT_OOM; 1289 ret = VM_FAULT_OOM;
1290 goto out; 1290 goto out;
@@ -1428,7 +1428,8 @@ void ceph_fill_inline_data(struct inode *inode, struct page *locked_page,
1428 if (i_size_read(inode) == 0) 1428 if (i_size_read(inode) == 0)
1429 return; 1429 return;
1430 page = find_or_create_page(mapping, 0, 1430 page = find_or_create_page(mapping, 0,
1431 mapping_gfp_mask(mapping) & ~__GFP_FS); 1431 mapping_gfp_constraint(mapping,
1432 ~__GFP_FS));
1432 if (!page) 1433 if (!page)
1433 return; 1434 return;
1434 if (PageUptodate(page)) { 1435 if (PageUptodate(page)) {