David Sterba
87596654ae
btrfs-progs: check: reorder fields in inode_backref for better packing
...
The structure size went from 56 bytes to 48, which could save some bytes
in larger scale.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
35985c1521
btrfs-progs: check: unify type for inode_backref::itemtype
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
b759702b67
btrfs-progs: check: unify type for inode_backref::filetype
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
17a8c6d7e1
btrfs-progs: send: cleanup use of ctransid delta temporary variable in find_good_parent
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
62fb1a5c14
btrfs-progs: send: cleanup, rename send context variables
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
a9f407b9a6
btrfs-progs: send: cleanup, rename some variables in dump_thread
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
f3a00c630a
btrfs-progs: send: clean types in write_buf
...
Use matching types for buffer, return value and buffer sizes.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
aec1d7fa8b
btrfs-progs: send: use proper type for read result, and rename the variable
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
76fc07e3a6
btrfs-progs: send: increase size of transfer buffer
...
4K is quite small, increase it to 64K. This reduces number of
context switches and calls to read. Kernel sends us about 50K of data
per read, so increasing the buffer further does not make any
improvement.
Example run on tests/cli-tests/004-send-parent-multi-subvol:
4K:
- ~800 context switches
- ~5000 calls to read
64K:
- ~450 context switches
- ~500 calls to read
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:31 +01:00
David Sterba
88edac358c
btrfs-progs: send: constify some arugments
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
29a1a78aaa
btrfs-progs: tests: add test for multi-subvolume send from parent
...
Fixed by "btrfs-progs: send: fix handling of multiple snapshots (-p
option)".
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
b9ff0190cf
btrfs-progs: dump-tree: convert dir-item-to-string to table
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
e6410f631d
btrfs-progs: dump-tree: convert key-to-string to table
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
69f879eac9
btrfs-progs: dump-tree: cleanup types for item number iteration
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
56917b41fb
btrfs-progs: dump-tree: move remaining item variables to the scope of use
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
e58cc23823
btrfs-progs: dump-tree: move variable declarations closer to their use
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
6b138f5367
btrfs-progs: dump-tree: rename extent buffer variable in btrfs_print_leaf
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
7541b53b34
btrfs-progs: dump-tree: add untyped item ptr helper and use it
...
There's lots of code that passes btrfs_item_ptr. Add a helper to extract
the ptr at the beginning, ignoring the type. The print functions take
the correct type, but we ignore it in the conversion macros as it does
not provide the type checking anyway.
If the typed variable is used more than once, it's kept in place.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
17a9d9013d
btrfs-progs: dump-tree: constify char argument in print_root_ref
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
a15294f0c4
btrfs-progs: dump-tree: simplify and fix check for empty uuid
...
Counting non-zero bytes is wasteful, besides that it would not recognize
uuids containing a 00 value.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
5082ec84a8
btrfs-progs: dump-tree: return void from print_* functions
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
e9c1121495
btrfs-progs: dump-tree: pass item size instead of item
...
Several functions take item but use just the size, we can factor the
item size and use that.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
ae00d4a251
btrfs-progs: remove unused parameter from print_inode_item
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
15db981600
btrfs-progs: dump-tree: consolidate data key names
...
Rename to the structure members, add underscore so it's a single word.
Compression is also printed as raw value.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
cf5c55fba8
btrfs-progs: dump-tree: print dev stats
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
0f4ab474fe
btrfs-progs: add dev stats on-disk structure
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
b74dbb86c0
btrfs-progs: dump-tree: print balance status item
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
ad5c75708a
btrfs-progs: add balance status structures
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
8a50dc9600
btrfs-progs: teach print_leaf about temporary item subtypes
...
[ kernel patch 9f07e1d76eaeeddedcf9651395b4a8f870df31f0 ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
9da5b472d5
btrfs-progs: teach print_leaf about permanent item subtypes
...
[ kernel patch 585a3d0d238dfe42909cb58b0d05f644365fed14 ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
2add123c8e
btrfs-progs: switch dev stats item to the permanent item key
...
[ kernel patch 242e2956e4afde7727fffe21adc0a7b198b77f96 ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
e244550b42
btrfs-progs: introduce key type for persistent permanent items
...
The number of distinct key types is not that big that we could waste one
for something new we want to store in the tree.
Similar to the temporary items, we'll introduce a new name for an
existing key value and use the objectid for further extension. The
victim is the BTRFS_DEV_STATS_KEY (248).
The device stats are an example of a permanent item.
[ kernel patch 50c2d5abe64c1726b48d292a2ab04f60e8238933 ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
e905d055f6
btrfs-progs: print-tree: extract offset from the item key
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
6122cb32c6
btrfs-progs: introduce key type for persistent temporary items
...
The number of distinct key types is not that big that we could waste one
for something new we want to store in the tree. We'll introduce a new
name for an existing key value and use the objectid for further
extension. The victim is the BTRFS_BALANCE_ITEM_KEY (248).
The nature of the balance status item is a good example of the temporary
item. It exists from beginning of the balance, keeps the status until it
finishes.
[ kernel patch 0bbbccb17fea86818e1a058faf5903aefd20b31a ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
5c4d53450b
btrfs-progs: mkfs: store creation time of the toplevel subvolume
...
For unkonwn reasons, the creation time of the toplevel subvolume inode
item hasn't been set.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
5d43dfd344
btrfs-progs: dump-tree: print missing data for file extent item
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:30 +01:00
David Sterba
069b0b6d14
btrfs-progs: dump-tree: print more root_item data
...
Print a few more missing items of root_item (there are still some
remaining). Drop key is printend unconditionally.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
58bef5b4a7
btrfs-progs: dump-tree: print missing dir_item data
...
Add items from dir_item that are not printed, plus other adjustments.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
6c849c616e
btrfs-progs: dump-tree: print missing inode_item data
...
Add items from inode_item that are not printed.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
f1d4606a6d
btrfs-progs: dump-tree: add helper to print timespec
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
58fe71f3f7
btrfs-progs: dump-tree: factor inode_item dump to function
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
cae265e816
btrfs-progs: dump-tree: print missing dev_extent data
...
Add items from chunk that are not printed, unify names according to
the member names and reorder a bit.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
c6cd8ff6ec
btrfs-progs: dump-tree: print missing chunk data
...
Add items from chunk that are not printed, unify names according to
the member names and reorder a bit.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
20ba2993a5
btrfs-progs: dump-tree: print missing dev_item data
...
Add items from dev_item that are not printed, unify names according to
the member names.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
d4aa2bc07e
btrfs-progs: subvol show: print more details about toplevel subvolume
...
The toplevel subvolume is special and the other listing code leaves it
out so we have to add several special cases to handle it. There's no
backreference so the path is built artificially. New helper
btrfs_get_toplevel_subvol is a reduced version of btrfs_get_subvol.
There's some information usually missing for the toplevel subvolume, eg.
the uuid or creation info. This has to be fixed on the mkfs side, the
other subvolumes are created by kernel.
Example:
/mnt
Name: <FS_TREE>
UUID: -
Parent UUID: -
Received UUID: -
Creation time: -
Subvolume ID: 5
Generation: 233
Gen at creation: 0
Parent ID: 0
Top level ID: 0
Flags: -
Snapshot(s):
subv1
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
eb28e2fcae
btrfs-progs: subvol list: better error message if subvol insertion fails
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
fc82ce45dc
btrfs-progs: subvol list: remove ugly goto construct
...
Jumping into an if is not considered nice.
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
f4ea2ec981
btrfs-progs: remove trivial helper root_lookup_init
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
65b2f81d77
btrfs-progs: subvol list: consolidate uuid types accross functions
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00
David Sterba
e573142d37
btrfs-progs: subvol list: add simplified helper for adding root backrefs
...
Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:47:29 +01:00