Files
systemd/src/basic/btrfs.h
T
Alberto Planas ab1f4e506f repart: support "nodatacow" in btrfs subvolumes
In btrfs-progs 6.15 it is planned to add a new parameter in mkfs.btrfs
--inode-flags, that can set attributes for subvolumes, directories, and
files.

The current supported attributes are "nodatacow", to disable CoW, and
"nodatasum", to disable the checksum.

This commit extend the "Subvolunes=" option to understand the
"nodatacow" flag for subvolums only.

If RepartOffline is enabled it will build the image without loopback
devices, using the correct --inode-flags parameters.

If RepartOffline is disabled it will use loopback devices and set the
btrfs attributes accordingly.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2025-11-02 17:13:31 +09:00

19 lines
659 B
C

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "basic-forward.h"
typedef enum BtrfsSubvolFlags {
BTRFS_SUBVOL_RO = 1 << 0,
BTRFS_SUBVOL_NODATACOW = 1 << 1,
_BTRFS_SUBVOL_FLAGS_MASK = BTRFS_SUBVOL_NODATACOW|BTRFS_SUBVOL_RO,
_BTRFS_SUBVOL_FLAGS_INVALID = -EINVAL,
_BTRFS_SUBVOL_FLAGS_ERRNO_MAX = -ERRNO_MAX, /* Ensure the whole errno range fits into this enum */
} BtrfsSubvolFlags;
int btrfs_validate_subvolume_name(const char *name);
int btrfs_subvol_make(int dir_fd, const char *path);
int btrfs_subvol_make_fallback(int dir_fd, const char *path, mode_t mode);