diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2011-10-12 21:53:38 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-19 19:24:14 -0400 |
commit | 487505c257021fc06a7d05753cf27b011487f1dc (patch) | |
tree | 4fedc207c7e3d21bd394d9187fd1cc9f65768e2c /include/linux/sysfs.h | |
parent | d5edf2906e0a251ddddd76caeb1b79de8bb5e3b8 (diff) | |
download | op-kernel-dev-487505c257021fc06a7d05753cf27b011487f1dc.zip op-kernel-dev-487505c257021fc06a7d05753cf27b011487f1dc.tar.gz |
sysfs: Implement support for tagged files in sysfs.
Looking up files in sysfs is hard to understand and analyize because we
currently allow placing untagged files in tagged directories. In the
implementation of that we have two subtly different meanings of NULL.
NULL meaning there is no tag on a directory entry and NULL meaning
we don't care which namespace the lookup is performed for. This
multiple uses of NULL have resulted in subtle bugs (since fixed)
in the code.
Currently it is only the bonding driver that needs to have an untagged
file in a tagged directory.
To untagle this mess I am adding support for tagged files to sysfs.
Modifying the bonding driver to implement bonding_masters as a tagged
file. Registering bonding_masters once for each network namespace.
Then I am removing support for untagged entries in tagged sysfs
directories.
Resulting in code that is much easier to reason about.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index d7d2f21..dac0859 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -112,6 +112,7 @@ struct bin_attribute { struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *,char *); ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); + const void *(*namespace)(struct kobject *, const struct attribute *); }; struct sysfs_dirent; |