summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-07-15 09:38:51 +0800
committerJan Kara <jack@suse.cz>2014-07-15 22:40:24 +0200
commit3f1be4f9c9dc926c1b96f14f88e91b8b0d1f88fd (patch)
tree7d0d45c7d2c57c34baa689d78a4534ce5c14213a /fs/udf
parentc7ff48212d3ede34aa41842929a5b3ebf8f5ca4d (diff)
downloadlinux-3f1be4f9c9dc926c1b96f14f88e91b8b0d1f88fd.tar.gz
linux-3f1be4f9c9dc926c1b96f14f88e91b8b0d1f88fd.tar.bz2
linux-3f1be4f9c9dc926c1b96f14f88e91b8b0d1f88fd.zip
udf: avoid redundant memcpy when writing data in ICB
Valid data within i_size in page cache will be copied to ICB cache when we writeback the page by invoking udf_adinicb_writepage, so the copy in udf_adinicb_write_end is redundant. After we remove the copy, it's better to use simple_write_end directly in udf_adinicb_aops instead of udf_adinicb_write_end. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/file.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 72b8dae9996f..86c6743ec1fe 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -100,24 +100,6 @@ static int udf_adinicb_write_begin(struct file *file,
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 = mapping->host;
- unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
- char *kaddr;
- struct udf_inode_info *iinfo = UDF_I(inode);
-
- kaddr = kmap_atomic(page);
- memcpy(iinfo->i_ext.i_data + iinfo->i_lenEAttr + offset,
- kaddr + offset, copied);
- kunmap_atomic(kaddr);
-
- return simple_write_end(file, mapping, pos, len, copied, page, fsdata);
-}
-
static ssize_t udf_adinicb_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter,
loff_t offset)
@@ -130,7 +112,7 @@ const struct address_space_operations udf_adinicb_aops = {
.readpage = udf_adinicb_readpage,
.writepage = udf_adinicb_writepage,
.write_begin = udf_adinicb_write_begin,
- .write_end = udf_adinicb_write_end,
+ .write_end = simple_write_end,
.direct_IO = udf_adinicb_direct_IO,
};