Skip to contentSkip to conversation

Btrfs: Pre-allocate space for data relocation

PATCH Superseded Yan, Zheng 1 participant 1 message Apr 19, 2010 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 11/12 Btrfs: Pre-allocate space for data relocation

Pre-allocate space for data relocation. This can detect ENOPSC condition caused by fragmentation of free space.

---

fs/btrfs/ctree.h +3 -0
diff -urp 11/fs/btrfs/ctree.h 12/fs/btrfs/ctree.h
@@ -2406,6 +2406,9 @@ int btrfs_cont_expand(struct inode *inod
 int btrfs_invalidate_inodes(struct btrfs_root *root);
 void btrfs_add_delayed_iput(struct inode *inode);
 void btrfs_run_delayed_iputs(struct btrfs_root *root);
+int btrfs_prealloc_file_range(struct inode *inode, int mode,
+			      u64 start, u64 num_bytes, u64 min_size,
+			      loff_t actual_len, u64 *alloc_hint);
 extern const struct dentry_operations btrfs_dentry_operations;
 
 /* ioctl.c */
fs/btrfs/inode.c +24 -20

91 lines not on this page · raw message

fs/btrfs/relocation.c +65 -25

145 lines not on this page · raw message