summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2016-09-16 00:17:21 +0100
committerJan Kara <jack@suse.cz>2016-09-19 10:47:01 +0200
commit5d3ddd84eaefffd23c028bce5610dac8726f71c1 (patch)
treef99fb1a9aa178bf2d4af86651199244eff2ec981
parent420902c9d086848a7548c83e0a49021514bd71b7 (diff)
downloadlinux-stable-5d3ddd84eaefffd23c028bce5610dac8726f71c1.tar.gz
linux-stable-5d3ddd84eaefffd23c028bce5610dac8726f71c1.tar.bz2
linux-stable-5d3ddd84eaefffd23c028bce5610dac8726f71c1.zip
udf: don't bother with full-page write optimisations in adinicb case
... it would get converted to regular if such had been attempted Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/udf/file.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 254bc02d7e2c..e855bf8d74b4 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -105,11 +105,25 @@ static ssize_t udf_adinicb_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
return 0;
}
+static int udf_adinicb_write_end(struct file *file, struct address_space *mapping,
+ loff_t pos, unsigned len, unsigned copied,
+ struct page *page, void *fsdata)
+{
+ struct inode *inode = page->mapping->host;
+ loff_t last_pos = pos + copied;
+ if (last_pos > inode->i_size)
+ i_size_write(inode, last_pos);
+ set_page_dirty(page);
+ unlock_page(page);
+ put_page(page);
+ return copied;
+}
+
const struct address_space_operations udf_adinicb_aops = {
.readpage = udf_adinicb_readpage,
.writepage = udf_adinicb_writepage,
.write_begin = udf_adinicb_write_begin,
- .write_end = simple_write_end,
+ .write_end = udf_adinicb_write_end,
.direct_IO = udf_adinicb_direct_IO,
};