You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Theodore Ts'o
parent
25ec56b518
commit
c14c6fd5c5
+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
|
||||
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
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -254,6 +254,9 @@ flags_err:
|
||||
return err;
|
||||
}
|
||||
|
||||
case EXT4_IOC_MIGRATE:
|
||||
return ext4_ext_migrate(inode, filp, cmd, arg);
|
||||
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -243,6 +243,7 @@ struct ext4_new_group_data {
|
||||
#endif
|
||||
#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
|
||||
#define EXT4_IOC_SETRSVSZ _IOW('f', 6, long)
|
||||
#define EXT4_IOC_MIGRATE _IO('f', 7)
|
||||
|
||||
/*
|
||||
* ioctl commands in 32 bit emulation
|
||||
@@ -983,6 +984,9 @@ extern int ext4_ioctl (struct inode *, struct file *, unsigned int,
|
||||
unsigned long);
|
||||
extern long ext4_compat_ioctl (struct file *, unsigned int, unsigned long);
|
||||
|
||||
/* migrate.c */
|
||||
extern int ext4_ext_migrate(struct inode *, struct file *, unsigned int,
|
||||
unsigned long);
|
||||
/* namei.c */
|
||||
extern int ext4_orphan_add(handle_t *, struct inode *);
|
||||
extern int ext4_orphan_del(handle_t *, struct inode *);
|
||||
|
||||
@@ -212,6 +212,8 @@ static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
|
||||
(le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
|
||||
}
|
||||
|
||||
extern ext4_fsblk_t idx_pblock(struct ext4_extent_idx *);
|
||||
extern void ext4_ext_store_pblock(struct ext4_extent *, ext4_fsblk_t);
|
||||
extern int ext4_extent_tree_init(handle_t *, struct inode *);
|
||||
extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
|
||||
extern int ext4_ext_try_to_merge(struct inode *inode,
|
||||
|
||||
Reference in New Issue
Block a user