return NULL;
}
-/* Take an active ref to the AG containing the space we're refcounting. */
+/* Add this deferred CUI to the transaction. */
void
-xfs_refcount_update_get_group(
- struct xfs_mount *mp,
+xfs_refcount_defer_add(
+ struct xfs_trans *tp,
struct xfs_refcount_intent *ri)
{
- ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_startblock);
-}
+ struct xfs_mount *mp = tp->t_mountp;
-/* Release an active AG ref after finishing refcounting work. */
-static inline void
-xfs_refcount_update_put_group(
- struct xfs_refcount_intent *ri)
-{
- xfs_perag_intent_put(ri->ri_pag);
+ trace_xfs_refcount_defer(mp, ri);
+
+ ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_startblock);
+ xfs_defer_add(tp, &ri->ri_list, &xfs_refcount_update_defer_type);
}
/* Cancel a deferred refcount update. */
{
struct xfs_refcount_intent *ri = ci_entry(item);
- xfs_refcount_update_put_group(ri);
+ xfs_perag_intent_put(ri->ri_pag);
kmem_cache_free(xfs_refcount_intent_cache, ri);
}
void xfs_rmap_defer_add(struct xfs_trans *tp, struct xfs_rmap_intent *ri);
+struct xfs_refcount_intent;
+
+void xfs_refcount_defer_add(struct xfs_trans *tp,
+ struct xfs_refcount_intent *ri);
+
#endif /* __LIBXFS_DEFER_ITEM_H_ */
#include "xfs_rmap.h"
#include "xfs_ag.h"
#include "xfs_health.h"
+#include "defer_item.h"
struct kmem_cache *xfs_refcount_intent_cache;
ri->ri_startblock = startblock;
ri->ri_blockcount = blockcount;
- trace_xfs_refcount_defer(tp->t_mountp, ri);
-
- xfs_refcount_update_get_group(tp->t_mountp, ri);
- xfs_defer_add(tp, &ri->ri_list, &xfs_refcount_update_defer_type);
+ xfs_refcount_defer_add(tp, ri);
}
/*
return true;
}
-void xfs_refcount_update_get_group(struct xfs_mount *mp,
- struct xfs_refcount_intent *ri);
-
void xfs_refcount_increase_extent(struct xfs_trans *tp,
struct xfs_bmbt_irec *irec);
void xfs_refcount_decrease_extent(struct xfs_trans *tp,