Clean up ordered write code
Hi,
The following patch removes the ordered write processing from databuf_lo_before_commit() and moves it to log.c. This has the effect of greatly simplyfying databuf_lo_before_commit() and well as potentially making the ordered write code more efficient.
As a side effect of this, its now possible to remove ordered buffers from the ordered buffer list at any time, so we now make use of this in invalidatepage and releasepage to ensure timely release of these buffers.
Steve.
fs/gfs2/incore.h +1 -1
@@ -612,13 +612,13 @@ struct gfs2_sbd {unsigned int sd_log_num_revoke;unsigned int sd_log_num_rg;unsigned int sd_log_num_databuf; -unsigned int sd_log_num_jdata;struct list_head sd_log_le_gl;struct list_head sd_log_le_buf;struct list_head sd_log_le_revoke;struct list_head sd_log_le_rg;struct list_head sd_log_le_databuf; +struct list_head sd_log_le_ordered;unsigned int sd_log_blks_free;struct mutex sd_log_reserve_mutex;
fs/gfs2/log.c +61 -2
88 lines not on this page · raw message
fs/gfs2/log.h +1 -0
@@ -59,6 +59,7 @@ struct buffer_head *gfs2_log_fake_buf(struct gfs2_sbd *sdp,void gfs2_log_flush (struct gfs2_sbd *sdp,struct gfs2_glock *gl);void gfs2_log_commit (struct gfs2_sbd *sdp,struct gfs2_trans *trans);void gfs2_remove_from_ail (struct address_space *mapping,struct gfs2_bufdata *bd); +void gfs2_remove_ordered_buffer (struct gfs2_bufdata *bd);void gfs2_log_shutdown (struct gfs2_sbd *sdp);void gfs2_meta_syncfs (struct gfs2_sbd *sdp);
fs/gfs2/lops.c +40 -120
209 lines not on this page · raw message
fs/gfs2/ops_address.c +44 -3
65 lines not on this page · raw message
fs/gfs2/ops_fstype.c +1 -0
@@ -82,6 +82,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)INIT_LIST_HEAD (&sdp->sd_log_le_revoke);INIT_LIST_HEAD (&sdp->sd_log_le_rg);INIT_LIST_HEAD (&sdp->sd_log_le_databuf); +INIT_LIST_HEAD (&sdp->sd_log_le_ordered);mutex_init (&sdp->sd_log_reserve_mutex);INIT_LIST_HEAD (&sdp->sd_ail1_list);