Skip to content

Commit

Permalink
ext4: Add EXT4_IOC_MIGRATE ioctl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aneesh Kumar K.V authored and Theodore Ts'o committed Jan 29, 2008
1 parent 25ec56b commit c14c6fd
Show file tree
Hide file tree
Showing 6 changed files with 572 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/ext4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
ext4_jbd2.o migrate.o

ext4dev-$(CONFIG_EXT4DEV_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
ext4dev-$(CONFIG_EXT4DEV_FS_POSIX_ACL) += acl.o
Expand Down
4 changes: 2 additions & 2 deletions fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static ext4_fsblk_t ext_pblock(struct ext4_extent *ex)
* idx_pblock:
* combine low and high parts of a leaf physical block number into ext4_fsblk_t
*/
static ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
{
ext4_fsblk_t block;

Expand All @@ -75,7 +75,7 @@ static ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
* stores a large physical block number into an extent struct,
* breaking it into parts
*/
static void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
{
ex->ee_start_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff);
Expand Down
3 changes: 3 additions & 0 deletions fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
return err;
}

case EXT4_IOC_MIGRATE:
return ext4_ext_migrate(inode, filp, cmd, arg);

default:
return -ENOTTY;
}
Expand Down
Loading

0 comments on commit c14c6fd

Please sign in to comment.