Add yet another tiny helper to manipulate flags

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-04-10 16:40:48 +02:00
parent 7d6342e401
commit 0da965037e
4 changed files with 7 additions and 20 deletions
+1 -5
View File
@@ -175,11 +175,7 @@ int btrfs_subvol_set_read_only_fd(int fd, bool b) {
if (ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags) < 0)
return -errno;
if (b)
nflags = flags | BTRFS_SUBVOL_RDONLY;
else
nflags = flags & ~BTRFS_SUBVOL_RDONLY;
nflags = UPDATE_FLAG(flags, BTRFS_SUBVOL_RDONLY, b);
if (flags == nflags)
return 0;