* extents) then free it to release the memory. This prevents us from pinning
* large tracts of memory due to corrupted fork values or one-off fragmented
* files. Otherwise we have nothing to do but keep the memory around for the
- * next inode
+ * next inode.
+ * When the thread is done, it should do an unconditional, final free.
*/
void
blkmap_free(
free(blkmap);
}
+void
+blkmap_free_final(void)
+{
+ blkmap_t *blkmap;
+
+ blkmap = pthread_getspecific(dblkmap_key);
+ pthread_setspecific(dblkmap_key, NULL);
+ free(blkmap);
+
+ blkmap = pthread_getspecific(ablkmap_key);
+ pthread_setspecific(ablkmap_key, NULL);
+ free(blkmap);
+}
+
/*
* Get one entry from a block map.
*/
blkmap_t *blkmap_alloc(xfs_extnum_t nex, int whichfork);
void blkmap_free(blkmap_t *blkmap);
+void blkmap_free_final(void);
int blkmap_set_ext(blkmap_t **blkmapp, xfs_fileoff_t o,
xfs_fsblock_t b, xfs_filblks_t c);
#include "err_protos.h"
#include "dinode.h"
#include "progress.h"
+#include "bmap.h"
static void
process_agi_unlinked(
wait_for_inode_prefetch(arg);
do_log(_(" - agno = %d\n"), agno);
process_aginodes(wq->mp, arg, agno, 1, 0, 1);
+ blkmap_free_final();
cleanup_inode_prefetch(arg);
}
wait_for_inode_prefetch(arg);
do_log(_(" - agno = %d\n"), agno);
process_aginodes(wq->mp, arg, agno, 0, 1, 0);
+ blkmap_free_final();
cleanup_inode_prefetch(arg);
/*