switch ->get_link() to delayed_call, kill ->put_link()
[deliverable/linux.git] / mm / shmem.c
index 0605716aee0626d6a782e81be95d14eddf80cf1a..bab9041b19673389b1c0d21346434f24a349a735 100644 (file)
@@ -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,
This page took 0.027691 seconds and 5 git commands to generate.