1 Add a proc interface for max_dir_size.
4 fs/ext4/sysfs.c | 10 +++++++++-
5 1 file changed, 9 insertions(+), 1 deletion(-)
9 @@ -209,6 +209,8 @@ EXT4_ATTR_FUNC(reserved_clusters, 0644);
10 EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, inode_readahead,
11 ext4_sb_info, s_inode_readahead_blks);
12 EXT4_RW_ATTR_SBI_UI(inode_goal, s_inode_goal);
13 +EXT4_RW_ATTR_SBI_UI(max_dir_size, s_max_dir_size_kb);
14 +EXT4_RW_ATTR_SBI_UI(max_dir_size_kb, s_max_dir_size_kb);
15 EXT4_RW_ATTR_SBI_UI(mb_stats, s_mb_stats);
16 EXT4_RW_ATTR_SBI_UI(mb_max_to_scan, s_mb_max_to_scan);
17 EXT4_RW_ATTR_SBI_UI(mb_min_to_scan, s_mb_min_to_scan);
18 @@ -252,6 +254,8 @@ static struct attribute *ext4_attrs[] =
19 ATTR_LIST(reserved_clusters),
20 ATTR_LIST(inode_readahead_blks),
21 ATTR_LIST(inode_goal),
22 + ATTR_LIST(max_dir_size),
23 + ATTR_LIST(max_dir_size_kb),
25 ATTR_LIST(mb_max_to_scan),
26 ATTR_LIST(mb_min_to_scan),
27 @@ -376,7 +380,9 @@ static ssize_t ext4_attr_show(struct kob
30 return snprintf(buf, PAGE_SIZE, "%u\n",
31 - *((unsigned int *) ptr));
32 + strcmp("max_dir_size", a->attr.name) ?
33 + *((unsigned int *) ptr) :
34 + (*((unsigned int *) ptr)) << 10);
38 @@ -439,6 +445,8 @@ static ssize_t ext4_attr_store(struct ko
39 ret = kstrtoul(skip_spaces(buf), 0, &t);
42 + if (strcmp("max_dir_size", a->attr.name) == 0)
44 if (a->attr_ptr == ptr_ext4_super_block_offset)
45 *((__le32 *) ptr) = cpu_to_le32(t);