exchange the blocks between two inodes
Subsystems (2)
RFC PATCH 1/8 exchange the blocks between two inodes
ext4: online defrag-- Exchange the blocks between two inodes
From: Akira Fujita <[email protected]>
Exchange the data blocks between the temporary inode and the original inode.
Signed-off-by Akira Fujita <[email protected]>
Signed-off-by Takashi Sato <[email protected]>
--- fs/ext4/Makefile | 2 +- fs/ext4/defrag.c | 272 ++++++++++++++++++++++++++++++++++++++++++++++++ fs/ext4/ext4_extents.h | 2 + fs/ext4/extents.c | 2 +- 4 files changed, 276 insertions(+), 2 deletions(-)
fs/ext4/Makefile +1 -1
@@ -6,7 +6,7 @@ obj-$(CONFIG_EXT4DEV_FS) += ext4dev.o ext4dev-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \ ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \ - ext4_jbd2.o migrate.o mballoc.o + ext4_jbd2.o migrate.o mballoc.o defrag.o ext4dev-$(CONFIG_EXT4DEV_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o ext4dev-$(CONFIG_EXT4DEV_FS_POSIX_ACL) += acl.o
fs/ext4/defrag.c +272 -0
272 lines not on this page · raw message
fs/ext4/ext4_extents.h +2 -0
@@ -228,5 +228,7 @@ extern int ext4_ext_search_left(struct inode *, struct ext4_ext_path *,extern int ext4_ext_search_right (struct inode *,struct ext4_ext_path *,ext4_lblk_t *,ext4_fsblk_t *);extern void ext4_ext_drop_refs (struct ext4_ext_path *); +extern ext4_fsblk_t ext_pblock (struct ext4_extent *ex); +extern void ext4_ext_drop_refs (struct ext4_ext_path *path);#endif /* _EXT4_EXTENTS */
fs/ext4/extents.c +1 -1
@@ -48,7 +48,7 @@* ext_pblock: * combine low and high parts of physical block number into ext4_fsblk_t */ -static ext4_fsblk_t ext_pblock (struct ext4_extent *ex) +ext4_fsblk_t ext_pblock (struct ext4_extent *ex) {ext4_fsblk_t block;