*/
if ((args.src >> 48) >= (args.dst >> 48)) {
fprintf(stderr, "ERROR: bad relation requested '%s'\n", path);
- return 12;
+ return 1;
}
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access '%s'\n", path);
- return 12;
+ return 1;
}
ret = ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args);
if (ret < 0) {
fprintf(stderr, "ERROR: unable to assign quota group: %s\n",
strerror(e));
- return 30;
+ return 1;
}
return 0;
}
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access '%s'\n", path);
- return 12;
+ return 1;
}
ret = ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args);
if (ret < 0) {
fprintf(stderr, "ERROR: unable to create quota group: %s\n",
strerror(e));
- return 30;
+ return 1;
}
return 0;
}
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access '%s'\n", path);
- return 12;
+ return 1;
}
ret = list_qgroups(fd);
e = errno;
close_file_or_dir(fd, dirstream);
- if (ret < 0) {
+ if (ret < 0)
fprintf(stderr, "ERROR: can't list qgroups: %s\n",
strerror(e));
- return 30;
- }
- return ret;
+ return !!ret;
}
static const char * const cmd_qgroup_limit_usage[] = {
ret = test_issubvolume(path);
if (ret < 0) {
fprintf(stderr, "ERROR: error accessing '%s'\n", path);
- return 12;
+ return 1;
}
if (!ret) {
fprintf(stderr, "ERROR: '%s' is not a subvolume\n",
path);
- return 13;
+ return 1;
}
/*
* keep qgroupid at 0, this indicates that the subvolume the
fd = open_file_or_dir(path, &dirstream);
if (fd < 0) {
fprintf(stderr, "ERROR: can't access '%s'\n", path);
- return 12;
+ return 1;
}
ret = ioctl(fd, BTRFS_IOC_QGROUP_LIMIT, &args);
if (ret < 0) {
fprintf(stderr, "ERROR: unable to limit requested quota group: "
"%s\n", strerror(e));
- return 30;
+ return 1;
}
return 0;
}