Btrfs: Add readonly snapshots support
authorLi Zefan <lizf@cn.fujitsu.com>
Mon, 20 Dec 2010 08:04:08 +0000 (16:04 +0800)
committerLi Zefan <lizf@cn.fujitsu.com>
Thu, 23 Dec 2010 00:49:17 +0000 (08:49 +0800)
commitb83cc9693f39689490970c19f6c5b866f6719a70
treeb86d09884015fce195a4ac5ff1e8ec5f6ec00677
parentfa0d2b9bd717340e0bc4850a80ac0eb344e9a7fb
Btrfs: Add readonly snapshots support

Usage:

Set BTRFS_SUBVOL_RDONLY of btrfs_ioctl_vol_arg_v2->flags, and call
ioctl(BTRFS_I0CTL_SNAP_CREATE_V2).

Implementation:

- Set readonly bit of btrfs_root_item->flags.
- Add readonly checks in btrfs_permission (inode_permission),
btrfs_setattr, btrfs_set/remove_xattr and some ioctls.

Changelog for v3:

- Eliminate btrfs_root->readonly, but check btrfs_root->root_item.flags.
- Rename BTRFS_ROOT_SNAP_RDONLY to BTRFS_ROOT_SUBVOL_RDONLY.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/ioctl.h
fs/btrfs/transaction.c
fs/btrfs/transaction.h
fs/btrfs/xattr.c