base.c (d987ca1c6b7e22fbd30664111e85cec7aa66000d) base.c (63f818f46af9f8b3f17b9695501e8d08959feb60)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/proc/base.c
4 *
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 *
7 * proc base directory handling functions
8 *

--- 1825 unchanged lines hidden (view full) ---

1834 *rgid = gid;
1835}
1836
1837void proc_pid_evict_inode(struct proc_inode *ei)
1838{
1839 struct pid *pid = ei->pid;
1840
1841 if (S_ISDIR(ei->vfs_inode.i_mode)) {
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/proc/base.c
4 *
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 *
7 * proc base directory handling functions
8 *

--- 1825 unchanged lines hidden (view full) ---

1834 *rgid = gid;
1835}
1836
1837void proc_pid_evict_inode(struct proc_inode *ei)
1838{
1839 struct pid *pid = ei->pid;
1840
1841 if (S_ISDIR(ei->vfs_inode.i_mode)) {
1842 spin_lock(&pid->wait_pidfd.lock);
1842 spin_lock(&pid->lock);
1843 hlist_del_init_rcu(&ei->sibling_inodes);
1843 hlist_del_init_rcu(&ei->sibling_inodes);
1844 spin_unlock(&pid->wait_pidfd.lock);
1844 spin_unlock(&pid->lock);
1845 }
1846
1847 put_pid(pid);
1848}
1849
1850struct inode *proc_pid_make_inode(struct super_block * sb,
1851 struct task_struct *task, umode_t mode)
1852{

--- 19 unchanged lines hidden (view full) ---

1872 */
1873 pid = get_task_pid(task, PIDTYPE_PID);
1874 if (!pid)
1875 goto out_unlock;
1876
1877 /* Let the pid remember us for quick removal */
1878 ei->pid = pid;
1879 if (S_ISDIR(mode)) {
1845 }
1846
1847 put_pid(pid);
1848}
1849
1850struct inode *proc_pid_make_inode(struct super_block * sb,
1851 struct task_struct *task, umode_t mode)
1852{

--- 19 unchanged lines hidden (view full) ---

1872 */
1873 pid = get_task_pid(task, PIDTYPE_PID);
1874 if (!pid)
1875 goto out_unlock;
1876
1877 /* Let the pid remember us for quick removal */
1878 ei->pid = pid;
1879 if (S_ISDIR(mode)) {
1880 spin_lock(&pid->wait_pidfd.lock);
1880 spin_lock(&pid->lock);
1881 hlist_add_head_rcu(&ei->sibling_inodes, &pid->inodes);
1881 hlist_add_head_rcu(&ei->sibling_inodes, &pid->inodes);
1882 spin_unlock(&pid->wait_pidfd.lock);
1882 spin_unlock(&pid->lock);
1883 }
1884
1885 task_dump_owner(task, 0, &inode->i_uid, &inode->i_gid);
1886 security_task_to_inode(task, inode);
1887
1888out:
1889 return inode;
1890

--- 1377 unchanged lines hidden (view full) ---

3268 *
3269 * NOTE: This routine is just an optimization so it does not guarantee
3270 * that no dcache entries will exist after a process is reaped
3271 * it just makes it very unlikely that any will persist.
3272 */
3273
3274void proc_flush_pid(struct pid *pid)
3275{
1883 }
1884
1885 task_dump_owner(task, 0, &inode->i_uid, &inode->i_gid);
1886 security_task_to_inode(task, inode);
1887
1888out:
1889 return inode;
1890

--- 1377 unchanged lines hidden (view full) ---

3268 *
3269 * NOTE: This routine is just an optimization so it does not guarantee
3270 * that no dcache entries will exist after a process is reaped
3271 * it just makes it very unlikely that any will persist.
3272 */
3273
3274void proc_flush_pid(struct pid *pid)
3275{
3276 proc_invalidate_siblings_dcache(&pid->inodes, &pid->wait_pidfd.lock);
3276 proc_invalidate_siblings_dcache(&pid->inodes, &pid->lock);
3277 put_pid(pid);
3278}
3279
3280static struct dentry *proc_pid_instantiate(struct dentry * dentry,
3281 struct task_struct *task, const void *ptr)
3282{
3283 struct inode *inode;
3284

--- 497 unchanged lines hidden ---
3277 put_pid(pid);
3278}
3279
3280static struct dentry *proc_pid_instantiate(struct dentry * dentry,
3281 struct task_struct *task, const void *ptr)
3282{
3283 struct inode *inode;
3284

--- 497 unchanged lines hidden ---