Skip to content

Commit 0afa5ca

Browse files
committed
proc: Rename in proc_inode rename sysctl_inodes sibling_inodes
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 <[email protected]>
1 parent 11a48a5 commit 0afa5ca

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

fs/proc/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
6868
ei->pde = NULL;
6969
ei->sysctl = NULL;
7070
ei->sysctl_entry = NULL;
71+
INIT_HLIST_NODE(&ei->sibling_inodes);
7172
ei->ns_ops = NULL;
7273
return &ei->vfs_inode;
7374
}

fs/proc/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct proc_inode {
9191
struct proc_dir_entry *pde;
9292
struct ctl_table_header *sysctl;
9393
struct ctl_table *sysctl_entry;
94-
struct hlist_node sysctl_inodes;
94+
struct hlist_node sibling_inodes;
9595
const struct proc_ns_operations *ns_ops;
9696
struct inode vfs_inode;
9797
} __randomize_layout;

fs/proc/proc_sysctl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ static void proc_sys_prune_dcache(struct ctl_table_header *head)
279279
node = hlist_first_rcu(&head->inodes);
280280
if (!node)
281281
break;
282-
ei = hlist_entry(node, struct proc_inode, sysctl_inodes);
282+
ei = hlist_entry(node, struct proc_inode, sibling_inodes);
283283
spin_lock(&sysctl_lock);
284-
hlist_del_init_rcu(&ei->sysctl_inodes);
284+
hlist_del_init_rcu(&ei->sibling_inodes);
285285
spin_unlock(&sysctl_lock);
286286

287287
inode = &ei->vfs_inode;
@@ -483,7 +483,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
483483
}
484484
ei->sysctl = head;
485485
ei->sysctl_entry = table;
486-
hlist_add_head_rcu(&ei->sysctl_inodes, &head->inodes);
486+
hlist_add_head_rcu(&ei->sibling_inodes, &head->inodes);
487487
head->count++;
488488
spin_unlock(&sysctl_lock);
489489

@@ -514,7 +514,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
514514
void proc_sys_evict_inode(struct inode *inode, struct ctl_table_header *head)
515515
{
516516
spin_lock(&sysctl_lock);
517-
hlist_del_init_rcu(&PROC_I(inode)->sysctl_inodes);
517+
hlist_del_init_rcu(&PROC_I(inode)->sibling_inodes);
518518
if (!--head->count)
519519
kfree_rcu(head, rcu);
520520
spin_unlock(&sysctl_lock);

0 commit comments

Comments
 (0)