char *path;
DIR *dirstream = NULL;
int verbose = 0;
- int sync_mode = 0;
+ int commit_mode = 0;
struct option long_options[] = {
- {"commit-after", no_argument, NULL, 'c'}, /* sync mode 1 */
- {"commit-each", no_argument, NULL, 'C'}, /* sync mode 2 */
+ {"commit-after", no_argument, NULL, 'c'}, /* commit mode 1 */
+ {"commit-each", no_argument, NULL, 'C'}, /* commit mode 2 */
{NULL, 0, NULL, 0}
};
switch(c) {
case 'c':
- sync_mode = 1;
+ commit_mode = 1;
break;
case 'C':
- sync_mode = 2;
+ commit_mode = 2;
break;
case 'v':
verbose++;
if (verbose > 0) {
printf("Transaction commit: %s\n",
- !sync_mode ? "none (default)" :
- sync_mode == 1 ? "at the end" : "after each");
+ !commit_mode ? "none (default)" :
+ commit_mode == 1 ? "at the end" : "after each");
}
cnt = optind;
}
printf("Delete subvolume (%s): '%s/%s'\n",
- sync_mode == 2 || (sync_mode == 1 && cnt + 1 == argc)
+ commit_mode == 2 || (commit_mode == 1 && cnt + 1 == argc)
? "commit" : "no-commit", dname, vname);
strncpy_null(args.name, vname);
res = ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args);
goto out;
}
- if (sync_mode == 1) {
+ if (commit_mode == 1) {
res = wait_for_commit(fd);
if (res < 0) {
fprintf(stderr,
goto again;
}
- if (sync_mode == 2 && fd != -1) {
+ if (commit_mode == 2 && fd != -1) {
res = wait_for_commit(fd);
if (res < 0) {
fprintf(stderr,