Now that the incore structures handle more than 2^32 records correctly,
fix the rmapbt generation code to handle that many records. This fixes
the problem where an extremely large rmapbt cannot be rebuilt properly
because of integer truncation.
Signed-off-by: Darrick J. Wong <djwong@djwong.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
{
struct xfs_slab_cursor *cur = NULL;
struct xfs_rmap_irec *prev, *rec;
- size_t old_sz;
+ uint64_t old_sz;
int error = 0;
old_sz = slab_count(ag_rmaps[agno].ar_rmaps);
struct xfs_rmap_irec *rmap;
struct ino_tree_node *irec;
int off;
- size_t idx;
+ uint64_t idx;
xfs_agino_t ino;
if (bag_count(rmaps) < 2)
/*
* Return the number of rmap objects for an AG.
*/
-size_t
+uint64_t
rmap_record_count(
- struct xfs_mount *mp,
+ struct xfs_mount *mp,
xfs_agnumber_t agno)
{
return slab_count(ag_rmaps[agno].ar_rmaps);
extern int rmap_add_fixed_ag_rec(struct xfs_mount *, xfs_agnumber_t);
extern int rmap_store_ag_btree_rec(struct xfs_mount *, xfs_agnumber_t);
-extern size_t rmap_record_count(struct xfs_mount *, xfs_agnumber_t);
+uint64_t rmap_record_count(struct xfs_mount *mp, xfs_agnumber_t agno);
extern int rmap_init_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
extern void rmap_avoid_check(void);
void rmaps_verify_btree(struct xfs_mount *mp, xfs_agnumber_t agno);