aboutsummaryrefslogtreecommitdiff
path: root/include/linux/kernfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernfs.h')
-rw-r--r--include/linux/kernfs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index 105d09dcb064..fd8f574ef2fe 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -71,6 +71,11 @@ struct kernfs_ops {
#ifdef CONFIG_SYSFS
+struct sysfs_dirent *kernfs_find_and_get_ns(struct sysfs_dirent *parent,
+ const char *name, const void *ns);
+void kernfs_get(struct sysfs_dirent *sd);
+void kernfs_put(struct sysfs_dirent *sd);
+
struct sysfs_dirent *kernfs_create_dir_ns(struct sysfs_dirent *parent,
const char *name, void *priv,
const void *ns);
@@ -95,6 +100,14 @@ void kernfs_notify(struct sysfs_dirent *sd);
#else /* CONFIG_SYSFS */
static inline struct sysfs_dirent *
+kernfs_find_and_get_ns(struct sysfs_dirent *parent, const char *name,
+ const void *ns)
+{ return NULL; }
+
+static inline void kernfs_get(struct sysfs_dirent *sd) { }
+static inline void kernfs_put(struct sysfs_dirent *sd) { }
+
+static inline struct sysfs_dirent *
kernfs_create_dir_ns(struct sysfs_dirent *parent, const char *name, void *priv,
const void *ns)
{ return ERR_PTR(-ENOSYS); }
@@ -133,6 +146,12 @@ static inline void kernfs_notify(struct sysfs_dirent *sd) { }
#endif /* CONFIG_SYSFS */
static inline struct sysfs_dirent *
+kernfs_find_and_get(struct sysfs_dirent *sd, const char *name)
+{
+ return kernfs_find_and_get_ns(sd, name, NULL);
+}
+
+static inline struct sysfs_dirent *
kernfs_create_dir(struct sysfs_dirent *parent, const char *name, void *priv)
{
return kernfs_create_dir_ns(parent, name, priv, NULL);