diff options
-rw-r--r-- | fs/btrfs/file.c | 1 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 15 |
2 files changed, 14 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index a280b9562221..62fcd79d8ab3 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -861,6 +861,7 @@ struct file_operations btrfs_file_operations = { | |||
861 | .llseek = generic_file_llseek, | 861 | .llseek = generic_file_llseek, |
862 | .read = do_sync_read, | 862 | .read = do_sync_read, |
863 | .aio_read = generic_file_aio_read, | 863 | .aio_read = generic_file_aio_read, |
864 | .splice_read = generic_file_splice_read, | ||
864 | .write = btrfs_file_write, | 865 | .write = btrfs_file_write, |
865 | .mmap = btrfs_file_mmap, | 866 | .mmap = btrfs_file_mmap, |
866 | .open = generic_file_open, | 867 | .open = generic_file_open, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 41b0c7de7a59..e535c50e669b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1893,8 +1893,19 @@ static void btrfs_truncate(struct inode *inode) | |||
1893 | int btrfs_commit_write(struct file *file, struct page *page, | 1893 | int btrfs_commit_write(struct file *file, struct page *page, |
1894 | unsigned from, unsigned to) | 1894 | unsigned from, unsigned to) |
1895 | { | 1895 | { |
1896 | return extent_commit_write(&BTRFS_I(page->mapping->host)->extent_tree, | 1896 | loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to; |
1897 | page->mapping->host, page, from, to); | 1897 | struct inode *inode = page->mapping->host; |
1898 | |||
1899 | btrfs_cow_one_page(inode, page, PAGE_CACHE_SIZE); | ||
1900 | |||
1901 | set_page_extent_mapped(page); | ||
1902 | set_page_dirty(page); | ||
1903 | |||
1904 | if (pos > inode->i_size) { | ||
1905 | i_size_write(inode, pos); | ||
1906 | mark_inode_dirty(inode); | ||
1907 | } | ||
1908 | return 0; | ||
1898 | } | 1909 | } |
1899 | 1910 | ||
1900 | static int create_subvol(struct btrfs_root *root, char *name, int namelen) | 1911 | static int create_subvol(struct btrfs_root *root, char *name, int namelen) |