summaryrefslogtreecommitdiff
path: root/convert.c
diff options
context:
space:
mode:
authorYan <yanzheng@21cn.com>2008-01-14 13:35:00 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-01-14 13:35:00 -0500
commit3a3123bfc1074ee81c8cb44938e4b50a044898b9 (patch)
tree73d8a92132b280a7a1583a9a8915ba095064706f /convert.c
parent62a72e7d9ada7a986dd299622b2233fe2e386003 (diff)
Add readonly inode flag
This patch adds readonly inode flag support. A file with this flag can't be modified, but can be deleted.
Diffstat (limited to 'convert.c')
-rw-r--r--convert.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/convert.c b/convert.c
index c0476203..86c41b08 100644
--- a/convert.c
+++ b/convert.c
@@ -1163,7 +1163,8 @@ static int create_ext2_image(struct btrfs_root *root, ext2_filsys ext2_fs,
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);