hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/proc/internal.h
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* Internal procfs definitions
23 *
34 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
45 * Written by David Howells (dhowells@redhat.com)
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117
128 #include <linux/proc_fs.h>
....@@ -43,7 +39,10 @@
4339 spinlock_t pde_unload_lock;
4440 struct completion *pde_unload_completion;
4541 const struct inode_operations *proc_iops;
46
- const struct file_operations *proc_fops;
42
+ union {
43
+ const struct proc_ops *proc_ops;
44
+ const struct file_operations *proc_dir_ops;
45
+ };
4746 const struct dentry_operations *proc_dops;
4847 union {
4948 const struct seq_operations *seq_ops;
....@@ -62,6 +61,7 @@
6261 struct rb_node subdir_node;
6362 char *name;
6463 umode_t mode;
64
+ u8 flags;
6565 u8 namelen;
6666 char inline_name[];
6767 } __randomize_layout;
....@@ -74,6 +74,11 @@
7474 0)
7575 #define SIZEOF_PDE_INLINE_NAME (SIZEOF_PDE - sizeof(struct proc_dir_entry))
7676
77
+static inline bool pde_is_permanent(const struct proc_dir_entry *pde)
78
+{
79
+ return pde->flags & PROC_ENTRY_PERMANENT;
80
+}
81
+
7782 extern struct kmem_cache *proc_dir_entry_cache;
7883 void pde_free(struct proc_dir_entry *pde);
7984
....@@ -82,6 +87,7 @@
8287 int (*proc_show)(struct seq_file *m,
8388 struct pid_namespace *ns, struct pid *pid,
8489 struct task_struct *task);
90
+ const char *lsm;
8591 };
8692
8793 struct proc_inode {
....@@ -91,7 +97,7 @@
9197 struct proc_dir_entry *pde;
9298 struct ctl_table_header *sysctl;
9399 struct ctl_table *sysctl_entry;
94
- struct hlist_node sysctl_inodes;
100
+ struct hlist_node sibling_inodes;
95101 const struct proc_ns_operations *ns_ops;
96102 struct inode vfs_inode;
97103 } __randomize_layout;
....@@ -158,11 +164,12 @@
158164 extern const struct dentry_operations pid_dentry_operations;
159165 extern int pid_getattr(const struct path *, struct kstat *, u32, unsigned int);
160166 extern int proc_setattr(struct dentry *, struct iattr *);
167
+extern void proc_pid_evict_inode(struct proc_inode *);
161168 extern struct inode *proc_pid_make_inode(struct super_block *, struct task_struct *, umode_t);
162169 extern void pid_update_inode(struct task_struct *, struct inode *);
163170 extern int pid_delete_dentry(const struct dentry *);
164171 extern int proc_pid_readdir(struct file *, struct dir_context *);
165
-extern struct dentry *proc_pid_lookup(struct inode *, struct dentry *, unsigned int);
172
+struct dentry *proc_pid_lookup(struct dentry *, unsigned int);
166173 extern loff_t mem_lseek(struct file *, loff_t, int);
167174
168175 /* Lookups */
....@@ -200,19 +207,19 @@
200207 * inode.c
201208 */
202209 struct pde_opener {
203
- struct file *file;
204210 struct list_head lh;
211
+ struct file *file;
205212 bool closing;
206213 struct completion *c;
207214 } __randomize_layout;
208215 extern const struct inode_operations proc_link_inode_operations;
209
-
210216 extern const struct inode_operations proc_pid_link_inode_operations;
217
+extern const struct super_operations proc_sops;
211218
212219 void proc_init_kmemcache(void);
220
+void proc_invalidate_siblings_dcache(struct hlist_head *inodes, spinlock_t *lock);
213221 void set_proc_pid_nlink(void);
214222 extern struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *);
215
-extern int proc_fill_super(struct super_block *);
216223 extern void proc_entry_rundown(struct proc_dir_entry *);
217224
218225 /*
....@@ -258,15 +265,6 @@
258265 #endif
259266
260267 /*
261
- * uid.c
262
- */
263
-#ifdef CONFIG_PROC_UID
264
-extern int proc_uid_init(void);
265
-#else
266
-static inline void proc_uid_init(void) { }
267
-#endif
268
-
269
-/*
270268 * proc_tty.c
271269 */
272270 #ifdef CONFIG_TTY
....@@ -281,7 +279,6 @@
281279 extern struct proc_dir_entry proc_root;
282280
283281 extern void proc_self_init(void);
284
-extern int proc_remount(struct super_block *, int *, char *);
285282
286283 /*
287284 * task_[no]mmu.c