| Tejun Heo | 6d66f5c | 2007-09-20 17:31:38 +0900 | [diff] [blame] | 1 | /* |
| 2 | * fs/sysfs/sysfs.h - sysfs internal header file |
| 3 | * |
| 4 | * Copyright (c) 2001-3 Patrick Mochel |
| 5 | * Copyright (c) 2007 SUSE Linux Products GmbH |
| 6 | * Copyright (c) 2007 Tejun Heo <teheo@suse.de> |
| 7 | * |
| 8 | * This file is released under the GPLv2. |
| 9 | */ |
| 10 | |
| Tejun Heo | ae6621b | 2013-11-28 14:54:31 -0500 | [diff] [blame] | 11 | #ifndef __SYSFS_INTERNAL_H |
| 12 | #define __SYSFS_INTERNAL_H |
| David P. Quigley | ddd29ec | 2009-09-09 14:25:37 -0400 | [diff] [blame] | 13 | |
| Tejun Heo | ae6621b | 2013-11-28 14:54:31 -0500 | [diff] [blame] | 14 | #include "../kernfs/kernfs-internal.h" |
| 15 | #include <linux/sysfs.h> |
| Tejun Heo | fb6896d | 2007-06-14 04:27:24 +0900 | [diff] [blame] | 16 | |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 17 | /* |
| 18 | * mount.c |
| 19 | */ |
| Serge E. Hallyn | be867b1 | 2010-05-03 16:23:15 -0500 | [diff] [blame] | 20 | |
| Eric W. Biederman | 9e7fdd2 | 2010-03-30 11:31:24 -0700 | [diff] [blame] | 21 | struct sysfs_super_info { |
| Tejun Heo | 51a35e9 | 2013-11-28 14:54:37 -0500 | [diff] [blame] | 22 | /* |
| 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. |
| 27 | */ |
| 28 | const void *ns; |
| Eric W. Biederman | 9e7fdd2 | 2010-03-30 11:31:24 -0700 | [diff] [blame] | 29 | }; |
| 30 | #define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info)) |
| Tejun Heo | 061447a | 2013-11-28 14:54:39 -0500 | [diff] [blame^] | 31 | extern struct sysfs_dirent *sysfs_root_sd; |
| Christoph Lameter | e18b890 | 2006-12-06 20:33:20 -0800 | [diff] [blame] | 32 | extern struct kmem_cache *sysfs_dir_cachep; |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 34 | /* |
| 35 | * dir.c |
| 36 | */ |
| Tejun Heo | 0cae60f | 2013-10-30 10:28:36 -0400 | [diff] [blame] | 37 | extern spinlock_t sysfs_symlink_target_lock; |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 38 | |
| Tejun Heo | d1c1459 | 2013-10-24 11:49:11 -0400 | [diff] [blame] | 39 | void sysfs_warn_dup(struct sysfs_dirent *parent, const char *name); |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 40 | |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 41 | /* |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 42 | * file.c |
| 43 | */ |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 44 | int sysfs_add_file(struct sysfs_dirent *dir_sd, |
| Tejun Heo | a7dc66d | 2013-11-28 14:54:23 -0500 | [diff] [blame] | 45 | const struct attribute *attr, bool is_bin); |
| Tejun Heo | 58292cbe | 2013-09-11 22:29:04 -0400 | [diff] [blame] | 46 | int sysfs_add_file_mode_ns(struct sysfs_dirent *dir_sd, |
| Tejun Heo | a7dc66d | 2013-11-28 14:54:23 -0500 | [diff] [blame] | 47 | const struct attribute *attr, bool is_bin, |
| Tejun Heo | 58292cbe | 2013-09-11 22:29:04 -0400 | [diff] [blame] | 48 | umode_t amode, const void *ns); |
| Tejun Heo | 73d9714 | 2013-10-01 17:42:07 -0400 | [diff] [blame] | 49 | |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 50 | /* |
| Tejun Heo | 59f6901 | 2007-09-20 16:05:10 +0900 | [diff] [blame] | 51 | * symlink.c |
| 52 | */ |
| Rafael J. Wysocki | 0bb8f3d | 2013-01-25 21:51:13 +0100 | [diff] [blame] | 53 | int sysfs_create_link_sd(struct sysfs_dirent *sd, struct kobject *target, |
| 54 | const char *name); |
| Tejun Heo | ae6621b | 2013-11-28 14:54:31 -0500 | [diff] [blame] | 55 | |
| 56 | #endif /* __SYSFS_INTERNAL_H */ |