public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: Nikolay Borisov <nborisov@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: Remove done label in writepage_delalloc
Date: Fri, 17 Jul 2020 12:34:52 +0200	[thread overview]
Message-ID: <20200717103452.GC3703@twin.jikos.cz> (raw)
In-Reply-To: <SN4PR0401MB3598754B32E2FAF5092C8EB09B7C0@SN4PR0401MB3598.namprd04.prod.outlook.com>

On Fri, Jul 17, 2020 at 07:31:22AM +0000, Johannes Thumshirn wrote:
> On 16/07/2020 17:17, Nikolay Borisov wrote:
> > Since there is not common cleanup run after the label it makes it somewhat
> > redundant.
> > 
> > Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> > ---
> >  fs/btrfs/extent_io.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> > index a76b7da91aa6..e6d1d46ae384 100644
> > --- a/fs/btrfs/extent_io.c
> > +++ b/fs/btrfs/extent_io.c
> > @@ -3445,8 +3445,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,
> >  			 * started, so we don't want to return > 0 unless
> >  			 * things are going well.
> >  			 */
> > -			ret = ret < 0 ? ret : -EIO;
> > -			goto done;
> > +			return ret < 0 ? ret : -EIO;
> >  		}
> >  		/*
> >  		 * delalloc_end is already one less than the total length, so
> > @@ -3478,10 +3477,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,
> >  		return 1;
> >  	}
> > 
> > -	ret = 0;
> > -
> > -done:
> > -	return ret;
> > +	return 0;
> >  }
> 
> I thought David doesn't like direct returns in loops?
> 
> /me thinks this is easier to understand though

I don't but try to evaluate each patch if it makes sense and the code is
readable and does not diverge too much from patterns we have elsewhere.
This one looks ok, so I'll add it to misc-next.

      reply	other threads:[~2020-07-17 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 15:17 [PATCH] btrfs: Remove done label in writepage_delalloc Nikolay Borisov
2020-07-17  7:31 ` Johannes Thumshirn
2020-07-17 10:34   ` David Sterba [this message]

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=20200717103452.GC3703@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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