This patch adds readonly inode flag support. A file with this flag
can't be modified, but can be deleted.
btrfs_set_stack_inode_nlink(&btrfs_inode, 1);
btrfs_set_stack_inode_nblocks(&btrfs_inode, 0);
btrfs_set_stack_inode_mode(&btrfs_inode, S_IFREG | 0400);
- btrfs_set_stack_inode_flags(&btrfs_inode, BTRFS_INODE_NODATASUM);
+ btrfs_set_stack_inode_flags(&btrfs_inode, BTRFS_INODE_NODATASUM |
+ BTRFS_INODE_READONLY);
btrfs_init_path(&path);
trans = btrfs_start_transaction(root, 1);
BUG_ON(!trans);
/*
* Inode flags
*/
-#define BTRFS_INODE_NODATASUM 0x1
-#define BTRFS_INODE_NODATACOW 0x2
+#define BTRFS_INODE_NODATASUM (1 << 0)
+#define BTRFS_INODE_NODATACOW (1 << 1)
+#define BTRFS_INODE_READONLY (1 << 2)
+
#define read_eb_member(eb, ptr, type, member, result) ( \
read_extent_buffer(eb, (char *)(result), \
((unsigned long)(ptr)) + \