Skip to contentSkip to conversation

ext4: Add sysfs support

PATCH In review Theodore Ts'o 2 participants 6 messages Mar 1, 2009 – Mar 31, 2009 ext4 file system

lore
Share & tools
lore

Theodore Ts'o

author maintainer
#0 lore raw

PATCH 1/1 ext4: Add sysfs support

Add basic sysfs support so that information about the mounted filesystem and various tuning parameters can be accessed via /sys/fs/ext4/<dev>/*.

---
 fs/ext4/ext4_sb.h |    2 +
 fs/ext4/super.c   |  198 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 200 insertions(+), 0 deletions(-)
fs/ext4/ext4_sb.h +2 -0
index 50ab116..57b71fe 100644
@@ -64,6 +64,8 @@ struct ext4_sb_info {
 	struct percpu_counter s_dirtyblocks_counter;
 	struct blockgroup_lock *s_blockgroup_lock;
 	struct proc_dir_entry *s_proc;
+	struct kobject s_kobj;
+	struct completion s_kobj_unregister;
 
 	/* Journaling */
 	struct inode *s_journal_inode;
fs/ext4/super.c +198 -0

246 lines not on this page · raw message

Signature · 1 line
1.5.6.3
author maintainer
#1 lore raw

PATCH 1/1 ext4: remove /proc tuning knobs

Remove tuning knobs in /proc/fs/ext4/<dev/* since they have been replaced by knobs in sysfs at /sys/fs/ext4/<dev>/*.

---
 fs/ext4/ext4.h    |   16 -------
 fs/ext4/inode.c   |    7 +---
 fs/ext4/mballoc.c |  117 +++++++++++++----------------------------------------
 fs/ext4/super.c   |   46 ---------------------
 4 files changed, 30 insertions(+), 156 deletions(-)
fs/ext4/ext4.h +0 -16
index 5621eb0..2c165fa 100644
@@ -975,22 +975,6 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
 
 extern struct proc_dir_entry *ext4_proc_root;
 
-#ifdef CONFIG_PROC_FS
-extern const struct file_operations ext4_ui_proc_fops;
-
-#define	EXT4_PROC_HANDLER(name, var)					\
-do {									\
-	proc = proc_create_data(name, mode, sbi->s_proc,		\
-				&ext4_ui_proc_fops, &sbi->s_##var);	\
-	if (proc == NULL) {						\
-		printk(KERN_ERR "EXT4-fs: can't create %s\n", name);	\
-		goto err_out;						\
-	}								\
-} while (0)
-#else
-#define EXT4_PROC_HANDLER(name, var)
-#endif
-
 /*
  * Function prototypes
  */
fs/ext4/inode.c +1 -6
index 8815b9c..b8e3412 100644
@@ -4124,12 +4124,7 @@ make_io:
 			unsigned num;
 
 			table = ext4_inode_table(sb, gdp);
-			/* Make sure s_inode_readahead_blks is a power of 2 */
-			while (EXT4_SB(sb)->s_inode_readahead_blks &
-			       (EXT4_SB(sb)->s_inode_readahead_blks-1))
-				EXT4_SB(sb)->s_inode_readahead_blks = 
-				   (EXT4_SB(sb)->s_inode_readahead_blks &
-				    (EXT4_SB(sb)->s_inode_readahead_blks-1));
+			/* s_inode_readahead_blks is always a power of 2 */
 			b = block & ~(EXT4_SB(sb)->s_inode_readahead_blks-1);
 			if (table > b)
 				b = table;
fs/ext4/mballoc.c +29 -88

185 lines not on this page · raw message

fs/ext4/super.c +0 -45

66 lines not on this page · raw message

#2 lore raw

Re: [PATCH] ext4: remove /proc tuning knobs

Quoted 11 lines · Theodore Ts'o

Remove tuning knobs in /proc/fs/ext4/<dev/* since they have been replaced by knobs in sysfs at /sys/fs/ext4/<dev>/*.

---
 fs/ext4/ext4.h    |   16 -------
 fs/ext4/inode.c   |    7 +---
 fs/ext4/mballoc.c |  117 +++++++++++++----------------------------------------
 fs/ext4/super.c   |   46 ---------------------
 4 files changed, 30 insertions(+), 156 deletions(-)

This patch would need changes to Documentation/filesystems/proc.txt

-aneesh

author maintainer
#3 lore raw

Re: [PATCH] ext4: remove /proc tuning knobs

Quoted 13 lines · Aneesh Kumar K.V
Quoted 11 lines · Theodore Ts'o

Remove tuning knobs in /proc/fs/ext4/<dev/* since they have been replaced by knobs in sysfs at /sys/fs/ext4/<dev>/*.

---
 fs/ext4/ext4.h    |   16 -------
 fs/ext4/inode.c   |    7 +---
 fs/ext4/mballoc.c |  117 +++++++++++++----------------------------------------
 fs/ext4/super.c   |   46 ---------------------
 4 files changed, 30 insertions(+), 156 deletions(-)
Quoted 1 line

This patch would need changes to Documentation/filesystems/proc.txt

Good point, added, thanks.

- Ted

#4 lore raw
In reply to Theodore Ts'o
Quoted 10 lines · Theodore Ts'o

Add basic sysfs support so that information about the mounted filesystem and various tuning parameters can be accessed via /sys/fs/ext4/<dev>/*.

---
 fs/ext4/ext4_sb.h |    2 +
 fs/ext4/super.c   |  198 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 200 insertions(+), 0 deletions(-)

This needs documentation in Documentation/ABI/testing.

-aneesh

author maintainer
#5 lore raw
Quoted 5 lines · Aneesh Kumar K.V
Quoted 4 lines · Theodore Ts'o

Add basic sysfs support so that information about the mounted filesystem and various tuning parameters can be accessed via /sys/fs/ext4/<dev>/*.

Quoted 8 lines
Quoted 6 lines
---
 fs/ext4/ext4_sb.h |    2 +
 fs/ext4/super.c   |  198 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 200 insertions(+), 0 deletions(-)

This needs documentation in Documentation/ABI/testing.

Good point, added, thanks.

- Ted