summaryrefslogtreecommitdiff
path: root/mkfs/common.c
Commit message (Collapse)AuthorAge
* btrfs-progs: mkfs: Move the tree root creation to own functionGu Jinxiang2017-09-08
| | | | | | | | | | | | | make_btrfs is too long to understand, make creatation of root tree in a function. Some of the tree roots are now created in a loop, where the code is just copypasted. We now make use of the reference_root_table to translate block index to root objectid. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> [ updated changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Use named constants for common sizesNikolay Borisov2017-09-08
| | | | | | | | | There multiple places where we use well-known sizes - 1,8,16,32 megabytes. We also have them defined as constants in the sizes.h header. So let's use them. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: Replace number with enumGu Jinxiang2017-09-08
| | | | | | | | | For code maintainability and scalability, replace hardcoded constant with a meaningful enum. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> [ add MKFS_ prefix ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Remove deprecated leafsize usageQu Wenruo2017-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | Leafsize is deprecated for a long time, and kernel has already updated ctree.h to rename sb->leafsize to sb->__unused_leafsize. This patch will remove normal users of leafsize: 1) Remove leafsize member from btrfs_root structure Now only root->nodesize and root->sectorisze. No longer root->leafsize. 2) Remove @leafsize parameter from btrfs_setup_root() function Since no root->leafsize, no need for @leafsize parameter. The remaining user of leafsize will be: 1) btrfs inspect-internal dump-super Reformat the "leafsize" output to "leafsize (deprecated)" and use le32_to_cpu() to do the cast manually. 2) mkfs We still need to set sb->__unused_leafsize to nodesize. Do the manual cast too. 3) convert Same as mkfs, these two superblock setup should be merged later Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: add missing limits headersBaruch Siach2017-03-16
| | | | | | | Build under musl libc fails because of missing PATH_MAX and XATTR_NAME_MAX macro declarations. Add the required headers. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
* btrfs-progs: mkfs: make make_cfg::blocks an internal memberDavid Sterba2017-03-08
| | | | | | | The caller of make_btrfs does not need to set it, it's for internal use and can be read after mkfs ends. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move mkfs helper implementation out of utilsDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: move common api implementation to own fileDavid Sterba2017-03-08
Signed-off-by: David Sterba <dsterba@suse.com>