summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: allow device deletion using 'missing' keyword againAlexander Fougner2015-11-16
| | | | | | | | | | Device deletion procedures ensures the device is a block device. This patch introduces 'missing' as keyword again, correctly passing it on to the kernel instead of complaining about 'missing' not being a block device. Signed-off-by: Alexander Fougner <fougner89@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: handler memory allocation error in make_btrfsDavid Sterba2015-11-16
| | | | | | Do the allocation early, no need to cleanup. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: reorder initialization in metadump_initDavid Sterba2015-11-16
| | | | | | | Put the allocations first, move pthread cond and mutex last so we don't have to do cleanup. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: corrupt-block: use on-stack path buffer in corrupt_dir_itemDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: calc-size: kill fs_roots structure and its userDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: calc-size: use on-stack buffer for a helper structureDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop unused argument from zero_output_fileDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use fixed size buffer in zero_output_fileDavid Sterba2015-11-13
| | | | | | | Rewrite the loop so we don't need to allocate sectorsize and write in 4k steps instead. We know that sectorsize is divisible by 4096. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: handle memory allocation failures in traverse_directoryDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: handle memory allocation failure in add_file_itemsDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use on-stack buffer in __csum_tree_block_sizeDavid Sterba2015-11-13
| | | | | | | We know the maximum size of a checksum, calling malloc for 4 bytes is weird. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use on-stack buffer in __ino_to_path_fdDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use on-stack buffer in recover_prepareDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use on-stack variable in __rebuild_device_itemsDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use on-stack buffer for btrfs_scan_one_deviceDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: use on-stack buffer for dev_to_fsidDavid Sterba2015-11-13
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused parameter from print_one_fsDavid Sterba2015-11-06
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: don't print version info from embedded subcommandsDavid Sterba2015-11-06
| | | | | | The version is provided by 'btrfs --version'. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: simplify empty stirngs checkDavid Sterba2015-11-06
| | | | | | We can do a strlen(str) == 0 in a simpler way. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: utils: rename helpinfo unit vairablesDavid Sterba2015-11-06
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.3David Sterba2015-11-06
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: do not truncate the image when --rootdir is setDavid Sterba2015-11-05
| | | | | | | | | | | | | | With the rootdir option we try to guess the final size of the image and fill it with zeros, preceded by truncation. After patch "Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified" the misc test 002 will fail, because of the non-mixed mode. I think we should not touch the image size (no change for block devices) and try to fit into whatever is provided by user. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Allow btrfs_leaf_free_space to accept NULL rootQu Wenruo2015-11-05
| | | | | | | | | | | | | | | Btrfs_leaf_free_space() function is used to determine the leaf/node size. It's OK to use root->nodesize to determine nodesize, but in fact, extent_buffer->len can also be used to determine the nodesize if caller can ensure it's a tree block. So this patch will add support for NULL root for btrfs_leaf_free_space() function, to allow btrfs_print_leaf() functions to be called in gdb or to debug temporary btrfs in make_btrfs() without a valid root. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: Round device size down to sectorsizeZhao Lei2015-11-03
| | | | | | | | | | | | | | | | | | | | | | | | When do following command in a vm, whose disks are created by qemu-img create -f raw 11 2.6G: # mkfs.btrfs -f /dev/vdd /dev/vde /dev/vdf # btrfs-show-super /dev/vdd /dev/vde /dev/vdf | grep dev_item.total_bytes dev_item.total_bytes 2791727104 dev_item.total_bytes 2791729152 dev_item.total_bytes 2791729152 We can see that the first device's size is little smaller. And it fails xfstests btrfs/011. Reason: First device's size is rounded down to sectorsize in make_btrfs(), but other devices are not. Fix: Round down remain devices' size in btrfs_add_to_fsid(). Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Rename variables in btrfs_add_to_fsidZhao Lei2015-11-03
| | | | | | | | | | | | | | | | | There are two total_bytes in btrfs_add_to_fsid(), local variable of total_bytes means fs_total_bytes, and device->total_bytes means device's total_bytes. And device's total_bytes in argument is named block_count in current code. This patch rename: total_bytes -> fs_total_bytes block_count -> device_total_bytes To make code more readable. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: Output stripe dev uuidQu Wenruo2015-11-03
| | | | | | | | | Add output for dev uuid for print_chunk(). Quite useful to debug temporary btrfs in btrfs-convert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: remove unused code of format uuid stringZhao Lei2015-11-03
| | | | | | | | Variant named dev_uuid and uuid_unparse() for set its value are not used, remove it. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: output device list in sorted orderZhao Lei2015-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list_for_each_entry_reverse() in current code can not output devices in sorted order, because the sequence are broken in btrfs_alloc_chunk(). We can use list_sort() instead. Before patch: # mkfs.btrfs -f /dev/vdd /dev/vde /dev/vdf ... Number of devices: 3 Devices: ID SIZE PATH 3 2.60GiB /dev/vdf 1 2.60GiB /dev/vdd 2 2.60GiB /dev/vde After patch: # mkfs.btrfs -f /dev/vdd /dev/vde /dev/vdf ... Number of devices: 3 Devices: ID SIZE PATH 1 2.60GiB /dev/vdd 2 2.60GiB /dev/vde 3 2.60GiB /dev/vdf Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: print header and footer separation lineDavid Sterba2015-11-03
| | | | | | | Print the full row width and change to '-' as we're not using '=' anywhere. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: string table: add specifier for fillup charDavid Sterba2015-11-03
| | | | | | | Currently it's one by a single "=", but we might want to use a different filler, let's make it explicit by "*". Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: string table: cleanup, rename single letter variablesDavid Sterba2015-11-03
| | | | | | Exception for indexing variables. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: string table: fix whitespace damageDavid Sterba2015-11-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: print device id column in the tabular output<F2>David Sterba2015-11-03
| | | | | | | | | | | | | | | Example output: Data Metadata System Id Path single RAID1 RAID1 Unallocated 1 /dev/sdc2 44.94GiB 7.93GiB 32.00MiB 1.00GiB 2 /dev/sde1 44.94GiB 7.93GiB 32.00MiB 1.00GiB ======== ======== ======== =========== Total 89.88GiB 7.93GiB 32.00MiB 2.00GiB Used 74.28GiB 4.44GiB 20.00KiB Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: cleanup, replace space info starting column constantDavid Sterba2015-11-03
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: cleanup, replace header constantDavid Sterba2015-11-03
| | | | | | | The size of the header is not obvious, let's make it more visible by replacing it with a varaible. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: properly count real space infosDavid Sterba2015-11-03
| | | | | | | | We did not account the column for path but abused the skipped global block reserve colum instead. Properly count the real infos and manually added headers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: print path header in the tabular modeDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: cleanup, print header in one goDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi usage: do not print global block reserveDavid Sterba2015-11-02
| | | | | | | Global block reserve is inherently part of metadata and should not be listed separately in the output of 'fi usage' in the tabular output. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs progs v4.3-rc1David Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: show-super: Add option to print superblock at given bytenrQu Wenruo2015-11-02
| | | | | | | | | | | Add '-s <sb_bytenr>' option to show superblock at given bytenr. This is very useful to debug non-standard btrfs, like debuging the 1st stage btrfs of btrfs-convert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor updates in docs ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: enhance manual page for inspect-internalDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: enhance the manual page for convertDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: enhance manual page for balanceDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: enhance manual page for btrfstuneDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: docs: enhance manual page for mkfsDavid Sterba2015-11-02
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: print version info firstDavid Sterba2015-11-02
| | | | | | The version info should not be preceded by any messages. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: fix bogus check after cpu on-line detectionDavid Sterba2015-11-02
| | | | | | | | Comparing unsigned type for <= 0 does not make much sense, we should really check the signed value returned by sysconf. Resolves-coverity-id: 1324536 Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Avoid use pointer in handle_optionsZhao Lei2015-11-02
| | | | | | | | | | | | | | We use pointer of argc and argv in handle_options() because they are necessary in very old code which are not exist now. This patch move to use argc and argv directly in handle_options(), alone with following update: 1: rename handle_options() to check_options() to fit its function. 2: cleanup for condition in handle_options() to make line short. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix uninitialized key.type for btrfs_find_free_objectidZhao Lei2015-11-02
| | | | | | | To avoid using uninitialized value in btrfs_search_slot(). Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>