Skip to contentSkip to conversation

update hole handling v2

PATCH In review Yan Zheng 1 participant 1 message Oct 30, 2008 Btrfs file system

lore
Share & tools
lore

Yan Zheng

author
#0 lore raw

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

---

fs/btrfs/ctree.h +1 -0
diff -urp 1/fs/btrfs/ctree.h 2/fs/btrfs/ctree.h
@@ -1908,6 +1908,7 @@ int btrfs_update_inode(struct btrfs_tran
 int 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
diff -urp 1/fs/btrfs/extent_map.h 2/fs/btrfs/extent_map.h
@@ -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