diff options
author | Qu Wenruo <quwenruo.btrfs@gmx.com> | 2017-08-23 10:57:56 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-10-30 14:27:57 +0300 |
commit | c3267bbaa9cae09b62960eafe33ad19196803285 (patch) | |
tree | 3024767cddfdc9a10ae135a5c3dee240c6d7cd6c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 6018ba0a0e1bc2378bdab353958e2db1a3d253fc (diff) | |
download | linux-c3267bbaa9cae09b62960eafe33ad19196803285.tar.xz |
btrfs: Refactor check_leaf function for later expansion
Current check_leaf() function does a good job checking key order and
item offset/size.
However it only checks from slot 0 to the last but one slot, this is
good but makes later expansion hard.
So this refactoring iterates from slot 0 to the last slot.
For key comparison, it uses a key with all 0 as initial key, so all
valid keys should be larger than that.
And for item size/offset checks, it compares current item end with
previous item offset.
For slot 0, use leaf end as a special case.
This makes later item/key offset checks and item size checks easier to
be implemented.
Also, makes check_leaf() to return -EUCLEAN other than -EIO to indicate
error.
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions