diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-06-04 15:50:16 +0300 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-06-04 15:50:16 +0300 |
commit | 845802b112eeedfa32b2ebba694996a49677596e (patch) | |
tree | e0f4d8f2ad943c67d9e050845cc8c198018f765d /fs/gfs2/log.h | |
parent | d6382a3505d289ec2df55a822f1fd72d9a72d256 (diff) | |
download | linux-845802b112eeedfa32b2ebba694996a49677596e.tar.xz |
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/log.h')
-rw-r--r-- | fs/gfs2/log.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/log.h b/fs/gfs2/log.h index 1862e310a067..20241436126d 100644 --- a/fs/gfs2/log.h +++ b/fs/gfs2/log.h @@ -14,6 +14,7 @@ #include <linux/spinlock.h> #include <linux/writeback.h> #include "incore.h" +#include "inode.h" /** * gfs2_log_lock - acquire the right to mess with the log manager @@ -50,8 +51,12 @@ static inline void gfs2_log_pointers_init(struct gfs2_sbd *sdp, static inline void gfs2_ordered_add_inode(struct gfs2_inode *ip) { - struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); + struct gfs2_sbd *sdp; + if (!gfs2_is_ordered(ip)) + return; + + sdp = GFS2_SB(&ip->i_inode); if (!test_bit(GIF_ORDERED, &ip->i_flags)) { spin_lock(&sdp->sd_ordered_lock); if (!test_and_set_bit(GIF_ORDERED, &ip->i_flags)) |