]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
proc: Rename in proc_inode rename sysctl_inodes sibling_inodes
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 19 Feb 2020 23:17:34 +0000 (17:17 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 20 Feb 2020 14:14:32 +0000 (08:14 -0600)
I about to need and use the same functionality for pid based
inodes and there is no point in adding a second field when
this field is already here and serving the same purporse.

Just give the field a generic name so it is clear that
it is no longer sysctl specific.

Also for good measure initialize sibling_inodes when
proc_inode is initialized.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
fs/proc/inode.c
fs/proc/internal.h
fs/proc/proc_sysctl.c

index 6da18316d2093976a4f11acd4e930b8531f771e5..bdae442d526277530eaafb00baf552b06ac47d63 100644 (file)
@@ -68,6 +68,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
        ei->pde = NULL;
        ei->sysctl = NULL;
        ei->sysctl_entry = NULL;
+       INIT_HLIST_NODE(&ei->sibling_inodes);
        ei->ns_ops = NULL;
        return &ei->vfs_inode;
 }
index 41587276798e2cee0be7f10e339ce84976366c93..366cd3aa690b73fdceaa361d4999e632f13805e0 100644 (file)
@@ -91,7 +91,7 @@ struct proc_inode {
        struct proc_dir_entry *pde;
        struct ctl_table_header *sysctl;
        struct ctl_table *sysctl_entry;
-       struct hlist_node sysctl_inodes;
+       struct hlist_node sibling_inodes;
        const struct proc_ns_operations *ns_ops;
        struct inode vfs_inode;
 } __randomize_layout;
index c75bb4632ed191c5f68198db556111581d9effff..42fbb7f3c5871a74c846bdcdf296885ae51d1b03 100644 (file)
@@ -279,9 +279,9 @@ static void proc_sys_prune_dcache(struct ctl_table_header *head)
                node = hlist_first_rcu(&head->inodes);
                if (!node)
                        break;
-               ei = hlist_entry(node, struct proc_inode, sysctl_inodes);
+               ei = hlist_entry(node, struct proc_inode, sibling_inodes);
                spin_lock(&sysctl_lock);
-               hlist_del_init_rcu(&ei->sysctl_inodes);
+               hlist_del_init_rcu(&ei->sibling_inodes);
                spin_unlock(&sysctl_lock);
 
                inode = &ei->vfs_inode;
@@ -483,7 +483,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
        }
        ei->sysctl = head;
        ei->sysctl_entry = table;
-       hlist_add_head_rcu(&ei->sysctl_inodes, &head->inodes);
+       hlist_add_head_rcu(&ei->sibling_inodes, &head->inodes);
        head->count++;
        spin_unlock(&sysctl_lock);
 
@@ -514,7 +514,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
 void proc_sys_evict_inode(struct inode *inode, struct ctl_table_header *head)
 {
        spin_lock(&sysctl_lock);
-       hlist_del_init_rcu(&PROC_I(inode)->sysctl_inodes);
+       hlist_del_init_rcu(&PROC_I(inode)->sibling_inodes);
        if (!--head->count)
                kfree_rcu(head, rcu);
        spin_unlock(&sysctl_lock);