diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-06-04 07:50:16 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-06-04 07:50:16 -0500 |
commit | 845802b112eeedfa32b2ebba694996a49677596e (patch) | |
tree | e0f4d8f2ad943c67d9e050845cc8c198018f765d /fs/gfs2/aops.c | |
parent | d6382a3505d289ec2df55a822f1fd72d9a72d256 (diff) | |
download | linux-845802b112eeedfa32b2ebba694996a49677596e.tar.bz2 |
gfs2: Remove ordered write mode handling from gfs2_trans_add_data
In journaled data mode, we need to add each buffer head to the current
transaction. In ordered write mode, we only need to add the inode to
the ordered inode list. So far, both cases are handled in
gfs2_trans_add_data. This makes the code look misleading and is
inefficient for small block sizes as well. Handle both cases separately
instead.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/aops.c')
-rw-r--r-- | fs/gfs2/aops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 69f25e3c97ce..35f5ee23566d 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -54,8 +54,7 @@ static void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page, continue; if (start >= to) break; - if (gfs2_is_jdata(ip)) - set_buffer_uptodate(bh); + set_buffer_uptodate(bh); gfs2_trans_add_data(ip->i_gl, bh); } } @@ -894,8 +893,10 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, goto out2; } - if (!gfs2_is_writeback(ip)) + if (gfs2_is_jdata(ip)) gfs2_page_add_databufs(ip, page, pos & ~PAGE_MASK, len); + else + gfs2_ordered_add_inode(ip); ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); page = NULL; |