diff options
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 13a50a32652d..afe232b9df6e 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -393,6 +393,26 @@ static const struct file_operations proc_reg_file_ops_no_compat = { }; #endif +static const char *proc_follow_link(struct dentry *dentry, void **cookie) +{ + struct proc_dir_entry *pde = PDE(d_inode(dentry)); + if (unlikely(!use_pde(pde))) + return ERR_PTR(-EINVAL); + *cookie = pde; + return pde->data; +} + +static void proc_put_link(struct inode *unused, void *p) +{ + unuse_pde(p); +} + +const struct inode_operations proc_link_inode_operations = { + .readlink = generic_readlink, + .follow_link = proc_follow_link, + .put_link = proc_put_link, +}; + struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) { struct inode *inode = new_inode_pseudo(sb); |