diff options
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r-- | fs/proc/generic.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index b7f268eb5f45..737e15615b04 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -49,7 +49,8 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) setattr_copy(inode, iattr); mark_inode_dirty(inode); - proc_set_user(de, inode->i_uid, inode->i_gid); + de->uid = inode->i_uid; + de->gid = inode->i_gid; de->mode = inode->i_mode; return 0; } @@ -174,6 +175,22 @@ static const struct inode_operations proc_link_inode_operations = { }; /* + * As some entries in /proc are volatile, we want to + * get rid of unused dentries. This could be made + * smarter: we could keep a "volatile" flag in the + * inode to indicate which ones to keep. + */ +static int proc_delete_dentry(const struct dentry * dentry) +{ + return 1; +} + +static const struct dentry_operations proc_dentry_operations = +{ + .d_delete = proc_delete_dentry, +}; + +/* * Don't create negative dentries here, return -ENOENT by hand * instead. */ @@ -192,7 +209,7 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir, inode = proc_get_inode(dir->i_sb, de); if (!inode) return ERR_PTR(-ENOMEM); - d_set_d_op(dentry, &simple_dentry_operations); + d_set_d_op(dentry, &proc_dentry_operations); d_add(dentry, inode); return NULL; } |