提交 22db9af2 编写于 作者: B Brian Foster 提交者: Dave Chinner

xfs: pass current lsn to log recovery buffer validation

The current LSN must be available to the buffer validation function to
provide the ability to update the metadata LSN of the buffer. Pass the
current_lsn value down to xlog_recover_validate_buf_type() in
preparation.
Signed-off-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 12818d24
...@@ -2360,7 +2360,8 @@ static void ...@@ -2360,7 +2360,8 @@ static void
xlog_recover_validate_buf_type( xlog_recover_validate_buf_type(
struct xfs_mount *mp, struct xfs_mount *mp,
struct xfs_buf *bp, struct xfs_buf *bp,
xfs_buf_log_format_t *buf_f) xfs_buf_log_format_t *buf_f,
xfs_lsn_t current_lsn)
{ {
struct xfs_da_blkinfo *info = bp->b_addr; struct xfs_da_blkinfo *info = bp->b_addr;
__uint32_t magic32; __uint32_t magic32;
...@@ -2569,7 +2570,8 @@ xlog_recover_do_reg_buffer( ...@@ -2569,7 +2570,8 @@ xlog_recover_do_reg_buffer(
struct xfs_mount *mp, struct xfs_mount *mp,
xlog_recover_item_t *item, xlog_recover_item_t *item,
struct xfs_buf *bp, struct xfs_buf *bp,
xfs_buf_log_format_t *buf_f) xfs_buf_log_format_t *buf_f,
xfs_lsn_t current_lsn)
{ {
int i; int i;
int bit; int bit;
...@@ -2642,7 +2644,7 @@ xlog_recover_do_reg_buffer( ...@@ -2642,7 +2644,7 @@ xlog_recover_do_reg_buffer(
/* Shouldn't be any more regions */ /* Shouldn't be any more regions */
ASSERT(i == item->ri_total); ASSERT(i == item->ri_total);
xlog_recover_validate_buf_type(mp, bp, buf_f); xlog_recover_validate_buf_type(mp, bp, buf_f, current_lsn);
} }
/* /*
...@@ -2685,7 +2687,7 @@ xlog_recover_do_dquot_buffer( ...@@ -2685,7 +2687,7 @@ xlog_recover_do_dquot_buffer(
if (log->l_quotaoffs_flag & type) if (log->l_quotaoffs_flag & type)
return false; return false;
xlog_recover_do_reg_buffer(mp, item, bp, buf_f); xlog_recover_do_reg_buffer(mp, item, bp, buf_f, NULLCOMMITLSN);
return true; return true;
} }
...@@ -2773,7 +2775,7 @@ xlog_recover_buffer_pass2( ...@@ -2773,7 +2775,7 @@ xlog_recover_buffer_pass2(
*/ */
lsn = xlog_recover_get_buf_lsn(mp, bp); lsn = xlog_recover_get_buf_lsn(mp, bp);
if (lsn && lsn != -1 && XFS_LSN_CMP(lsn, current_lsn) >= 0) { if (lsn && lsn != -1 && XFS_LSN_CMP(lsn, current_lsn) >= 0) {
xlog_recover_validate_buf_type(mp, bp, buf_f); xlog_recover_validate_buf_type(mp, bp, buf_f, NULLCOMMITLSN);
goto out_release; goto out_release;
} }
...@@ -2789,7 +2791,7 @@ xlog_recover_buffer_pass2( ...@@ -2789,7 +2791,7 @@ xlog_recover_buffer_pass2(
if (!dirty) if (!dirty)
goto out_release; goto out_release;
} else { } else {
xlog_recover_do_reg_buffer(mp, item, bp, buf_f); xlog_recover_do_reg_buffer(mp, item, bp, buf_f, current_lsn);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册