summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2019-06-28 02:28:40 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2019-06-28 02:28:40 +0200
commit8d3e72a180b42c01ec00045e1bb8eb91175adafe (patch)
tree28ceebc6e241391ac9a4f1a44e9da6122d02ba37 /fs/gfs2/bmap.c
parentLinux 5.2-rc4 (diff)
downloadlinux-8d3e72a180b42c01ec00045e1bb8eb91175adafe.tar.xz
linux-8d3e72a180b42c01ec00045e1bb8eb91175adafe.zip
iomap: don't mark the inode dirty in iomap_write_end
Marking the inode dirty for each page copied into the page cache can be very inefficient for file systems that use the VFS dirty inode tracking, and is completely pointless for those that don't use the VFS dirty inode tracking. So instead, only set an iomap flag when changing the in-core inode size, and open code the rest of __generic_write_end. Partially based on code from Christoph Hellwig. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index c78ccaf83ef8..8e8768685264 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1179,6 +1179,8 @@ static int gfs2_iomap_end(struct inode *inode, loff_t pos, loff_t length,
if (ip->i_qadata && ip->i_qadata->qa_qd_num)
gfs2_quota_unlock(ip);
+ if (iomap->flags & IOMAP_F_SIZE_CHANGED)
+ mark_inode_dirty(inode);
gfs2_write_unlock(inode);
out: