"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cmds/qgroup.c" between
btrfs-progs-v5.4.tar.xz and btrfs-progs-v5.4.1.tar.xz

About: btrfs-progs are the userspace utilities for the Linux Btrfs filesystem.

qgroup.c  (btrfs-progs-v5.4.tar.xz):qgroup.c  (btrfs-progs-v5.4.1.tar.xz)
skipping to change at line 101 skipping to change at line 101
if (btrfs_qgroup_level(args.src) >= btrfs_qgroup_level(args.dst)) { if (btrfs_qgroup_level(args.src) >= btrfs_qgroup_level(args.dst)) {
error("bad relation requested: %s", path); error("bad relation requested: %s", path);
return 1; return 1;
} }
fd = btrfs_open_dir(path, &dirstream, 1); fd = btrfs_open_dir(path, &dirstream, 1);
if (fd < 0) if (fd < 0)
return 1; return 1;
ret = ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args); ret = ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args);
if (ret < 0) { if (ret < 0) {
error("unable to assign quota group: %m"); error("unable to assign quota group: %s",
errno == ENOTCONN ? "quota not enabled"
: strerror(errno));
close_file_or_dir(fd, dirstream); close_file_or_dir(fd, dirstream);
return 1; return 1;
} }
/* /*
* If ret > 0, it means assign caused qgroup data inconsistent state. * If ret > 0, it means assign caused qgroup data inconsistent state.
* Schedule a quota rescan if requested. * Schedule a quota rescan if requested.
* *
* The return value change only happens in newer kernel. But will not * The return value change only happens in newer kernel. But will not
* cause problem since old kernel has a bug that will never clear * cause problem since old kernel has a bug that will never clear
skipping to change at line 155 skipping to change at line 157
args.qgroupid = parse_qgroupid(argv[optind]); args.qgroupid = parse_qgroupid(argv[optind]);
path = argv[optind + 1]; path = argv[optind + 1];
fd = btrfs_open_dir(path, &dirstream, 1); fd = btrfs_open_dir(path, &dirstream, 1);
if (fd < 0) if (fd < 0)
return 1; return 1;
ret = ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args); ret = ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args);
close_file_or_dir(fd, dirstream); close_file_or_dir(fd, dirstream);
if (ret < 0) { if (ret < 0) {
error("unable to %s quota group: %m", error("unable to %s quota group: %s",
create ? "create":"destroy"); create ? "create":"destroy",
errno == ENOTCONN ? "quota not enabled"
: strerror(errno));
return 1; return 1;
} }
return 0; return 0;
} }
static const char * const cmd_qgroup_assign_usage[] = { static const char * const cmd_qgroup_assign_usage[] = {
"btrfs qgroup assign [options] <src> <dst> <path>", "btrfs qgroup assign [options] <src> <dst> <path>",
"Assign SRC as the child qgroup of DST", "Assign SRC as the child qgroup of DST",
"", "",
"--rescan schedule qutoa rescan if needed", "--rescan schedule qutoa rescan if needed",
skipping to change at line 450 skipping to change at line 454
} else } else
usage(cmd); usage(cmd);
fd = btrfs_open_dir(path, &dirstream, 1); fd = btrfs_open_dir(path, &dirstream, 1);
if (fd < 0) if (fd < 0)
return 1; return 1;
ret = ioctl(fd, BTRFS_IOC_QGROUP_LIMIT, &args); ret = ioctl(fd, BTRFS_IOC_QGROUP_LIMIT, &args);
close_file_or_dir(fd, dirstream); close_file_or_dir(fd, dirstream);
if (ret < 0) { if (ret < 0) {
error("unable to limit requested quota group: %m"); error("unable to limit requested quota group: %s",
errno == ENOTCONN ? "quota not enabled"
: strerror(errno));
return 1; return 1;
} }
return 0; return 0;
} }
static DEFINE_SIMPLE_COMMAND(qgroup_limit, "limit"); static DEFINE_SIMPLE_COMMAND(qgroup_limit, "limit");
static const char qgroup_cmd_group_info[] = static const char qgroup_cmd_group_info[] =
"manage quota groups"; "manage quota groups";
static const struct cmd_group qgroup_cmd_group = { static const struct cmd_group qgroup_cmd_group = {
 End of changes. 3 change blocks. 
4 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)