@@ -41,7 +41,8 @@ ocfs2-objs := \
quota_local.o \
quota_global.o \
xattr.o \
- acl.o \
+ acl.o \
+ sysfs.o \
filecheck.o
ocfs2_stackglue-objs := stackglue.o
@@ -640,8 +640,7 @@ static void ocfs2_sysfs_exit(void)
static int ocfs2_sysfs_init(void)
{
int ret;
-
- ocfs2_kset = kset_create_and_add("ocfs2", NULL, fs_kobj);
+ ocfs2_kset = kset_create_and_add("ocfs2_stack", NULL, fs_kobj);
if (!ocfs2_kset)
return -ENOMEM;
@@ -75,6 +75,7 @@
#include "buffer_head_io.h"
#include "filecheck.h"
+#include "sysfs.h"
static struct kmem_cache *ocfs2_inode_cachep;
struct kmem_cache *ocfs2_dquot_cachep;
@@ -1200,8 +1201,8 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
/* Start this when the mount is almost sure of being successful */
ocfs2_orphan_scan_start(osb);
- /* Create filecheck sysfile /sys/fs/ocfs2/<devname>/filecheck */
- ocfs2_filecheck_create_sysfs(sb);
+ /* Create sysfs entries */
+ ocfs2_sysfs_sb_init(sb);
return status;
@@ -1232,7 +1233,7 @@ static struct file_system_type ocfs2_fs_type = {
.name = "ocfs2",
.mount = ocfs2_mount,
.kill_sb = kill_block_super,
- .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE,
+ .fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE|FS_CREATE_SYSFS,
.next = NULL
};
MODULE_ALIAS_FS("ocfs2");
@@ -1653,7 +1654,6 @@ static void ocfs2_put_super(struct super_block *sb)
ocfs2_sync_blockdev(sb);
ocfs2_dismount_volume(sb, 0);
- ocfs2_filecheck_remove_sysfs(sb);
}
static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
new file mode 100644
@@ -0,0 +1,26 @@
+#include <linux/fs.h>
+#include "ocfs2.h"
+#include "sysfs.h"
+
+static ssize_t slot_num_show(struct super_block *sb,
+ struct super_block_attribute *attr,
+ char *buf)
+{
+ struct ocfs2_super *osb = OCFS2_SB(sb);
+ return sprintf(buf, "%d\n", osb->slot_num);
+}
+
+static SB_ATTR_RO(slot_num);
+static struct attribute *ocfs2_sb_attrs[] = {
+ &sb_attr_slot_num.attr,
+ NULL
+};
+
+int ocfs2_sysfs_sb_init(struct super_block *sb)
+{
+ sb->s_attr = ocfs2_sb_attrs;
+ return 0;
+
+}
+
+
new file mode 100644
@@ -0,0 +1,8 @@
+
+
+#ifndef _SYS_H
+#define _SYS_H
+
+int ocfs2_sysfs_sb_init(struct super_block *sb);
+
+#endif