diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-06-01 14:43:30 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-06-06 14:42:03 +0200 |
commit | 77c66be37b9b55c690cb9981775d369146b6a120 (patch) | |
tree | 2d7928d96353f56aa8330a96aabcebbef5782fde /src/shared/btrfs-util.h | |
parent | rm-rf: Add rm_rf_at() (diff) | |
download | systemd-77c66be37b9b55c690cb9981775d369146b6a120.tar.xz systemd-77c66be37b9b55c690cb9981775d369146b6a120.zip |
btrfs-util: Add btrfs_subvol_set_read_only_at()
Diffstat (limited to 'src/shared/btrfs-util.h')
-rw-r--r-- | src/shared/btrfs-util.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/btrfs-util.h b/src/shared/btrfs-util.h index f79bb6e7ef..56a0169027 100644 --- a/src/shared/btrfs-util.h +++ b/src/shared/btrfs-util.h @@ -89,8 +89,14 @@ static inline int btrfs_subvol_remove(const char *path, BtrfsRemoveFlags flags) return btrfs_subvol_remove_at(AT_FDCWD, path, flags); } -int btrfs_subvol_set_read_only_fd(int fd, bool b); -int btrfs_subvol_set_read_only(const char *path, bool b); +int btrfs_subvol_set_read_only_at(int dir_fd, const char *path, bool b); +static inline int btrfs_subvol_set_read_only_fd(int fd, bool b) { + return btrfs_subvol_set_read_only_at(fd, NULL, b); +} +static inline int btrfs_subvol_set_read_only(const char *path, bool b) { + return btrfs_subvol_set_read_only_at(AT_FDCWD, path, b); +} + int btrfs_subvol_get_read_only_fd(int fd); int btrfs_subvol_get_id(int fd, const char *subvolume, uint64_t *ret); |