@@ -265,7 +265,7 @@ static int cmd_subvol_delete(int argc, char **argv)
int commit_mode = 0;
u8 fsid[BTRFS_FSID_SIZE];
char uuidbuf[BTRFS_UUID_UNPARSED_SIZE];
- struct seen_fsid *seen_fsid_hash[SEEN_FSID_HASH_SIZE] = {NULL,};
+ struct seen_fsid *seen_fsid_hash[SEEN_FSID_HASH_SIZE] = { NULL, };
enum { COMMIT_AFTER = 1, COMMIT_EACH = 2 };
while (1) {
@@ -364,8 +364,10 @@ static int cmd_subvol_delete(int argc, char **argv)
} else if (commit_mode == COMMIT_AFTER) {
res = get_fsid(dname, fsid, 0);
if (res < 0) {
- error("unable to get fsid for '%s': %s", path, strerror(-res));
- error("delete suceeded but commit may not be done in the end");
+ error("unable to get fsid for '%s': %s",
+ path, strerror(-res));
+ error(
+ "delete suceeded but commit may not be done in the end");
ret = 1;
goto out;
}
@@ -373,10 +375,14 @@ static int cmd_subvol_delete(int argc, char **argv)
if (add_seen_fsid(fsid, seen_fsid_hash, fd, dirstream) == 0) {
if (verbose > 0) {
uuid_unparse(fsid, uuidbuf);
- printf(" new fs is found for '%s', fsid: %s\n", path, uuidbuf);
+ printf(" new fs is found for '%s', fsid: %s\n",
+ path, uuidbuf);
}
- // this is the first time a subvolume on this filesystem is deleted
- // keep fd in order to issue SYNC ioctl in the end
+ /*
+ * This is the first time a subvolume on this
+ * filesystem is deleted, keep fd in order to issue
+ * SYNC ioctl in the end
+ */
goto keep_fd;
}
}
@@ -395,27 +401,32 @@ static int cmd_subvol_delete(int argc, char **argv)
goto again;
if (commit_mode == COMMIT_AFTER) {
- // traverse seen_fsid_hash and issue SYNC ioctl on each filesystem
int slot;
- struct seen_fsid *seen;
+ /*
+ * Traverse seen_fsid_hash and issue SYNC ioctl on each
+ * filesystem
+ */
for (slot = 0; slot < SEEN_FSID_HASH_SIZE; slot++) {
- seen = seen_fsid_hash[slot];
+ struct seen_fsid *seen = seen_fsid_hash[slot];
+
while (seen) {
res = wait_for_commit(seen->fd);
if (res < 0) {
uuid_unparse(seen->fsid, uuidbuf);
- error("unable to do final sync after deletion: %s, fsid: %s",
+ error(
+ "unable to do final sync after deletion: %s, fsid: %s",
strerror(errno), uuidbuf);
ret = 1;
} else if (verbose > 0) {
uuid_unparse(seen->fsid, uuidbuf);
- printf("final sync is done for fsid: %s\n", uuidbuf);
+ printf("final sync is done for fsid: %s\n",
+ uuidbuf);
}
seen = seen->next;
}
}
- // fd will also be closed in free_seen_fsid
+ /* fd will also be closed in free_seen_fsid */
free_seen_fsid(seen_fsid_hash);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in