summaryrefslogtreecommitdiffstats
path: root/src/shared/btrfs-util.h
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-06-01 14:43:30 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-06-06 14:42:03 +0200
commit77c66be37b9b55c690cb9981775d369146b6a120 (patch)
tree2d7928d96353f56aa8330a96aabcebbef5782fde /src/shared/btrfs-util.h
parentrm-rf: Add rm_rf_at() (diff)
downloadsystemd-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.h10
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);