]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: split discard handling out of btrfs_map_block
authorChristoph Hellwig <hch@lst.de>
Fri, 3 Jun 2022 06:57:25 +0000 (08:57 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:34 +0000 (17:45 +0200)
commitace84c19706a3357f72ecf79ec4089b9bb81ac99
tree8a2a32253352a2d3137d7d899b22b7aacbf0502d
parentea092258e6d7020e8d480fb60b9e24bb13358d3c
btrfs: split discard handling out of btrfs_map_block

Mapping block for discard doesn't really share any code with the regular
block mapping case.  Split it out into an entirely separate helper
that just returns an array of btrfs_discard_stripe structures and the
number of stripes.

This removes the need for the length field in the btrfs_io_context
structure, so remove tht.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h