diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-06-28 03:07:03 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-07-02 19:41:16 +0200 |
commit | c8a894d77de4a1e0a544577fd4eabc9aacd453a8 (patch) | |
tree | 536f2a4d775f3b4180a85d4192bae92fbd38347b /fs/btrfs/ioctl.c | |
parent | Btrfs: don't log the inode in file_write while growing the file (diff) | |
download | linux-c8a894d77de4a1e0a544577fd4eabc9aacd453a8.tar.xz linux-c8a894d77de4a1e0a544577fd4eabc9aacd453a8.zip |
Btrfs: fix the file clone ioctl for preallocated extents
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index eff18f5b5362..9f4db848db10 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1028,7 +1028,8 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, struct btrfs_file_extent_item); comp = btrfs_file_extent_compression(leaf, extent); type = btrfs_file_extent_type(leaf, extent); - if (type == BTRFS_FILE_EXTENT_REG) { + if (type == BTRFS_FILE_EXTENT_REG || + type == BTRFS_FILE_EXTENT_PREALLOC) { disko = btrfs_file_extent_disk_bytenr(leaf, extent); diskl = btrfs_file_extent_disk_num_bytes(leaf, @@ -1051,7 +1052,8 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, new_key.objectid = inode->i_ino; new_key.offset = key.offset + destoff - off; - if (type == BTRFS_FILE_EXTENT_REG) { + if (type == BTRFS_FILE_EXTENT_REG || + type == BTRFS_FILE_EXTENT_PREALLOC) { ret = btrfs_insert_empty_item(trans, root, path, &new_key, size); if (ret) |