linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct
Date: Thu, 19 Apr 2018 17:53:31 +0200	[thread overview]
Message-ID: <20180419155331.GK21272@twin.jikos.cz> (raw)
In-Reply-To: <e68cd719-3a3c-b125-eed0-97bf7f1afb08@suse.com>

On Wed, Apr 11, 2018 at 10:22:58AM +0300, Nikolay Borisov wrote:
> >> +			free_extent_map(em);
> >> +			goto unlock_err;
> >> +		}
> >> +		/*
> >> +		 * We need to unlock only the end area that we aren't using
> >> +		 * if there is any leftover space
> >> +		 */
> >> +		free_extent_state(cached_state);
> >>  		free_extent_map(em);
> >> -		goto unlock_err;
> >> +		return 0;
> > 
> > Please add a separate label for that, the funcion uses the single exit
> > block style (labels and one-or-two returns).
> 
> So I think this is unnecessary because in 2/2 I factor out common code
> i.e. the free_extent_map(em); return 0; outside of the 'if' branch and
> so this return disappears. The 3rd hunk in 2/2 begins with:
> 
> @@ -7780,106 +7882,8 @@ static int btrfs_get_blocks_direct(struct inode
> *inode, sector_t iblock,
>  		 * if there is any leftover space
>  		 */
>  		free_extent_state(cached_state);
> -		free_extent_map(em);
> -		return 0;
> -	}

Ok.

      reply	other threads:[~2018-04-19 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 16:12 [PATCH 1/2] btrfs: Factor out read portion of btrfs_get_blocks_direct Nikolay Borisov
2018-02-22 16:12 ` [PATCH 2/2] btrfs: Factor out write " Nikolay Borisov
2018-04-10 16:06   ` David Sterba
2018-04-10 15:49 ` [PATCH 1/2] btrfs: Factor out read " David Sterba
2018-04-11  7:22   ` Nikolay Borisov
2018-04-19 15:53     ` 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=20180419155331.GK21272@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --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;
as well as URLs for NNTP newsgroup(s).