Skip to contentSkip to conversation

exchange the blocks between two inodes

RFC PATCH In review Akira Fujita 1 participant 1 message Apr 4, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 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
index ac6fa8c..8028102 100644
@@ -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
index 75333b5..9868c02 100644
@@ -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
index 30f0f99..1293b47 100644
@@ -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;