Skip to content

Commit

Permalink
teach page_get_link() to work in RCU mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Dec 9, 2015
1 parent 6b25539 commit d3883d4
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d3883d4

Please sign in to comment.