Skip to content

Commit e320050

Browse files
author
Andreas Gruenbacher
committed
gfs2: No more gfs2_find_jhead caching
We are no longer calling gfs2_find_jhead() on the same log twice, so there is no more reason for keeping the log contents cached across those calls. In addition, log head lookup and log header writing didn't go through the same address space and so the caching wasn't even fully working, anyway. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 93bd5ed commit e320050

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

fs/gfs2/glops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static int freeze_go_xmote_bh(struct gfs2_glock *gl)
601601
if (test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
602602
j_gl->gl_ops->go_inval(j_gl, DIO_METADATA);
603603

604-
error = gfs2_find_jhead(sdp->sd_jdesc, &head, false);
604+
error = gfs2_find_jhead(sdp->sd_jdesc, &head);
605605
if (gfs2_assert_withdraw_delayed(sdp, !error))
606606
return error;
607607
if (gfs2_assert_withdraw_delayed(sdp, head.lh_flags &

fs/gfs2/lops.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,13 @@ static struct bio *gfs2_chain_bio(struct bio *prev, unsigned int nr_iovecs)
496496
* gfs2_find_jhead - find the head of a log
497497
* @jd: The journal descriptor
498498
* @head: The log descriptor for the head of the log is returned here
499-
* @keep_cache: If set inode pages will not be truncated
500499
*
501500
* Do a search of a journal by reading it in large chunks using bios and find
502501
* the valid log entry with the highest sequence number. (i.e. the log head)
503502
*
504503
* Returns: 0 on success, errno otherwise
505504
*/
506-
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head,
507-
bool keep_cache)
505+
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
508506
{
509507
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
510508
struct address_space *mapping = jd->jd_inode->i_mapping;
@@ -593,8 +591,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head,
593591
if (!ret)
594592
ret = filemap_check_wb_err(mapping, since);
595593

596-
if (!keep_cache)
597-
truncate_inode_pages(mapping, 0);
594+
truncate_inode_pages(mapping, 0);
598595

599596
return ret;
600597
}

fs/gfs2/lops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void gfs2_log_write(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
2020
void gfs2_log_submit_bio(struct bio **biop, blk_opf_t opf);
2121
void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
2222
int gfs2_find_jhead(struct gfs2_jdesc *jd,
23-
struct gfs2_log_header_host *head, bool keep_cache);
23+
struct gfs2_log_header_host *head);
2424
void gfs2_drain_revokes(struct gfs2_sbd *sdp);
2525

2626
static inline unsigned int buf_limit(struct gfs2_sbd *sdp)

fs/gfs2/recovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void gfs2_recover_func(struct work_struct *work)
454454
if (error)
455455
goto fail_gunlock_ji;
456456

457-
error = gfs2_find_jhead(jd, &head, true);
457+
error = gfs2_find_jhead(jd, &head);
458458
if (error)
459459
goto fail_gunlock_ji;
460460
t_jhd = ktime_get();

fs/gfs2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
360360
error = gfs2_jdesc_check(jd);
361361
if (error)
362362
break;
363-
error = gfs2_find_jhead(jd, &lh, false);
363+
error = gfs2_find_jhead(jd, &lh);
364364
if (error)
365365
break;
366366
if (!(lh.lh_flags & GFS2_LOG_HEAD_UNMOUNT)) {

fs/gfs2/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
7373
"mount.\n");
7474
goto out_unlock;
7575
}
76-
error = gfs2_find_jhead(jd, &head, false);
76+
error = gfs2_find_jhead(jd, &head);
7777
if (error) {
7878
if (verbose)
7979
fs_err(sdp, "Error parsing journal for spectator "

0 commit comments

Comments
 (0)