2 * fs/sysfs/sysfs.h - sysfs internal header file
4 * Copyright (c) 2001-3 Patrick Mochel
5 * Copyright (c) 2007 SUSE Linux Products GmbH
6 * Copyright (c) 2007 Tejun Heo <teheo@suse.de>
8 * This file is released under the GPLv2.
11 #ifndef __SYSFS_INTERNAL_H
12 #define __SYSFS_INTERNAL_H
14 #include "../kernfs/kernfs-internal.h"
15 #include <linux/sysfs.h>
21 struct sysfs_super_info {
23 * Each sb is associated with one namespace tag, currently the network
24 * namespace of the task which mounted this sysfs instance. If multiple
25 * tags become necessary, make the following an array and compare
26 * sysfs_dirent tag against every entry.
30 #define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
31 extern struct sysfs_dirent *sysfs_root_sd;
32 extern struct kmem_cache *sysfs_dir_cachep;
37 extern spinlock_t sysfs_symlink_target_lock;
39 void sysfs_warn_dup(struct sysfs_dirent *parent, const char *name);
44 int sysfs_add_file(struct sysfs_dirent *dir_sd,
45 const struct attribute *attr, bool is_bin);
46 int sysfs_add_file_mode_ns(struct sysfs_dirent *dir_sd,
47 const struct attribute *attr, bool is_bin,
48 umode_t amode, const void *ns);
53 int sysfs_create_link_sd(struct sysfs_dirent *sd, struct kobject *target,
56 #endif /* __SYSFS_INTERNAL_H */