Skip to content

Commit 82da495

Browse files
author
Andreas Gruenbacher
committed
gfs2: No more gfs2_find_jhead caching
JIRA: https://issues.redhat.com/browse/RHEL-91331 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git 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]> (cherry picked from commit 65347aa1b9a4b412cea2b1a910a86074a23caf57)
1 parent 704e3fa commit 82da495

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
@@ -593,7 +593,7 @@ static int freeze_go_xmote_bh(struct gfs2_glock *gl)
593593
if (test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
594594
j_gl->gl_ops->go_inval(j_gl, DIO_METADATA);
595595

596-
error = gfs2_find_jhead(sdp->sd_jdesc, &head, false);
596+
error = gfs2_find_jhead(sdp->sd_jdesc, &head);
597597
if (gfs2_assert_withdraw_delayed(sdp, !error))
598598
return error;
599599
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
@@ -500,15 +500,13 @@ static struct bio *gfs2_chain_bio(struct bio *prev, unsigned int nr_iovecs)
500500
* gfs2_find_jhead - find the head of a log
501501
* @jd: The journal descriptor
502502
* @head: The log descriptor for the head of the log is returned here
503-
* @keep_cache: If set inode pages will not be truncated
504503
*
505504
* Do a search of a journal by reading it in large chunks using bios and find
506505
* the valid log entry with the highest sequence number. (i.e. the log head)
507506
*
508507
* Returns: 0 on success, errno otherwise
509508
*/
510-
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head,
511-
bool keep_cache)
509+
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
512510
{
513511
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
514512
struct address_space *mapping = jd->jd_inode->i_mapping;
@@ -598,8 +596,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head,
598596
if (!ret)
599597
ret = filemap_check_wb_err(mapping, since);
600598

601-
if (!keep_cache)
602-
truncate_inode_pages(mapping, 0);
599+
truncate_inode_pages(mapping, 0);
603600

604601
return ret;
605602
}

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
@@ -453,7 +453,7 @@ void gfs2_recover_func(struct work_struct *work)
453453
if (error)
454454
goto fail_gunlock_ji;
455455

456-
error = gfs2_find_jhead(jd, &head, true);
456+
error = gfs2_find_jhead(jd, &head);
457457
if (error)
458458
goto fail_gunlock_ji;
459459
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
@@ -72,7 +72,7 @@ int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
7272
"mount.\n");
7373
goto out_unlock;
7474
}
75-
error = gfs2_find_jhead(jd, &head, false);
75+
error = gfs2_find_jhead(jd, &head);
7676
if (error) {
7777
if (verbose)
7878
fs_err(sdp, "Error parsing journal for spectator "

0 commit comments

Comments
 (0)