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.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index 8cb673875715..e8b73d4a08d2 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -17,6 +17,9 @@ struct sysfs_dirent;
17 17
18#ifdef CONFIG_SYSFS 18#ifdef CONFIG_SYSFS
19 19
20struct sysfs_dirent *kernfs_create_dir_ns(struct sysfs_dirent *parent,
21 const char *name, void *priv,
22 const void *ns);
20struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent, 23struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent,
21 const char *name, 24 const char *name,
22 struct sysfs_dirent *target); 25 struct sysfs_dirent *target);
@@ -25,11 +28,17 @@ int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name,
25 const void *ns); 28 const void *ns);
26int kernfs_rename_ns(struct sysfs_dirent *sd, struct sysfs_dirent *new_parent, 29int kernfs_rename_ns(struct sysfs_dirent *sd, struct sysfs_dirent *new_parent,
27 const char *new_name, const void *new_ns); 30 const char *new_name, const void *new_ns);
31void kernfs_enable_ns(struct sysfs_dirent *sd);
28int kernfs_setattr(struct sysfs_dirent *sd, const struct iattr *iattr); 32int kernfs_setattr(struct sysfs_dirent *sd, const struct iattr *iattr);
29 33
30#else /* CONFIG_SYSFS */ 34#else /* CONFIG_SYSFS */
31 35
32static inline struct sysfs_dirent * 36static inline struct sysfs_dirent *
37kernfs_create_dir_ns(struct sysfs_dirent *parent, const char *name, void *priv,
38 const void *ns)
39{ return ERR_PTR(-ENOSYS); }
40
41static inline struct sysfs_dirent *
33kernfs_create_link(struct sysfs_dirent *parent, const char *name, 42kernfs_create_link(struct sysfs_dirent *parent, const char *name,
34 struct sysfs_dirent *target) 43 struct sysfs_dirent *target)
35{ return ERR_PTR(-ENOSYS); } 44{ return ERR_PTR(-ENOSYS); }
@@ -45,12 +54,20 @@ static inline int kernfs_rename_ns(struct sysfs_dirent *sd,
45 const char *new_name, const void *new_ns) 54 const char *new_name, const void *new_ns)
46{ return -ENOSYS; } 55{ return -ENOSYS; }
47 56
57static inline void kernfs_enable_ns(struct sysfs_dirent *sd) { }
58
48static inline int kernfs_setattr(struct sysfs_dirent *sd, 59static inline int kernfs_setattr(struct sysfs_dirent *sd,
49 const struct iattr *iattr) 60 const struct iattr *iattr)
50{ return -ENOSYS; } 61{ return -ENOSYS; }
51 62
52#endif /* CONFIG_SYSFS */ 63#endif /* CONFIG_SYSFS */
53 64
65static inline struct sysfs_dirent *
66kernfs_create_dir(struct sysfs_dirent *parent, const char *name, void *priv)
67{
68 return kernfs_create_dir_ns(parent, name, priv, NULL);
69}
70
54static inline int kernfs_remove_by_name(struct sysfs_dirent *parent, 71static inline int kernfs_remove_by_name(struct sysfs_dirent *parent,
55 const char *name) 72 const char *name)
56{ 73{