f2fs: Use list_for_each_entry rather than list_for_each_entry_safe.
Subsystems (2)
PATCH 1/1 f2fs: Use list_for_each_entry rather than list_for_each_entry_safe.
Signed-off-by Jianpeng Ma <[email protected]>
--- fs/f2fs/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/debug.c +2 -2
@@ -175,12 +175,12 @@ get_cache:static int stat_show (struct seq_file *s,void *v) { -struct f2fs_stat_info *si, *next; +struct f2fs_stat_info *si;int i =0 ;int j;mutex_lock (&f2fs_stat_mutex); -list_for_each_entry_safe (si, next, &f2fs_stat_list, stat_list) { +list_for_each_entry (si, &f2fs_stat_list, stat_list) {char devname[BDEVNAME_SIZE ];update_general_status (si->sbi);
Signature · 1 line
1.8.3.rc1.44.gb387c77
Hi Jianpeng,
Could you explain why this *should* be changed?
Thanks,
2013-05-14 (화), 20:06 +0800, majianpeng:
Quoted 24 lines
Signed-off-by Jianpeng Ma <[email protected]>--- fs/f2fs/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/f2fs/debug.c +2
-2@@ -175,12 +175,12 @@ get_cache:static int stat_show (struct seq_file *s,void *v) { -struct f2fs_stat_info *si, *next; +struct f2fs_stat_info *si;int i =0 ;int j;mutex_lock (&f2fs_stat_mutex); -list_for_each_entry_safe (si, next, &f2fs_stat_list, stat_list) { +list_for_each_entry (si, &f2fs_stat_list, stat_list) {char devname[BDEVNAME_SIZE ];update_general_status (si->sbi);
Signature · 2 lines
Jaegeuk Kim Samsung
Quoted 24 lines · Jaegeuk Kim
Hi Jianpeng,
Could you explain why this *should* be changed?
Thanks,2013-05-14 (화), 20:06 +0800, majianpeng:
Quoted 18 lines
Signed-off-by Jianpeng Ma <[email protected]>--- fs/f2fs/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/f2fs/debug.c +1
-1@@ -175,12 +175,12 @@ get_cache:static int stat_show (struct seq_file *s,void *v) { -struct f2fs_stat_info *si, *next; +struct f2fs_stat_info *si;int i =0 ;int j;
Quoted 6 lines
fs/f2fs/debug.c get_cache: · line 186
Quoted 6 lines
fs/f2fs/debug.c +1
-1mutex_lock (&f2fs_stat_mutex); -list_for_each_entry_safe (si, next, &f2fs_stat_list, stat_list) { +list_for_each_entry (si, &f2fs_stat_list, stat_list) {char devname[BDEVNAME_SIZE ];update_general_status (si->sbi);
Hi,
In general, if we want to do delete operation like list_delete(&si->stat_list) ,we can use list_for_each_entry_safe. Otherwise, we used list_for_each_entry.
Thanks!
Jianpeng Ma
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html