aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-08-16 18:42:34 -0400
committerDave Chinner <david@fromorbit.com>2016-08-16 18:42:34 -0400
commitf20ac7ab17fcf7046bd9bc4166faf9580f713afd (patch)
tree0a68e726fcd62b260a1ae12ec783d02584e04d1f
parentac2dc058bce81b83631ad5accb90b8f4abe613b7 (diff)
iomap: mark ->iomap_end as optional
No need to implement it for read-only mappings. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/iomap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/iomap.c b/fs/iomap.c
index d9d1f50c36aa..0342254646e3 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -84,8 +84,11 @@ iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags,
84 * Now the data has been copied, commit the range we've copied. This 84 * Now the data has been copied, commit the range we've copied. This
85 * should not fail unless the filesystem has had a fatal error. 85 * should not fail unless the filesystem has had a fatal error.
86 */ 86 */
87 ret = ops->iomap_end(inode, pos, length, written > 0 ? written : 0, 87 if (ops->iomap_end) {
88 flags, &iomap); 88 ret = ops->iomap_end(inode, pos, length,
89 written > 0 ? written : 0,
90 flags, &iomap);
91 }
89 92
90 return written ? written : ret; 93 return written ? written : ret;
91} 94}