Lines Matching refs:subvolume

92 static int extract_subvolume_name(const char *path, const char **subvolume) {
97 assert(subvolume);
105 *subvolume = fn;
151 const char *subvolume;
156 r = extract_subvolume_name(path, &subvolume);
164 strncpy(args.name, subvolume, sizeof(args.name)-1);
471 /* Look precisely for the subvolume items */
691 * subvolume. This only works for subvolumes that have been
753 * subvolume. This is useful for determining the quota data
754 * for entire subvolume subtrees, as long as the subtrees have
1183 static int subvol_remove_children(int fd, const char *subvolume, uint64_t subvol_id, BtrfsRemoveFlags flags) {
1204 assert(subvolume);
1212 subvol_fd = openat(fd, subvolume, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY);
1222 /* First, try to remove the subvolume. If it happens to be
1224 strncpy(vol_args.name, subvolume, sizeof(vol_args.name)-1);
1232 /* OK, the subvolume is not empty, let's look for child
1283 * directory of the subvolume. */
1308 * again to remove the subvolume */
1318 const char *subvolume;
1323 r = extract_subvolume_name(path, &subvolume);
1331 return subvol_remove_children(fd, subvolume, 0, flags);
1334 int btrfs_subvol_remove_fd(int fd, const char *subvolume, BtrfsRemoveFlags flags) {
1335 return subvol_remove_children(fd, subvolume, 0, flags);
1447 * the new subvolume. */
1474 /* The old subvolume was member of a qgroup
1484 /* The old subvolume shared a common
1486 * subvolume. Let's set up something
1529 static int subvol_snapshot_children(int old_fd, int new_fd, const char *subvolume, uint64_t old_subvol_id, BtrfsSnapshotFlags flags) {
1554 assert(subvolume);
1556 strncpy(vol_args.name, subvolume, sizeof(vol_args.name)-1);
1610 /* Avoid finding the source subvolume a second
1616 * subvolume is below the old one. */
1633 * subvolume is in the top-level directory,
1645 np = strjoin(subvolume, "/", ino_args.name, NULL);
1660 subvolume_fd = openat(new_fd, subvolume, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY);
1711 const char *subvolume;
1745 r = extract_subvolume_name(new_path, &subvolume);
1753 return subvol_snapshot_children(old_fd, new_fd, subvolume, 0, flags);
1866 * Sets up the specified subvolume's qgroup automatically in
1869 * If insert_intermediary_qgroup is false, the subvolume's
1871 * the subvolume's parent subvolume.
1875 * but reusing the id of the subvolume. The level number is
1877 * parent subvolume is a member of. If the parent subvolume's
1881 * qgroup, and the subvolume itself is assigned to it.
1883 * If the subvolume is already assigned to a higher level
1888 * function is invoked the subvolume will be accounted within
1891 * turn be used by subvolumes created beneath this subvolume
1896 * created subvolume: each subvolume is always accounting
1940 * subvolume is assigned to. */
1991 /* Assign our subvolume to all the same qgroups as the parent */
2021 /* Look precisely for the subvolume items */