Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fba7b940 authored by David Teigland's avatar David Teigland Committed by Steven Whitehouse
Browse files

[PATCH] Add fs_subsys to enable filesystems to use sysfs



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: default avatarDavid Teigland <teigland@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent b346671f
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,10 @@ static int hash_mask __read_mostly, hash_bits __read_mostly;
static kmem_cache_t *mnt_cache;
static kmem_cache_t *mnt_cache;
static struct rw_semaphore namespace_sem;
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)
static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
{
{
	unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES);
	unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES);
@@ -1725,6 +1729,7 @@ void __init mnt_init(unsigned long mempages)
		i--;
		i--;
	} while (i);
	} while (i);
	sysfs_init();
	sysfs_init();
	subsystem_register(&fs_subsys);
	init_rootfs();
	init_rootfs();
	init_mount_tree();
	init_mount_tree();
}
}
+3 −0
Original line number Original line Diff line number Diff line
@@ -1293,6 +1293,9 @@ extern int vfs_statfs(struct super_block *, struct kstatfs *);
#define FLOCK_VERIFY_READ  1
#define FLOCK_VERIFY_READ  1
#define FLOCK_VERIFY_WRITE 2
#define FLOCK_VERIFY_WRITE 2


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

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