update hole handling v2
PATCH 1/4 update hole handling v2
Hello,
This patch splits the hole insertion code out of btrfs_setattr into btrfs_cont_expand and updates btrfs_get_extent to properly handle the case that file extent items are not continuous.
Regards
Signed-off-by Yan Zheng <[email protected]>
---
fs/btrfs/ctree.h +1 -0
@@ -1908,6 +1908,7 @@ int btrfs_update_inode(struct btrfs_tranint btrfs_orphan_add (struct btrfs_trans_handle *trans,struct inode *inode);int btrfs_orphan_del (struct btrfs_trans_handle *trans,struct inode *inode);void btrfs_orphan_cleanup (struct btrfs_root *root); +int btrfs_cont_expand (struct inode *inode,loff_t size);/* ioctl.c */ long btrfs_ioctl (struct file *file,unsigned int cmd,unsigned long arg);
fs/btrfs/extent_map.h +1 -0
@@ -11,6 +11,7 @@/* bits for the flags field */ #define EXTENT_FLAG_PINNED 0/* this entry not yet on disk, don't free it */ #define EXTENT_FLAG_COMPRESSED 1 +#define EXTENT_FLAG_VACANCY 2/* no file extent item found */ struct extent_map {struct rb_node rb_node;
fs/btrfs/file.c +6 -35
59 lines not on this page · raw message
fs/btrfs/inode.c +101 -90
253 lines not on this page · raw message