linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Guo Chao <yan@linux.vnet.ibm.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 4/4] ext4: remove unnecessary NULL pointer check
Date: Mon, 28 Jan 2013 17:24:13 -0800	[thread overview]
Message-ID: <20130129012413.GC4754@blackbox.djwong.org> (raw)
In-Reply-To: <1358496074-6228-4-git-send-email-yan@linux.vnet.ibm.com>

On Fri, Jan 18, 2013 at 04:01:14PM +0800, Guo Chao wrote:
> brelse() and ext4_journal_force_commit() are both inlined and able
> to handle NULL.
> 
> Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>

This one looks ok too, so:
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

PS: Does the order of the patches matter?  Or are these just four patches that
are mostly independent of each other?

--D
> ---
>  fs/ext4/namei.c |    3 +--
>  fs/ext4/super.c |    6 +-----
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index e35ea3d..f0812c0 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -2110,8 +2110,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
>  journal_error:
>  	ext4_std_error(dir->i_sb, err);
>  cleanup:
> -	if (bh)
> -		brelse(bh);
> +	brelse(bh);
>  	dx_release(frames);
>  	return err;
>  }
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 3d4fb81..f3acd6f 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4476,16 +4476,12 @@ static void ext4_clear_journal_err(struct super_block *sb,
>  int ext4_force_commit(struct super_block *sb)
>  {
>  	journal_t *journal;
> -	int ret = 0;
>  
>  	if (sb->s_flags & MS_RDONLY)
>  		return 0;
>  
>  	journal = EXT4_SB(sb)->s_journal;
> -	if (journal)
> -		ret = ext4_journal_force_commit(journal);
> -
> -	return ret;
> +	return ext4_journal_force_commit(journal);
>  }
>  
>  static int ext4_sync_fs(struct super_block *sb, int wait)
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-01-29  1:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18  8:01 [PATCH 1/4] ext4: release buffer when checksum failed Guo Chao
2013-01-18  8:01 ` [PATCH 2/4] ext4: remove unused variable in add_dirent_to_buf() Guo Chao
2013-01-29  1:12   ` Darrick J. Wong
2013-01-29  2:28     ` Theodore Ts'o
2013-01-18  8:01 ` [PATCH 3/4] ext4: remove useless assignment in dx_probe() Guo Chao
2013-01-29  1:21   ` Darrick J. Wong
2013-01-29  2:37     ` Theodore Ts'o
2013-01-29  2:35   ` Theodore Ts'o
2013-01-18  8:01 ` [PATCH 4/4] ext4: remove unnecessary NULL pointer check Guo Chao
2013-01-29  1:24   ` Darrick J. Wong [this message]
2013-01-29  2:40     ` Guo Chao
2013-01-29  2:42     ` Theodore Ts'o
2013-01-18 21:28 ` [PATCH 1/4] ext4: release buffer when checksum failed Darrick J. Wong
2013-01-29  2:25   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130129012413.GC4754@blackbox.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=yan@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).