All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 02/11] btrfs: move mapping of block for discard to its caller
Date: Fri, 21 Feb 2020 17:31:03 +0100	[thread overview]
Message-ID: <32b32a9b68f956a3bfe216b72060001811a71d01.1582302545.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1582302545.git.dsterba@suse.com>

There's a simple forwarded call based on the operation that would better
fit the caller btrfs_map_block that's until now a trivial wrapper.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/volumes.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d8a88866aaa3..997f2c70cb6c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5953,10 +5953,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
 	struct btrfs_io_geometry geom;
 
 	ASSERT(bbio_ret);
-
-	if (op == BTRFS_MAP_DISCARD)
-		return __btrfs_map_block_for_discard(fs_info, logical,
-						     length, bbio_ret);
+	ASSERT(op != BTRFS_MAP_DISCARD);
 
 	ret = btrfs_get_io_geometry(fs_info, op, logical, *length, &geom);
 	if (ret < 0)
@@ -6186,6 +6183,10 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
 		      u64 logical, u64 *length,
 		      struct btrfs_bio **bbio_ret, int mirror_num)
 {
+	if (op == BTRFS_MAP_DISCARD)
+		return __btrfs_map_block_for_discard(fs_info, logical,
+						     length, bbio_ret);
+
 	return __btrfs_map_block(fs_info, op, logical, length, bbio_ret,
 				 mirror_num, 0);
 }
-- 
2.25.0


  parent reply	other threads:[~2020-02-21 16:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 16:30 [PATCH 00/11] Minor cleanups David Sterba
2020-02-21 16:31 ` [PATCH 01/11] btrfs: use struct_size to calculate size of raid hash table David Sterba
2020-02-22  8:38   ` Johannes Thumshirn
2020-02-21 16:31 ` David Sterba [this message]
2020-02-22  8:40   ` [PATCH 02/11] btrfs: move mapping of block for discard to its caller Johannes Thumshirn
2020-02-24  3:31   ` Anand Jain
2020-02-21 16:31 ` [PATCH 03/11] btrfs: open code trivial helper btrfs_header_fsid David Sterba
2020-02-22  8:41   ` Johannes Thumshirn
2020-02-21 16:31 ` [PATCH 04/11] btrfs: open code trivial helper btrfs_header_chunk_tree_uuid David Sterba
2020-02-22  8:42   ` Johannes Thumshirn
2020-02-21 16:31 ` [PATCH 05/11] btrfs: simplify parameters of btrfs_set_disk_extent_flags David Sterba
2020-02-22  8:45   ` Johannes Thumshirn
2020-02-24 14:51     ` David Sterba
2020-02-24  3:43   ` Anand Jain
2020-02-21 16:31 ` [PATCH 06/11] btrfs: adjust message level for unrecognized mount option David Sterba
2020-02-22  8:46   ` Johannes Thumshirn
2020-02-24  3:44   ` Anand Jain
2020-02-21 16:31 ` [PATCH 07/11] btrfs: raid56: simplify sort_parity_stripes David Sterba
2020-02-22  8:47   ` Johannes Thumshirn
2020-02-21 16:31 ` [PATCH 08/11] btrfs: replace u_long type cast with unsigned long David Sterba
2020-02-22  8:48   ` Johannes Thumshirn
2020-02-24 20:09   ` Christoph Hellwig
2020-02-21 16:31 ` [PATCH 09/11] btrfs: adjust delayed refs message level David Sterba
2020-02-22  8:48   ` Johannes Thumshirn
2020-02-24  3:46   ` Anand Jain
2020-02-21 16:31 ` [PATCH 10/11] btrfs: merge unlocking to common exit block in btrfs_commit_transaction David Sterba
2020-02-22  8:50   ` Johannes Thumshirn
2020-02-24  3:56   ` Anand Jain
2020-02-24 15:02   ` David Sterba
2020-02-24 15:13   ` [PATCH v2] " David Sterba
2020-02-25  4:00     ` Anand Jain
2020-02-21 16:31 ` [PATCH 11/11] btrfs: reduce pointer intdirections in btree_readpage_end_io_hook David Sterba
2020-02-22  8:54   ` Johannes Thumshirn

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=32b32a9b68f956a3bfe216b72060001811a71d01.1582302545.git.dsterba@suse.com \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.