if it is missing. It first attempts `BTRFS_IOC_SUBVOL_CREATE` so
`path.home` becomes its own subvolume, with independent
snapshot/quota lifecycle from the surrounding filesystem. On a
- non-btrfs parent (or older kernels that reject the ioctl) it falls
- back to a plain `mkdir()`. Only the final path component is
- created — the parent of `path.home` must already exist. Once
- `path.home` exists, `beeshash.dat` is created on first run, sized
- to `state.hash.size`.
+ non-btrfs parent it falls back to a plain `mkdir()`. Only the
+ final path component is created — the parent of `path.home` must
+ already exist. Once `path.home` exists, `beeshash.dat` is created
+ on first run, sized to `state.hash.size`.
* `no` — startup fails if `path.home` or `beeshash.dat` is missing.
Useful to detect a misconfigured `path.home` before bees writes a
fresh empty hash table to the wrong location.
const bool absolute = (home_dir.at(0) == '/');
- // First attempt: open paths.home if it already exists.
+ // First attempt: open path.home if it already exists.
// Absolute paths use plain openat (dirfd is ignored for absolute
// paths, symlinks are allowed); relative paths use bees_openat,
// which tries openat2(RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS |
m_home_fd = try_open(open_errno);
if (!m_home_fd && open_errno == ENOENT) {
if (!persistent) {
- // state.persistent=no: paths.home is optional. Run
+ // state.persistent=no: path.home is optional. Run
// inert: BeesStringFile reads return "" and writes
// no-op when m_dir_fd is empty. Logged once at
// INFO so it's audible without paying every reconnect.
- BEESLOGINFO("paths.home '" << home_dir << "' does not exist; running inert (state.persistent=no)");
+ BEESLOGINFO("path.home '" << home_dir << "' does not exist; running inert (state.persistent=no)");
return m_home_fd;
}
if (!create) {
- THROW_ERROR(runtime_error, "paths.home '" << home_dir << "' does not exist and state.create=no");
+ THROW_ERROR(runtime_error, "path.home '" << home_dir << "' does not exist and state.create=no");
}
- // state.persistent=yes && state.create=yes: create paths.home.
- // Try BTRFS_IOC_SUBVOL_CREATE first (so paths.home is its own
+ // state.persistent=yes && state.create=yes: create path.home.
+ // Try BTRFS_IOC_SUBVOL_CREATE first (so path.home is its own
// subvolume with independent snapshot/quota lifecycle), then
// fall back to mkdir(). Subvol creation only applies when the
// parent is root_fd() and the name is a single path component;
const bool single_component = !absolute && home_dir.find('/') == string::npos;
bool created = false;
if (single_component) {
- BEESLOGINFO("paths.home '" << home_dir << "' missing; creating subvolume");
+ BEESLOGINFO("path.home '" << home_dir << "' missing; creating subvolume");
created = btrfs_subvol_create_at(root_fd(), home_dir);
}
if (!created) {
- BEESLOGINFO("paths.home '" << home_dir << "' missing; creating directory");
+ BEESLOGINFO("path.home '" << home_dir << "' missing; creating directory");
const int mkdir_rv = absolute
? mkdir(home_dir.c_str(), 0700)
: mkdirat(root_fd(), home_dir.c_str(), 0700);
THROW_ERRNO("mkdir: " << home_dir);
}
}
- // Retry the open now that paths.home exists.
+ // Retry the open now that path.home exists.
m_home_fd = try_open(open_errno);
if (!m_home_fd) {
errno = open_errno;