aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorAl Viro <[email protected]>2025-02-22 21:04:47 +0000
committerAl Viro <[email protected]>2025-06-11 02:08:05 +0000
commit5943c611c47c9444e834555c867dec744158b7ad (patch)
treeddbda436f0a38eef129bb0bad8ee7d2094578724 /fs/proc/generic.c
parentd_set_mounted(): we don't need to bump seqcount component of rename_lock (diff)
downloadkernel-5943c611c47c9444e834555c867dec744158b7ad.tar.gz
kernel-5943c611c47c9444e834555c867dec744158b7ad.zip
procfs: kill ->proc_dops
It has two possible values - one for "forced lookup" entries, another for the normal ones. We'd be better off with that as an explicit flag anyway and in addition to that it opens some fun possibilities with ->d_op and ->d_flags handling. [moved PROC_ENTRY_FORCE_LOOKUP to include/linux/proc_fs.h, switched it to an unused bit - there was a conflict] Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Al Viro <[email protected]>
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index a3e22803cddf..38ce45ce0eb6 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -254,7 +254,10 @@ struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry,
inode = proc_get_inode(dir->i_sb, de);
if (!inode)
return ERR_PTR(-ENOMEM);
- d_set_d_op(dentry, de->proc_dops);
+ if (de->flags & PROC_ENTRY_FORCE_LOOKUP)
+ d_set_d_op(dentry, &proc_net_dentry_ops);
+ else
+ d_set_d_op(dentry, &proc_misc_dentry_ops);
return d_splice_alias(inode, dentry);
}
read_unlock(&proc_subdir_lock);
@@ -448,9 +451,8 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
INIT_LIST_HEAD(&ent->pde_openers);
proc_set_user(ent, (*parent)->uid, (*parent)->gid);
- ent->proc_dops = &proc_misc_dentry_ops;
/* Revalidate everything under /proc/${pid}/net */
- if ((*parent)->proc_dops == &proc_net_dentry_ops)
+ if ((*parent)->flags & PROC_ENTRY_FORCE_LOOKUP)
pde_force_lookup(ent);
out: