Skip to content

Commit 144a4c2

Browse files
committed
GFS2: Log code fixes
This patch removes a log lock from around atomic operation where it is not needed, removes an unused variable, and also changes a void pointer used incorrectly to a struct page pointer. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 4306629 commit 144a4c2

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

‎fs/gfs2/log.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,8 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
643643
if (sdp->sd_log_head != sdp->sd_log_flush_head) {
644644
log_write_header(sdp, 0);
645645
} else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle){
646-
gfs2_log_lock(sdp);
647646
atomic_dec(&sdp->sd_log_blks_free); /* Adjust for unreserved buffer */
648647
trace_gfs2_log_blocks(sdp, -1);
649-
gfs2_log_unlock(sdp);
650648
log_write_header(sdp, 0);
651649
}
652650
lops_after_commit(sdp, ai);
@@ -797,11 +795,9 @@ int gfs2_logd(void *data)
797795
struct gfs2_sbd *sdp = data;
798796
unsigned long t = 1;
799797
DEFINE_WAIT(wait);
800-
unsigned preflush;
801798

802799
while (!kthread_should_stop()) {
803800

804-
preflush = atomic_read(&sdp->sd_log_pinned);
805801
if (gfs2_jrnl_flush_reqd(sdp) || t == 0) {
806802
gfs2_ail1_empty(sdp);
807803
gfs2_log_flush(sdp, NULL);

‎fs/gfs2/lops.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void gfs2_log_write_page(struct gfs2_sbd *sdp, struct page *page)
375375
static struct page *gfs2_get_log_desc(struct gfs2_sbd *sdp, u32 ld_type,
376376
u32 ld_length, u32 ld_data1)
377377
{
378-
void *page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
378+
struct page *page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
379379
struct gfs2_log_descriptor *ld = page_address(page);
380380
clear_page(ld);
381381
ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);

0 commit comments

Comments
 (0)