public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs: return void from csum_tree_block
Date: Fri, 28 Feb 2020 16:41:58 +0800	[thread overview]
Message-ID: <744be167-b3c1-99ac-e9c6-694a92a6f63b@gmx.com> (raw)
In-Reply-To: <c6518711b16ccd373084b8df681db41c198cb1ec.1582832619.git.dsterba@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 2009 bytes --]



On 2020/2/28 上午4:00, David Sterba wrote:
> Now that csum_tree_block is not returning any errors, we can make
> csum_tree_block return void and simplify callers.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>  fs/btrfs/disk-io.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 5f74eb69f2fe..8401852cf9c0 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -253,10 +253,8 @@ struct extent_map *btree_get_extent(struct btrfs_inode *inode,
>  
>  /*
>   * Compute the csum of a btree block and store the result to provided buffer.
> - *
> - * Returns error if the extent buffer cannot be mapped.
>   */
> -static int csum_tree_block(struct extent_buffer *buf, u8 *result)
> +static void csum_tree_block(struct extent_buffer *buf, u8 *result)
>  {
>  	struct btrfs_fs_info *fs_info = buf->fs_info;
>  	const int num_pages = fs_info->nodesize >> PAGE_SHIFT;
> @@ -276,8 +274,6 @@ static int csum_tree_block(struct extent_buffer *buf, u8 *result)
>  	}
>  	memset(result, 0, BTRFS_CSUM_SIZE);
>  	crypto_shash_final(shash, result);
> -
> -	return 0;
>  }
>  
>  /*
> @@ -528,8 +524,7 @@ static int csum_dirty_buffer(struct btrfs_fs_info *fs_info, struct page *page)
>  				    offsetof(struct btrfs_header, fsid),
>  				    BTRFS_FSID_SIZE) == 0);
>  
> -	if (csum_tree_block(eb, result))
> -		return -EINVAL;
> +	csum_tree_block(eb, result);
>  
>  	if (btrfs_header_level(eb))
>  		ret = btrfs_check_node(eb);
> @@ -640,9 +635,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
>  	btrfs_set_buffer_lockdep_class(btrfs_header_owner(eb),
>  				       eb, found_level);
>  
> -	ret = csum_tree_block(eb, result);
> -	if (ret)
> -		goto err;
> +	csum_tree_block(eb, result);
>  
>  	if (memcmp_extent_buffer(eb, result, 0, csum_size)) {
>  		u32 val;
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-02-28  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 20:00 [PATCH 0/4] Misc cleanups David Sterba
2020-02-27 20:00 ` [PATCH 1/4] btrfs: inline checksum name and driver definitions David Sterba
2020-02-27 22:31   ` Johannes Thumshirn
2020-02-28  8:38   ` Qu Wenruo
2020-02-27 20:00 ` [PATCH 2/4] btrfs: simplify tree block checksumming loop David Sterba
2020-02-27 22:52   ` Johannes Thumshirn
2020-02-28  8:41   ` Qu Wenruo
2020-02-27 20:00 ` [PATCH 3/4] btrfs: return void from csum_tree_block David Sterba
2020-02-27 22:32   ` Johannes Thumshirn
2020-02-28  8:41   ` Qu Wenruo [this message]
2020-02-27 20:00 ` [PATCH 4/4] btrfs: balance: factor out convert profile validation David Sterba
2020-02-27 22:33   ` Johannes Thumshirn
2020-02-28  8:43   ` Qu Wenruo

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=744be167-b3c1-99ac-e9c6-694a92a6f63b@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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