return NULL;
}
-/* Take an active ref to the AG containing the space we're rmapping. */
+/* Add this deferred RUI to the transaction. */
void
-xfs_rmap_update_get_group(
- struct xfs_mount *mp,
+xfs_rmap_defer_add(
+ struct xfs_trans *tp,
struct xfs_rmap_intent *ri)
{
- ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_bmap.br_startblock);
-}
+ struct xfs_mount *mp = tp->t_mountp;
-/* Release an active AG ref after finishing rmapping work. */
-static inline void
-xfs_rmap_update_put_group(
- struct xfs_rmap_intent *ri)
-{
- xfs_perag_intent_put(ri->ri_pag);
+ trace_xfs_rmap_defer(mp, ri);
+
+ ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_bmap.br_startblock);
+ xfs_defer_add(tp, &ri->ri_list, &xfs_rmap_update_defer_type);
}
/* Cancel a deferred rmap update. */
{
struct xfs_rmap_intent *ri = ri_entry(item);
- xfs_rmap_update_put_group(ri);
+ xfs_perag_intent_put(ri->ri_pag);
kmem_cache_free(xfs_rmap_intent_cache, ri);
}
struct xfs_extent_free_item *xefi,
struct xfs_defer_pending **dfpp);
+struct xfs_rmap_intent;
+
+void xfs_rmap_defer_add(struct xfs_trans *tp, struct xfs_rmap_intent *ri);
+
#endif /* __LIBXFS_DEFER_ITEM_H_ */
#include "xfs_inode.h"
#include "xfs_ag.h"
#include "xfs_health.h"
+#include "defer_item.h"
struct kmem_cache *xfs_rmap_intent_cache;
ri->ri_whichfork = whichfork;
ri->ri_bmap = *bmap;
- trace_xfs_rmap_defer(tp->t_mountp, ri);
-
- xfs_rmap_update_get_group(tp->t_mountp, ri);
- xfs_defer_add(tp, &ri->ri_list, &xfs_rmap_update_defer_type);
+ xfs_rmap_defer_add(tp, ri);
}
/* Map an extent into a file. */
struct xfs_perag *ri_pag;
};
-void xfs_rmap_update_get_group(struct xfs_mount *mp,
- struct xfs_rmap_intent *ri);
-
/* functions for updating the rmapbt based on bmbt map/unmap operations */
void xfs_rmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
int whichfork, struct xfs_bmbt_irec *imap);