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 af52f6d7a4d8..4403e5643d43 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -597,6 +597,8 @@ struct btrfs_dir_item { | |||
597 | u8 type; | 597 | u8 type; |
598 | } __attribute__ ((__packed__)); | 598 | } __attribute__ ((__packed__)); |
599 | 599 | ||
600 | #define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0) | ||
601 | |||
600 | struct btrfs_root_item { | 602 | struct btrfs_root_item { |
601 | struct btrfs_inode_item inode; | 603 | struct btrfs_inode_item inode; |
602 | __le64 generation; | 604 | __le64 generation; |
@@ -1893,6 +1895,11 @@ BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64); | |||
1893 | BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, | 1895 | BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, |
1894 | last_snapshot, 64); | 1896 | last_snapshot, 64); |
1895 | 1897 | ||
1898 | static inline bool btrfs_root_readonly(struct btrfs_root *root) | ||
1899 | { | ||
1900 | return root->root_item.flags & BTRFS_ROOT_SUBVOL_RDONLY; | ||
1901 | } | ||
1902 | |||
1896 | /* struct btrfs_super_block */ | 1903 | /* struct btrfs_super_block */ |
1897 | 1904 | ||
1898 | BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); | 1905 | BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); |