X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=utils.h;h=d3cfcaa63a4e3073e1d8529cb5f8a3888ca9eeb9;hb=bf17a5e43ebf7db63a64fe3e584af88e48b27355;hp=6599ee4d4a943d261f56f7bce1d87c560f17cc61;hpb=18e2663db3e18d4506b6fe583ad93fc83235fca9;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/utils.h b/utils.h index 6599ee4..d3cfcaa 100644 --- a/utils.h +++ b/utils.h @@ -24,11 +24,11 @@ #include #define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024) +#define BTRFS_MKFS_SMALL_VOLUME_SIZE (1024 * 1024 * 1024) #define BTRFS_SCAN_PROC (1ULL << 0) -#define BTRFS_SCAN_DEV (1ULL << 1) -#define BTRFS_SCAN_MOUNTED (1ULL << 2) -#define BTRFS_SCAN_LBLKID (1ULL << 3) +#define BTRFS_SCAN_MOUNTED (1ULL << 1) +#define BTRFS_SCAN_LBLKID (1ULL << 2) #define BTRFS_UPDATE_KERNEL 1 @@ -39,6 +39,15 @@ #define BTRFS_UUID_UNPARSED_SIZE 37 +#define ARGV0_BUF_SIZE 64 + +int check_argc_exact(int nargs, int expected); +int check_argc_min(int nargs, int expected); +int check_argc_max(int nargs, int expected); + +void fixup_argv0(char **argv, const char *token); +void set_argv0(char **argv); + int make_btrfs(int fd, const char *device, const char *label, char *fs_uuid, u64 blocks[6], u64 num_bytes, u32 nodesize, u32 leafsize, u32 sectorsize, u32 stripesize, u64 features); @@ -52,7 +61,6 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, u32 sectorsize); int btrfs_scan_for_fsid(int run_ioctls); void btrfs_register_one_device(char *fname); -int btrfs_scan_one_dir(char *dirname, int run_ioctl); char *canonicalize_dm_name(const char *ptname); char *canonicalize_path(const char *path); int check_mounted(const char *devicename); @@ -106,6 +114,8 @@ int get_device_info(int fd, u64 devid, int test_uuid_unique(char *fs_uuid); int test_minimum_size(const char *file, u32 leafsize); +int test_issubvolname(const char *name); +int test_isdir(const char *path); /* * Btrfs minimum size calculation is complicated, it should include at least: