fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access to '%s'\n", path);
- return 12;
+ return 1;
}
ret = ioctl(fd, BTRFS_IOC_BALANCE_V2, args);
if (e != EINPROGRESS)
fprintf(stderr, "There may be more info in "
"syslog - try dmesg | tail\n");
- ret = 19;
+ ret = 1;
}
} else {
printf("Done, had to relocate %llu out of %llu chunks\n",
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access to '%s'\n", path);
- return 12;
+ return 1;
}
ret = ioctl(fd, BTRFS_IOC_BALANCE_CTL, BTRFS_BALANCE_CTL_PAUSE);
if (ret < 0) {
fprintf(stderr, "ERROR: balance pause on '%s' failed - %s\n",
path, (e == ENOTCONN) ? "Not running" : strerror(e));
- return 19;
+ if (e == ENOTCONN)
+ return 2;
+ else
+ return 1;
}
return 0;
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access to '%s'\n", path);
- return 12;
+ return 1;
}
ret = ioctl(fd, BTRFS_IOC_BALANCE_CTL, BTRFS_BALANCE_CTL_CANCEL);
if (ret < 0) {
fprintf(stderr, "ERROR: balance cancel on '%s' failed - %s\n",
path, (e == ENOTCONN) ? "Not in progress" : strerror(e));
- return 19;
+ if (e == ENOTCONN)
+ return 2;
+ else
+ return 1;
}
return 0;
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access to '%s'\n", path);
- return 12;
+ return 1;
}
memset(&args, 0, sizeof(args));
"failed - %s\n", path,
(e == ENOTCONN) ? "Not in progress" :
"Already running");
- return 19;
+ if (e == ENOTCONN)
+ return 2;
+ else
+ return 1;
} else {
fprintf(stderr,
"ERROR: error during balancing '%s' - %s\n"
"There may be more info in syslog - try dmesg | tail\n", path, strerror(e));
- return 19;
+ return 1;
}
} else {
printf("Done, had to relocate %llu out of %llu chunks\n",