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>
此提交包含在:
Andreas Gruenbacher
2018-06-04 07:50:16 -05:00
提交者 Bob Peterson
父節點 d6382a3505
當前提交 845802b112
共有 5 個檔案被更改,包括 30 行新增28 行删除

查看文件

@@ -735,7 +735,10 @@ static int gfs2_write_buf_to_page(struct gfs2_inode *ip, unsigned long index,
if (!buffer_uptodate(bh))
goto unlock_out;
}
gfs2_trans_add_data(ip->i_gl, bh);
if (gfs2_is_jdata(ip))
gfs2_trans_add_data(ip->i_gl, bh);
else
gfs2_ordered_add_inode(ip);
/* If we need to write to the next block as well */
if (to_write > (bsize - boff)) {