aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernfs.h')
-rw-r--r--include/linux/kernfs.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index b0122dc6f96a..52bf5677db0b 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -50,7 +50,24 @@ enum kernfs_node_flag {
50 50
51/* @flags for kernfs_create_root() */ 51/* @flags for kernfs_create_root() */
52enum kernfs_root_flag { 52enum kernfs_root_flag {
53 KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001, 53 /*
54 * kernfs_nodes are created in the deactivated state and invisible.
55 * They require explicit kernfs_activate() to become visible. This
56 * can be used to make related nodes become visible atomically
57 * after all nodes are created successfully.
58 */
59 KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001,
60
61 /*
62 * For regular flies, if the opener has CAP_DAC_OVERRIDE, open(2)
63 * succeeds regardless of the RW permissions. sysfs had an extra
64 * layer of enforcement where open(2) fails with -EACCES regardless
65 * of CAP_DAC_OVERRIDE if the permission doesn't have the
66 * respective read or write access at all (none of S_IRUGO or
67 * S_IWUGO) or the respective operation isn't implemented. The
68 * following flag enables that behavior.
69 */
70 KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 0x0002,
54}; 71};
55 72
56/* type-specific structures for kernfs_node union members */ 73/* type-specific structures for kernfs_node union members */
@@ -280,8 +297,8 @@ void kernfs_notify(struct kernfs_node *kn);
280 297
281const void *kernfs_super_ns(struct super_block *sb); 298const void *kernfs_super_ns(struct super_block *sb);
282struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, 299struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
283 struct kernfs_root *root, bool *new_sb_created, 300 struct kernfs_root *root, unsigned long magic,
284 const void *ns); 301 bool *new_sb_created, const void *ns);
285void kernfs_kill_sb(struct super_block *sb); 302void kernfs_kill_sb(struct super_block *sb);
286 303
287void kernfs_init(void); 304void kernfs_init(void);
@@ -374,7 +391,8 @@ static inline const void *kernfs_super_ns(struct super_block *sb)
374 391
375static inline struct dentry * 392static inline struct dentry *
376kernfs_mount_ns(struct file_system_type *fs_type, int flags, 393kernfs_mount_ns(struct file_system_type *fs_type, int flags,
377 struct kernfs_root *root, bool *new_sb_created, const void *ns) 394 struct kernfs_root *root, unsigned long magic,
395 bool *new_sb_created, const void *ns)
378{ return ERR_PTR(-ENOSYS); } 396{ return ERR_PTR(-ENOSYS); }
379 397
380static inline void kernfs_kill_sb(struct super_block *sb) { } 398static inline void kernfs_kill_sb(struct super_block *sb) { }
@@ -432,9 +450,11 @@ static inline int kernfs_rename(struct kernfs_node *kn,
432 450
433static inline struct dentry * 451static inline struct dentry *
434kernfs_mount(struct file_system_type *fs_type, int flags, 452kernfs_mount(struct file_system_type *fs_type, int flags,
435 struct kernfs_root *root, bool *new_sb_created) 453 struct kernfs_root *root, unsigned long magic,
454 bool *new_sb_created)
436{ 455{
437 return kernfs_mount_ns(fs_type, flags, root, new_sb_created, NULL); 456 return kernfs_mount_ns(fs_type, flags, root,
457 magic, new_sb_created, NULL);
438} 458}
439 459
440#endif /* __LINUX_KERNFS_H */ 460#endif /* __LINUX_KERNFS_H */