Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: make gc_urgent and gc_segment_mode sysfs node readable

Changed a way of showing values of them to use strings.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Daeho Jeong and committed by
Jaegeuk Kim
e60aeb2d 98e92867

+16 -1
+16 -1
fs/f2fs/sysfs.c
··· 41 41 ATGC_INFO, /* struct atgc_management */ 42 42 }; 43 43 44 + static const char *gc_mode_names[MAX_GC_MODE] = { 45 + "GC_NORMAL", 46 + "GC_IDLE_CB", 47 + "GC_IDLE_GREEDY", 48 + "GC_IDLE_AT", 49 + "GC_URGENT_HIGH", 50 + "GC_URGENT_LOW", 51 + "GC_URGENT_MID" 52 + }; 53 + 44 54 struct f2fs_attr { 45 55 struct attribute attr; 46 56 ssize_t (*show)(struct f2fs_attr *, struct f2fs_sb_info *, char *); ··· 326 316 return sysfs_emit(buf, "%u\n", sbi->compr_new_inode); 327 317 #endif 328 318 319 + if (!strcmp(a->attr.name, "gc_urgent")) 320 + return sysfs_emit(buf, "%s\n", 321 + gc_mode_names[sbi->gc_mode]); 322 + 329 323 if (!strcmp(a->attr.name, "gc_segment_mode")) 330 - return sysfs_emit(buf, "%u\n", sbi->gc_segment_mode); 324 + return sysfs_emit(buf, "%s\n", 325 + gc_mode_names[sbi->gc_segment_mode]); 331 326 332 327 if (!strcmp(a->attr.name, "gc_reclaimed_segments")) { 333 328 return sysfs_emit(buf, "%u\n",