From mboxrd@z Thu Jan 1 00:00:00 1970 From: majianpeng Subject: Re: [PATCH][Trivial] f2fs: Use list_for_each_entry rather than list_for_each_entry_safe. Date: Wed, 15 May 2013 14:36:40 +0800 Message-ID: <51932CF8.4090109@gmail.com> References: <519228D6.4070504@gmail.com> <1368593136.11843.17.camel@kjgkr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel , linux-f2fs-devel@lists.sourceforge.net To: jaegeuk.kim@samsung.com Return-path: Received: from mail-pd0-f172.google.com ([209.85.192.172]:61104 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754398Ab3EOGgr (ORCPT ); Wed, 15 May 2013 02:36:47 -0400 Received: by mail-pd0-f172.google.com with SMTP id 6so1086108pdd.31 for ; Tue, 14 May 2013 23:36:47 -0700 (PDT) In-Reply-To: <1368593136.11843.17.camel@kjgkr> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 05/15/2013 12:45 PM, Jaegeuk Kim wrote: > Hi Jianpeng, > > Could you explain why this *should* be changed? > Thanks, > > 2013-05-14 (=ED=99=94), 20:06 +0800, majianpeng: >> Signed-off-by: Jianpeng Ma >> --- >> fs/f2fs/debug.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c >> index 8d99437..0d6c6aa 100644 >> --- a/fs/f2fs/debug.c >> +++ b/fs/f2fs/debug.c >> @@ -175,12 +175,12 @@ get_cache: >> =20 >> static int stat_show(struct seq_file *s, void *v) >> { >> - struct f2fs_stat_info *si, *next; >> + struct f2fs_stat_info *si; >> int i =3D 0; >> int j; >> =20 >> 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]; >> =20 >> update_general_status(si->sbi); Hi, In general, if we want to do delete operation like list_delete(&si->sta= t_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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html