summaryrefslogtreecommitdiff
path: root/mm/shmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 0605716aee06..bab9041b1967 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2496,8 +2496,15 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
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 @@ static const char *shmem_get_link(struct dentry *dentry,
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_short_symlink_operations = {
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,