diff options
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 53b984623983..4acd4c611efa 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -601,6 +601,8 @@ struct btrfs_dir_item { | |||
601 | u8 type; | 601 | u8 type; |
602 | } __attribute__ ((__packed__)); | 602 | } __attribute__ ((__packed__)); |
603 | 603 | ||
604 | #define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0) | ||
605 | |||
604 | struct btrfs_root_item { | 606 | struct btrfs_root_item { |
605 | struct btrfs_inode_item inode; | 607 | struct btrfs_inode_item inode; |
606 | __le64 generation; | 608 | __le64 generation; |
@@ -1898,6 +1900,11 @@ BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64); | |||
1898 | BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, | 1900 | BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, |
1899 | last_snapshot, 64); | 1901 | last_snapshot, 64); |
1900 | 1902 | ||
1903 | static inline bool btrfs_root_readonly(struct btrfs_root *root) | ||
1904 | { | ||
1905 | return root->root_item.flags & BTRFS_ROOT_SUBVOL_RDONLY; | ||
1906 | } | ||
1907 | |||
1901 | /* struct btrfs_super_block */ | 1908 | /* struct btrfs_super_block */ |
1902 | 1909 | ||
1903 | BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); | 1910 | BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); |