Commit dc22af64 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Chandan Babu R

xfs: pass the defer ops instead of type to xfs_defer_start_recovery

xfs_defer_start_recovery is only called from xlog_recover_intent_item,
and the callers of that all have the actual xfs_defer_ops_type operation
vector at hand.  Pass that directly instead of looking it up from the
defer_op_types table.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
parent 7f2f7531
...@@ -894,14 +894,14 @@ xfs_defer_add_barrier( ...@@ -894,14 +894,14 @@ xfs_defer_add_barrier(
void void
xfs_defer_start_recovery( xfs_defer_start_recovery(
struct xfs_log_item *lip, struct xfs_log_item *lip,
enum xfs_defer_ops_type dfp_type, struct list_head *r_dfops,
struct list_head *r_dfops) const struct xfs_defer_op_type *ops)
{ {
struct xfs_defer_pending *dfp; struct xfs_defer_pending *dfp;
dfp = kmem_cache_zalloc(xfs_defer_pending_cache, dfp = kmem_cache_zalloc(xfs_defer_pending_cache,
GFP_NOFS | __GFP_NOFAIL); GFP_NOFS | __GFP_NOFAIL);
dfp->dfp_ops = defer_op_types[dfp_type]; dfp->dfp_ops = ops;
dfp->dfp_intent = lip; dfp->dfp_intent = lip;
INIT_LIST_HEAD(&dfp->dfp_work); INIT_LIST_HEAD(&dfp->dfp_work);
list_add_tail(&dfp->dfp_list, r_dfops); list_add_tail(&dfp->dfp_list, r_dfops);
......
...@@ -147,7 +147,7 @@ void xfs_defer_ops_capture_abort(struct xfs_mount *mp, ...@@ -147,7 +147,7 @@ void xfs_defer_ops_capture_abort(struct xfs_mount *mp,
void xfs_defer_resources_rele(struct xfs_defer_resources *dres); void xfs_defer_resources_rele(struct xfs_defer_resources *dres);
void xfs_defer_start_recovery(struct xfs_log_item *lip, void xfs_defer_start_recovery(struct xfs_log_item *lip,
enum xfs_defer_ops_type dfp_type, struct list_head *r_dfops); struct list_head *r_dfops, const struct xfs_defer_op_type *ops);
void xfs_defer_cancel_recovery(struct xfs_mount *mp, void xfs_defer_cancel_recovery(struct xfs_mount *mp,
struct xfs_defer_pending *dfp); struct xfs_defer_pending *dfp);
int xfs_defer_finish_recovery(struct xfs_mount *mp, int xfs_defer_finish_recovery(struct xfs_mount *mp,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* define how recovery should work for that type of log item. * define how recovery should work for that type of log item.
*/ */
struct xlog_recover_item; struct xlog_recover_item;
struct xfs_defer_op_type;
/* Sorting hat for log items as they're read in. */ /* Sorting hat for log items as they're read in. */
enum xlog_recover_reorder { enum xlog_recover_reorder {
...@@ -156,7 +157,7 @@ xlog_recover_resv(const struct xfs_trans_res *r) ...@@ -156,7 +157,7 @@ xlog_recover_resv(const struct xfs_trans_res *r)
struct xfs_defer_pending; struct xfs_defer_pending;
void xlog_recover_intent_item(struct xlog *log, struct xfs_log_item *lip, void xlog_recover_intent_item(struct xlog *log, struct xfs_log_item *lip,
xfs_lsn_t lsn, unsigned int dfp_type); xfs_lsn_t lsn, const struct xfs_defer_op_type *ops);
int xlog_recover_finish_intent(struct xfs_trans *tp, int xlog_recover_finish_intent(struct xfs_trans *tp,
struct xfs_defer_pending *dfp); struct xfs_defer_pending *dfp);
......
...@@ -759,7 +759,7 @@ xlog_recover_attri_commit_pass2( ...@@ -759,7 +759,7 @@ xlog_recover_attri_commit_pass2(
memcpy(&attrip->attri_format, attri_formatp, len); memcpy(&attrip->attri_format, attri_formatp, len);
xlog_recover_intent_item(log, &attrip->attri_item, lsn, xlog_recover_intent_item(log, &attrip->attri_item, lsn,
XFS_DEFER_OPS_TYPE_ATTR); &xfs_attr_defer_type);
xfs_attri_log_nameval_put(nv); xfs_attri_log_nameval_put(nv);
return 0; return 0;
} }
......
...@@ -650,7 +650,7 @@ xlog_recover_bui_commit_pass2( ...@@ -650,7 +650,7 @@ xlog_recover_bui_commit_pass2(
atomic_set(&buip->bui_next_extent, bui_formatp->bui_nextents); atomic_set(&buip->bui_next_extent, bui_formatp->bui_nextents);
xlog_recover_intent_item(log, &buip->bui_item, lsn, xlog_recover_intent_item(log, &buip->bui_item, lsn,
XFS_DEFER_OPS_TYPE_BMAP); &xfs_bmap_update_defer_type);
return 0; return 0;
} }
......
...@@ -747,7 +747,7 @@ xlog_recover_efi_commit_pass2( ...@@ -747,7 +747,7 @@ xlog_recover_efi_commit_pass2(
atomic_set(&efip->efi_next_extent, efi_formatp->efi_nextents); atomic_set(&efip->efi_next_extent, efi_formatp->efi_nextents);
xlog_recover_intent_item(log, &efip->efi_item, lsn, xlog_recover_intent_item(log, &efip->efi_item, lsn,
XFS_DEFER_OPS_TYPE_FREE); &xfs_extent_free_defer_type);
return 0; return 0;
} }
......
...@@ -1942,11 +1942,11 @@ xlog_recover_intent_item( ...@@ -1942,11 +1942,11 @@ xlog_recover_intent_item(
struct xlog *log, struct xlog *log,
struct xfs_log_item *lip, struct xfs_log_item *lip,
xfs_lsn_t lsn, xfs_lsn_t lsn,
unsigned int dfp_type) const struct xfs_defer_op_type *ops)
{ {
ASSERT(xlog_item_is_intent(lip)); ASSERT(xlog_item_is_intent(lip));
xfs_defer_start_recovery(lip, dfp_type, &log->r_dfops); xfs_defer_start_recovery(lip, &log->r_dfops, ops);
/* /*
* Insert the intent into the AIL directly and drop one reference so * Insert the intent into the AIL directly and drop one reference so
......
...@@ -605,7 +605,7 @@ xlog_recover_cui_commit_pass2( ...@@ -605,7 +605,7 @@ xlog_recover_cui_commit_pass2(
atomic_set(&cuip->cui_next_extent, cui_formatp->cui_nextents); atomic_set(&cuip->cui_next_extent, cui_formatp->cui_nextents);
xlog_recover_intent_item(log, &cuip->cui_item, lsn, xlog_recover_intent_item(log, &cuip->cui_item, lsn,
XFS_DEFER_OPS_TYPE_REFCOUNT); &xfs_refcount_update_defer_type);
return 0; return 0;
} }
......
...@@ -658,7 +658,7 @@ xlog_recover_rui_commit_pass2( ...@@ -658,7 +658,7 @@ xlog_recover_rui_commit_pass2(
atomic_set(&ruip->rui_next_extent, rui_formatp->rui_nextents); atomic_set(&ruip->rui_next_extent, rui_formatp->rui_nextents);
xlog_recover_intent_item(log, &ruip->rui_item, lsn, xlog_recover_intent_item(log, &ruip->rui_item, lsn,
XFS_DEFER_OPS_TYPE_RMAP); &xfs_rmap_update_defer_type);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment