switch ->get_link() to delayed_call, kill ->put_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/mm/shmem.c b/mm/shmem.c
index 0605716..bab9041 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2496,8 +2496,15 @@
return 0;
}
+static void shmem_put_link(void *arg)
+{
+ mark_page_accessed(arg);
+ put_page(arg);
+}
+
static const char *shmem_get_link(struct dentry *dentry,
- struct inode *inode, void **cookie)
+ struct inode *inode,
+ struct delayed_call *done)
{
struct page *page = NULL;
int error;
@@ -2515,17 +2522,10 @@
return ERR_PTR(error);
unlock_page(page);
}
- *cookie = page;
+ set_delayed_call(done, shmem_put_link, page);
return page_address(page);
}
-static void shmem_put_link(struct inode *unused, void *cookie)
-{
- struct page *page = cookie;
- mark_page_accessed(page);
- page_cache_release(page);
-}
-
#ifdef CONFIG_TMPFS_XATTR
/*
* Superblocks without xattr inode operations may get some security.* xattr
@@ -2680,7 +2680,6 @@
static const struct inode_operations shmem_symlink_inode_operations = {
.readlink = generic_readlink,
.get_link = shmem_get_link,
- .put_link = shmem_put_link,
#ifdef CONFIG_TMPFS_XATTR
.setxattr = shmem_setxattr,
.getxattr = shmem_getxattr,