aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-11-17 10:41:04 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-08 22:41:54 -0500
commitd3883d4f93449343be6296e2274360db39b6842a (patch)
tree0d98e047483082320ca32133d5517157a4800d64 /fs/namei.c
parent6b2553918d8b4e6de9853fd6315bec7271a2e592 (diff)
teach page_get_link() to work in RCU mode
more or less along the lines of Neil's patchset, sans the insanity around kmap(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 1da3064311e2..8f517888c3e1 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4533,12 +4533,19 @@ const char *page_get_link(struct dentry *dentry, struct inode *inode,
4533 struct page *page; 4533 struct page *page;
4534 struct address_space *mapping = inode->i_mapping; 4534 struct address_space *mapping = inode->i_mapping;
4535 4535
4536 if (!dentry) 4536 if (!dentry) {
4537 return ERR_PTR(-ECHILD); 4537 page = find_get_page(mapping, 0);
4538 4538 if (!page)
4539 page = read_mapping_page(mapping, 0, NULL); 4539 return ERR_PTR(-ECHILD);
4540 if (IS_ERR(page)) 4540 if (!PageUptodate(page)) {
4541 return (char*)page; 4541 put_page(page);
4542 return ERR_PTR(-ECHILD);
4543 }
4544 } else {
4545 page = read_mapping_page(mapping, 0, NULL);
4546 if (IS_ERR(page))
4547 return (char*)page;
4548 }
4542 *cookie = page; 4549 *cookie = page;
4543 BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM); 4550 BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM);
4544 kaddr = page_address(page); 4551 kaddr = page_address(page);