summaryrefslogtreecommitdiff
path: root/fs/sysfs/mount.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-01-24 12:35:52 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 10:37:14 -0800
commitb592fcfe7f06c15ec11774b5be7ce0de3aa86e73 (patch)
tree13f2cb344f8871edd30dc15007534405197d8480 /fs/sysfs/mount.c
parent2f65168de7d68a5795e945e781d85b313bdc97b9 (diff)
downloadlinux-b592fcfe7f06c15ec11774b5be7ce0de3aa86e73.tar.gz
sysfs: Shadow directory support
The problem. When implementing a network namespace I need to be able to have multiple network devices with the same name. Currently this is a problem for /sys/class/net/*. What I want is a separate /sys/class/net directory in sysfs for each network namespace, and I want to name each of them /sys/class/net. I looked and the VFS actually allows that. All that is needed is for /sys/class/net to implement a follow link method to redirect lookups to the real directory you want. Implementing a follow link method that is sensitive to the current network namespace turns out to be 3 lines of code so it looks like a clean approach. Modifying sysfs so it doesn't get in my was is a bit trickier. I am calling the concept of multiple directories all at the same path in the filesystem shadow directories. With the directory entry really at that location the shadow master. The following patch modifies sysfs so it can handle a directory structure slightly different from the kobject tree so I can implement the shadow directories for handling /sys/class/net/. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Maneesh Soni <maneesh@in.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/mount.c')
-rw-r--r--fs/sysfs/mount.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index a1a58b97f322..f6a87a824883 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -23,7 +23,7 @@ static void sysfs_clear_inode(struct inode *inode);
static struct super_operations sysfs_ops = {
.statfs = simple_statfs,
- .drop_inode = generic_delete_inode,
+ .drop_inode = sysfs_delete_inode,
.clear_inode = sysfs_clear_inode,
};