switch ->get_link() to delayed_call, kill ->put_link()
[linux-block.git] / fs / proc / thread_self.c
index 03eaa84604da98889852719d64dd7eb2b34713f5..9eacd59e0360f1367a084a1e7bfa5dca0e3fe170 100644 (file)
@@ -20,7 +20,8 @@ static int proc_thread_self_readlink(struct dentry *dentry, char __user *buffer,
 }
 
 static const char *proc_thread_self_get_link(struct dentry *dentry,
-                                            struct inode *inode, void **cookie)
+                                            struct inode *inode,
+                                            struct delayed_call *done)
 {
        struct pid_namespace *ns = inode->i_sb->s_fs_info;
        pid_t tgid = task_tgid_nr_ns(current, ns);
@@ -34,13 +35,13 @@ static const char *proc_thread_self_get_link(struct dentry *dentry,
        if (unlikely(!name))
                return dentry ? ERR_PTR(-ENOMEM) : ERR_PTR(-ECHILD);
        sprintf(name, "%d/task/%d", tgid, pid);
-       return *cookie = name;
+       set_delayed_call(done, kfree_link, name);
+       return name;
 }
 
 static const struct inode_operations proc_thread_self_inode_operations = {
        .readlink       = proc_thread_self_readlink,
        .get_link       = proc_thread_self_get_link,
-       .put_link       = kfree_put_link,
 };
 
 static unsigned thread_self_inum;