Skip to content

Commit

Permalink
[PATCH] Add fs_subsys to enable filesystems to use sysfs
Browse files Browse the repository at this point in the history
This creates an "fs" subdirectory in sysfs so that GFS2 (or any other
filesystem, come to that) can make use of sysfs.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Jan 16, 2006
1 parent b346671 commit fba7b94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ static int hash_mask __read_mostly, hash_bits __read_mostly;
static kmem_cache_t *mnt_cache;
static struct rw_semaphore namespace_sem;

/* /sys/fs */
decl_subsys(fs, NULL, NULL);
EXPORT_SYMBOL_GPL(fs_subsys);

static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
{
unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES);
Expand Down Expand Up @@ -1725,6 +1729,7 @@ void __init mnt_init(unsigned long mempages)
i--;
} while (i);
sysfs_init();
subsystem_register(&fs_subsys);
init_rootfs();
init_mount_tree();
}
Expand Down
3 changes: 3 additions & 0 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,9 @@ extern int vfs_statfs(struct super_block *, struct kstatfs *);
#define FLOCK_VERIFY_READ 1
#define FLOCK_VERIFY_WRITE 2

/* /sys/fs */
extern struct subsystem fs_subsys;

extern int locks_mandatory_locked(struct inode *);
extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);

Expand Down

0 comments on commit fba7b94

Please sign in to comment.