Skip to content

Commit c14c6fd

Browse files
kvaneeshtytso
authored andcommitted
ext4: Add EXT4_IOC_MIGRATE ioctl
The below patch add ioctl for migrating ext3 indirect block mapped inode to ext4 extent mapped inode. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
1 parent 25ec56b commit c14c6fd

6 files changed

Lines changed: 572 additions & 3 deletions

File tree

‎fs/ext4/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ obj-$(CONFIG_EXT4DEV_FS) += ext4dev.o
66

77
ext4dev-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
88
ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \
9-
ext4_jbd2.o
9+
ext4_jbd2.o migrate.o
1010

1111
ext4dev-$(CONFIG_EXT4DEV_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
1212
ext4dev-$(CONFIG_EXT4DEV_FS_POSIX_ACL) += acl.o

‎fs/ext4/extents.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static ext4_fsblk_t ext_pblock(struct ext4_extent *ex)
6161
* idx_pblock:
6262
* combine low and high parts of a leaf physical block number into ext4_fsblk_t
6363
*/
64-
static ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
64+
ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
6565
{
6666
ext4_fsblk_t block;
6767

@@ -75,7 +75,7 @@ static ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
7575
* stores a large physical block number into an extent struct,
7676
* breaking it into parts
7777
*/
78-
static void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
78+
void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
7979
{
8080
ex->ee_start_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
8181
ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff);

‎fs/ext4/ioctl.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
254254
return err;
255255
}
256256

257+
case EXT4_IOC_MIGRATE:
258+
return ext4_ext_migrate(inode, filp, cmd, arg);
259+
257260
default:
258261
return -ENOTTY;
259262
}

0 commit comments

Comments
 (0)