f2fs: fix some format WARNING in debug.c and sysfs.c
To fix: WARNING: function definition argument 'struct f2fs_attr *' should also have an identifier name + ssize_t (*show)(struct f2fs_attr *, struct f2fs_sb_info *, char *); WARNING: return sysfs_emit(...) formats should include a terminating newline + return sysfs_emit(buf, "(none)"); WARNING: Prefer 'unsigned int' to bare use of 'unsigned' + unsigned npages = NODE_MAPPING(sbi)->nrpages; WARNING: Missing a blank line after declarations + unsigned npages = COMPRESS_MAPPING(sbi)->nrpages; + si->page_mem += (unsigned long long)npages << PAGE_SHIFT; WARNING: quoted string split across lines + seq_printf(s, "CP merge (Queued: %4d, Issued: %4d, Total: %4d, " + "Cur time: %4d(ms), Peak time: %4d(ms))\n", Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -318,18 +318,19 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
|
|||||||
|
|
||||||
si->page_mem = 0;
|
si->page_mem = 0;
|
||||||
if (sbi->node_inode) {
|
if (sbi->node_inode) {
|
||||||
unsigned npages = NODE_MAPPING(sbi)->nrpages;
|
unsigned long npages = NODE_MAPPING(sbi)->nrpages;
|
||||||
|
|
||||||
si->page_mem += (unsigned long long)npages << PAGE_SHIFT;
|
si->page_mem += (unsigned long long)npages << PAGE_SHIFT;
|
||||||
}
|
}
|
||||||
if (sbi->meta_inode) {
|
if (sbi->meta_inode) {
|
||||||
unsigned npages = META_MAPPING(sbi)->nrpages;
|
unsigned long npages = META_MAPPING(sbi)->nrpages;
|
||||||
|
|
||||||
si->page_mem += (unsigned long long)npages << PAGE_SHIFT;
|
si->page_mem += (unsigned long long)npages << PAGE_SHIFT;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
||||||
if (sbi->compress_inode) {
|
if (sbi->compress_inode) {
|
||||||
unsigned npages = COMPRESS_MAPPING(sbi)->nrpages;
|
unsigned long npages = COMPRESS_MAPPING(sbi)->nrpages;
|
||||||
|
|
||||||
si->page_mem += (unsigned long long)npages << PAGE_SHIFT;
|
si->page_mem += (unsigned long long)npages << PAGE_SHIFT;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -477,28 +478,28 @@ static int stat_show(struct seq_file *s, void *v)
|
|||||||
si->meta_count[META_NAT]);
|
si->meta_count[META_NAT]);
|
||||||
seq_printf(s, " - ssa blocks : %u\n",
|
seq_printf(s, " - ssa blocks : %u\n",
|
||||||
si->meta_count[META_SSA]);
|
si->meta_count[META_SSA]);
|
||||||
seq_printf(s, "CP merge (Queued: %4d, Issued: %4d, Total: %4d, "
|
seq_puts(s, "CP merge:\n");
|
||||||
"Cur time: %4d(ms), Peak time: %4d(ms))\n",
|
seq_printf(s, " - Queued : %4d\n", si->nr_queued_ckpt);
|
||||||
si->nr_queued_ckpt, si->nr_issued_ckpt,
|
seq_printf(s, " - Issued : %4d\n", si->nr_issued_ckpt);
|
||||||
si->nr_total_ckpt, si->cur_ckpt_time,
|
seq_printf(s, " - Total : %4d\n", si->nr_total_ckpt);
|
||||||
si->peak_ckpt_time);
|
seq_printf(s, " - Cur time : %4d(ms)\n", si->cur_ckpt_time);
|
||||||
|
seq_printf(s, " - Peak time : %4d(ms)\n", si->peak_ckpt_time);
|
||||||
seq_printf(s, "GC calls: %d (BG: %d)\n",
|
seq_printf(s, "GC calls: %d (BG: %d)\n",
|
||||||
si->call_count, si->bg_gc);
|
si->call_count, si->bg_gc);
|
||||||
seq_printf(s, " - data segments : %d (%d)\n",
|
seq_printf(s, " - data segments : %d (%d)\n",
|
||||||
si->data_segs, si->bg_data_segs);
|
si->data_segs, si->bg_data_segs);
|
||||||
seq_printf(s, " - node segments : %d (%d)\n",
|
seq_printf(s, " - node segments : %d (%d)\n",
|
||||||
si->node_segs, si->bg_node_segs);
|
si->node_segs, si->bg_node_segs);
|
||||||
seq_printf(s, " - Reclaimed segs : Normal (%d), Idle CB (%d), "
|
seq_puts(s, " - Reclaimed segs :\n");
|
||||||
"Idle Greedy (%d), Idle AT (%d), "
|
seq_printf(s, " - Normal : %d\n", si->sbi->gc_reclaimed_segs[GC_NORMAL]);
|
||||||
"Urgent High (%d), Urgent Mid (%d), "
|
seq_printf(s, " - Idle CB : %d\n", si->sbi->gc_reclaimed_segs[GC_IDLE_CB]);
|
||||||
"Urgent Low (%d)\n",
|
seq_printf(s, " - Idle Greedy : %d\n",
|
||||||
si->sbi->gc_reclaimed_segs[GC_NORMAL],
|
si->sbi->gc_reclaimed_segs[GC_IDLE_GREEDY]);
|
||||||
si->sbi->gc_reclaimed_segs[GC_IDLE_CB],
|
seq_printf(s, " - Idle AT : %d\n", si->sbi->gc_reclaimed_segs[GC_IDLE_AT]);
|
||||||
si->sbi->gc_reclaimed_segs[GC_IDLE_GREEDY],
|
seq_printf(s, " - Urgent High : %d\n",
|
||||||
si->sbi->gc_reclaimed_segs[GC_IDLE_AT],
|
si->sbi->gc_reclaimed_segs[GC_URGENT_HIGH]);
|
||||||
si->sbi->gc_reclaimed_segs[GC_URGENT_HIGH],
|
seq_printf(s, " - Urgent Mid : %d\n", si->sbi->gc_reclaimed_segs[GC_URGENT_MID]);
|
||||||
si->sbi->gc_reclaimed_segs[GC_URGENT_MID],
|
seq_printf(s, " - Urgent Low : %d\n", si->sbi->gc_reclaimed_segs[GC_URGENT_LOW]);
|
||||||
si->sbi->gc_reclaimed_segs[GC_URGENT_LOW]);
|
|
||||||
seq_printf(s, "Try to move %d blocks (BG: %d)\n", si->tot_blks,
|
seq_printf(s, "Try to move %d blocks (BG: %d)\n", si->tot_blks,
|
||||||
si->bg_data_blks + si->bg_node_blks);
|
si->bg_data_blks + si->bg_node_blks);
|
||||||
seq_printf(s, " - data blocks : %d (%d)\n", si->data_blks,
|
seq_printf(s, " - data blocks : %d (%d)\n", si->data_blks,
|
||||||
@@ -540,11 +541,11 @@ static int stat_show(struct seq_file *s, void *v)
|
|||||||
si->nr_dio_read, si->nr_dio_write);
|
si->nr_dio_read, si->nr_dio_write);
|
||||||
seq_printf(s, " - IO_R (Data: %4d, Node: %4d, Meta: %4d\n",
|
seq_printf(s, " - IO_R (Data: %4d, Node: %4d, Meta: %4d\n",
|
||||||
si->nr_rd_data, si->nr_rd_node, si->nr_rd_meta);
|
si->nr_rd_data, si->nr_rd_node, si->nr_rd_meta);
|
||||||
seq_printf(s, " - IO_W (CP: %4d, Data: %4d, Flush: (%4d %4d %4d), "
|
seq_printf(s, " - IO_W (CP: %4d, Data: %4d, Flush: (%4d %4d %4d), ",
|
||||||
"Discard: (%4d %4d)) cmd: %4d undiscard:%4u\n",
|
|
||||||
si->nr_wb_cp_data, si->nr_wb_data,
|
si->nr_wb_cp_data, si->nr_wb_data,
|
||||||
si->nr_flushing, si->nr_flushed,
|
si->nr_flushing, si->nr_flushed,
|
||||||
si->flush_list_empty,
|
si->flush_list_empty);
|
||||||
|
seq_printf(s, "Discard: (%4d %4d)) cmd: %4d undiscard:%4u\n",
|
||||||
si->nr_discarding, si->nr_discarded,
|
si->nr_discarding, si->nr_discarded,
|
||||||
si->nr_discard_cmd, si->undiscard_blks);
|
si->nr_discard_cmd, si->undiscard_blks);
|
||||||
seq_printf(s, " - atomic IO: %4d (Max. %4d)\n",
|
seq_printf(s, " - atomic IO: %4d (Max. %4d)\n",
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ static const char *gc_mode_names[MAX_GC_MODE] = {
|
|||||||
|
|
||||||
struct f2fs_attr {
|
struct f2fs_attr {
|
||||||
struct attribute attr;
|
struct attribute attr;
|
||||||
ssize_t (*show)(struct f2fs_attr *, struct f2fs_sb_info *, char *);
|
ssize_t (*show)(struct f2fs_attr *a, struct f2fs_sb_info *sbi, char *buf);
|
||||||
ssize_t (*store)(struct f2fs_attr *, struct f2fs_sb_info *,
|
ssize_t (*store)(struct f2fs_attr *a, struct f2fs_sb_info *sbi,
|
||||||
const char *, size_t);
|
const char *buf, size_t len);
|
||||||
int struct_type;
|
int struct_type;
|
||||||
int offset;
|
int offset;
|
||||||
int id;
|
int id;
|
||||||
@@ -233,13 +233,13 @@ static ssize_t encoding_show(struct f2fs_attr *a,
|
|||||||
(sb->s_encoding->version >> 8) & 0xff,
|
(sb->s_encoding->version >> 8) & 0xff,
|
||||||
sb->s_encoding->version & 0xff);
|
sb->s_encoding->version & 0xff);
|
||||||
#endif
|
#endif
|
||||||
return sprintf(buf, "(none)");
|
return sprintf(buf, "(none)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t mounted_time_sec_show(struct f2fs_attr *a,
|
static ssize_t mounted_time_sec_show(struct f2fs_attr *a,
|
||||||
struct f2fs_sb_info *sbi, char *buf)
|
struct f2fs_sb_info *sbi, char *buf)
|
||||||
{
|
{
|
||||||
return sprintf(buf, "%llu", SIT_I(sbi)->mounted_time);
|
return sprintf(buf, "%llu\n", SIT_I(sbi)->mounted_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_F2FS_STAT_FS
|
#ifdef CONFIG_F2FS_STAT_FS
|
||||||
|
|||||||
Reference in New Issue
Block a user