Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174390
b: refs/heads/master
c: 446aaa6
h: refs/heads/master
v: v3
  • Loading branch information
Kazuya Mio authored and Theodore Ts'o committed Nov 24, 2009
1 parent fd51c23 commit c64553f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94d7c16cbbbd0e03841fcf272bcaf0620ad39618
refs/heads/master: 446aaa6e7e993b38a6f21c6acfa68f3f1af3dbe3
1 change: 1 addition & 0 deletions trunk/fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
}
}

me.moved_len = 0;
err = ext4_move_extents(filp, donor_filp, me.orig_start,
me.donor_start, me.len, &me.moved_len);
fput(donor_filp);
Expand Down
14 changes: 3 additions & 11 deletions trunk/fs/ext4/move_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,16 +947,15 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
* @orig_start: logical start offset in block for orig
* @donor_start: logical start offset in block for donor
* @len: the number of blocks to be moved
* @moved_len: moved block length
*
* Check the arguments of ext4_move_extents() whether the files can be
* exchanged with each other.
* Return 0 on success, or a negative error value on failure.
*/
static int
mext_check_arguments(struct inode *orig_inode,
struct inode *donor_inode, __u64 orig_start,
__u64 donor_start, __u64 *len, __u64 moved_len)
struct inode *donor_inode, __u64 orig_start,
__u64 donor_start, __u64 *len)
{
ext4_lblk_t orig_blocks, donor_blocks;
unsigned int blkbits = orig_inode->i_blkbits;
Expand Down Expand Up @@ -1010,13 +1009,6 @@ mext_check_arguments(struct inode *orig_inode,
return -EINVAL;
}

if (moved_len) {
ext4_debug("ext4 move extent: moved_len should be 0 "
"[ino:orig %lu, donor %lu]\n", orig_inode->i_ino,
donor_inode->i_ino);
return -EINVAL;
}

if ((orig_start > EXT_MAX_BLOCK) ||
(donor_start > EXT_MAX_BLOCK) ||
(*len > EXT_MAX_BLOCK) ||
Expand Down Expand Up @@ -1226,7 +1218,7 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp,
double_down_write_data_sem(orig_inode, donor_inode);
/* Check the filesystem environment whether move_extent can be done */
ret1 = mext_check_arguments(orig_inode, donor_inode, orig_start,
donor_start, &len, *moved_len);
donor_start, &len);
if (ret1)
goto out;

Expand Down

0 comments on commit c64553f

Please sign in to comment.