diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-11-17 18:41:04 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-09 06:41:54 +0300 |
commit | d3883d4f93449343be6296e2274360db39b6842a (patch) | |
tree | 0d98e047483082320ca32133d5517157a4800d64 /fs/namei.c | |
parent | 6b2553918d8b4e6de9853fd6315bec7271a2e592 (diff) | |
download | linux-d3883d4f93449343be6296e2274360db39b6842a.tar.xz |
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.c | 19 |
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, struct page *page; struct address_space *mapping = inode->i_mapping; - if (!dentry) - return ERR_PTR(-ECHILD); - - page = read_mapping_page(mapping, 0, NULL); - if (IS_ERR(page)) - return (char*)page; + if (!dentry) { + page = find_get_page(mapping, 0); + if (!page) + return ERR_PTR(-ECHILD); + if (!PageUptodate(page)) { + put_page(page); + return ERR_PTR(-ECHILD); + } + } else { + page = read_mapping_page(mapping, 0, NULL); + if (IS_ERR(page)) + return (char*)page; + } *cookie = page; BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM); kaddr = page_address(page); |