diff options
author | David Sterba <dsterba@suse.com> | 2019-05-10 17:48:30 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-11-18 12:47:01 +0100 |
commit | c3e14909d3b399d49d8dfcf3edbcd5463a7eed6f (patch) | |
tree | f06decac1cabe8a03096d32b9dce69b867e365dc /fs/btrfs/extent_map.h | |
parent | btrfs: remove pointless indentation in btrfs_read_sys_array() (diff) | |
download | linux-c3e14909d3b399d49d8dfcf3edbcd5463a7eed6f.tar.xz linux-c3e14909d3b399d49d8dfcf3edbcd5463a7eed6f.zip |
btrfs: assert extent_map bdevs and lookup_map and split
This is a preparatory patch for removing extent_map::bdev. There's some
history behind the code so this is only precaution to catch if things
break before the actual removal happens.
Logically, comparing a raw low-level block device (bdev) does not make
sense for extent maps (high-level objects). This had no effect in
practice but was quite confusing in the code. The lookup_map is set iff
EXTENT_FLAG_FS_MAPPING is set.
The two pointers were stored in the same bytes and used potentially in
two meanings. Now they're split, so the asserts are in place to check
that the condition will not change.
The lookup map pointer misused bdev, this has been changed in commit
95617d69326c ("btrfs: cleanup, stop casting for extent_map->lookup
everywhere") to the explicit type. But the semantics hasn't changed and
bdev was not actually used to decide if maps are mergeable.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_map.h')
-rw-r--r-- | fs/btrfs/extent_map.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index 473f039fcd7c..3eb9c596b445 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h @@ -42,7 +42,7 @@ struct extent_map { u64 block_len; u64 generation; unsigned long flags; - union { + struct { struct block_device *bdev; /* |