diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-02-06 12:42:24 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-02-06 12:42:24 -0500 |
commit | 7b1c567c84a6292c138db3bd1638e19e73e0e593 (patch) | |
tree | 9ab6983c6fa2cbb837e9b782d1020899e0d2d846 /btrfslabel.c | |
parent | 5ffe6597e708d74c02d72d79ebb4a8fd2181e227 (diff) | |
parent | 2161e1b6f35d1c084fda49b479951219117c86e9 (diff) |
Merge branch 'for-chris' of git://repo.or.cz/btrfs-progs-unstable/devel into raid56
Conflicts:
ctree.h
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'btrfslabel.c')
-rw-r--r-- | btrfslabel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/btrfslabel.c b/btrfslabel.c index cb142b0a..a421a8b3 100644 --- a/btrfslabel.c +++ b/btrfslabel.c @@ -46,7 +46,7 @@ #define GET_LABEL 3 #define SET_LABEL 4 -static void change_label_unmounted(char *dev, char *nLabel) +static int change_label_unmounted(char *dev, char *nLabel) { struct btrfs_root *root; struct btrfs_trans_handle *trans; @@ -56,7 +56,7 @@ static void change_label_unmounted(char *dev, char *nLabel) */ root = open_ctree(dev, 0, 1); if (!root) /* errors are printed by open_ctree() */ - return; + return -1; trans = btrfs_start_transaction(root, 1); strncpy(root->fs_info->super_copy.label, nLabel, BTRFS_LABEL_SIZE); @@ -65,6 +65,7 @@ static void change_label_unmounted(char *dev, char *nLabel) /* Now we close it since we are done. */ close_ctree(root); + return 0; } int get_label_unmounted(char *dev) @@ -123,6 +124,5 @@ int set_label(char *btrfs_dev, char *nLabel) fprintf(stderr, "FATAL: the filesystem has to be unmounted\n"); return -2; } - change_label_unmounted(btrfs_dev, nLabel); - return 0; + return change_label_unmounted(btrfs_dev, nLabel); } |