Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6be145bf authored by Eric Sandeen's avatar Eric Sandeen Committed by Tim Shimmin
Browse files

[XFS] Remove a bunch of unused functions from XFS.



Patch provided by Eric Sandeen (sandeen@sandeen.net).

SGI-PV: 960897
SGI-Modid: xfs-linux-melb:xfs-kern:28038a

Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 2c36dded
Loading
Loading
Loading
Loading
+0 −36
Original line number Original line Diff line number Diff line
@@ -185,16 +185,6 @@ xfs_bmap_btree_to_extents(
	int			*logflagsp, /* inode logging flags */
	int			*logflagsp, /* inode logging flags */
	int			whichfork); /* data or attr fork */
	int			whichfork); /* data or attr fork */


#ifdef DEBUG
/*
 * Check that the extents list for the inode ip is in the right order.
 */
STATIC void
xfs_bmap_check_extents(
	xfs_inode_t		*ip,		/* incore inode pointer */
	int			whichfork);	/* data or attr fork */
#endif

/*
/*
 * Called by xfs_bmapi to update file extent records and the btree
 * Called by xfs_bmapi to update file extent records and the btree
 * after removing space (or undoing a delayed allocation).
 * after removing space (or undoing a delayed allocation).
@@ -6045,32 +6035,6 @@ xfs_bmap_eof(
}
}


#ifdef DEBUG
#ifdef DEBUG
/*
 * Check that the extents list for the inode ip is in the right order.
 */
STATIC void
xfs_bmap_check_extents(
	xfs_inode_t		*ip,		/* incore inode pointer */
	int			whichfork)	/* data or attr fork */
{
	xfs_bmbt_rec_t		*ep;		/* current extent entry */
	xfs_extnum_t		idx;		/* extent record index */
	xfs_ifork_t		*ifp;		/* inode fork pointer */
	xfs_extnum_t		nextents;	/* number of extents in list */
	xfs_bmbt_rec_t		*nextp;		/* next extent entry */

	ifp = XFS_IFORK_PTR(ip, whichfork);
	ASSERT(ifp->if_flags & XFS_IFEXTENTS);
	nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
	ep = xfs_iext_get_ext(ifp, 0);
	for (idx = 0; idx < nextents - 1; idx++) {
		nextp = xfs_iext_get_ext(ifp, idx + 1);
		xfs_btree_check_rec(XFS_BTNUM_BMAP, (void *)ep,
			(void *)(nextp));
		ep = nextp;
	}
}

STATIC
STATIC
xfs_buf_t *
xfs_buf_t *
xfs_bmap_get_bp(
xfs_bmap_get_bp(
+0 −76
Original line number Original line Diff line number Diff line
@@ -678,47 +678,6 @@ error0:
	return error;
	return error;
}
}


#ifdef DEBUG
/*
 * Get the data from the pointed-to record.
 */
int
xfs_bmbt_get_rec(
	xfs_btree_cur_t		*cur,
	xfs_fileoff_t		*off,
	xfs_fsblock_t		*bno,
	xfs_filblks_t		*len,
	xfs_exntst_t		*state,
	int			*stat)
{
	xfs_bmbt_block_t	*block;
	xfs_buf_t		*bp;
#ifdef DEBUG
	int			error;
#endif
	int			ptr;
	xfs_bmbt_rec_t		*rp;

	block = xfs_bmbt_get_block(cur, 0, &bp);
	ptr = cur->bc_ptrs[0];
#ifdef DEBUG
	if ((error = xfs_btree_check_lblock(cur, block, 0, bp)))
		return error;
#endif
	if (ptr > be16_to_cpu(block->bb_numrecs) || ptr <= 0) {
		*stat = 0;
		return 0;
	}
	rp = XFS_BMAP_REC_IADDR(block, ptr, cur);
	*off = xfs_bmbt_disk_get_startoff(rp);
	*bno = xfs_bmbt_disk_get_startblock(rp);
	*len = xfs_bmbt_disk_get_blockcount(rp);
	*state = xfs_bmbt_disk_get_state(rp);
	*stat = 1;
	return 0;
}
#endif

/*
/*
 * Insert one record/level.  Return information to the caller
 * Insert one record/level.  Return information to the caller
 * allowing the next level up to proceed if necessary.
 * allowing the next level up to proceed if necessary.
@@ -2015,30 +1974,6 @@ xfs_bmbt_disk_get_blockcount(
	return (xfs_filblks_t)(INT_GET(r->l1, ARCH_CONVERT) & XFS_MASK64LO(21));
	return (xfs_filblks_t)(INT_GET(r->l1, ARCH_CONVERT) & XFS_MASK64LO(21));
}
}


/*
 * Extract the startblock field from an on disk bmap extent record.
 */
xfs_fsblock_t
xfs_bmbt_disk_get_startblock(
	xfs_bmbt_rec_t	*r)
{
#if XFS_BIG_BLKNOS
	return (((xfs_fsblock_t)INT_GET(r->l0, ARCH_CONVERT) & XFS_MASK64LO(9)) << 43) |
	       (((xfs_fsblock_t)INT_GET(r->l1, ARCH_CONVERT)) >> 21);
#else
#ifdef DEBUG
	xfs_dfsbno_t	b;

	b = (((xfs_dfsbno_t)INT_GET(r->l0, ARCH_CONVERT) & XFS_MASK64LO(9)) << 43) |
	    (((xfs_dfsbno_t)INT_GET(r->l1, ARCH_CONVERT)) >> 21);
	ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b));
	return (xfs_fsblock_t)b;
#else	/* !DEBUG */
	return (xfs_fsblock_t)(((xfs_dfsbno_t)INT_GET(r->l1, ARCH_CONVERT)) >> 21);
#endif	/* DEBUG */
#endif	/* XFS_BIG_BLKNOS */
}

/*
/*
 * Extract the startoff field from a disk format bmap extent record.
 * Extract the startoff field from a disk format bmap extent record.
 */
 */
@@ -2049,17 +1984,6 @@ xfs_bmbt_disk_get_startoff(
	return ((xfs_fileoff_t)INT_GET(r->l0, ARCH_CONVERT) &
	return ((xfs_fileoff_t)INT_GET(r->l0, ARCH_CONVERT) &
		 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
		 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
}
}

xfs_exntst_t
xfs_bmbt_disk_get_state(
	xfs_bmbt_rec_t  *r)
{
	int	ext_flag;

	ext_flag = (int)((INT_GET(r->l0, ARCH_CONVERT)) >> (64 - BMBT_EXNTFLAG_BITLEN));
	return xfs_extent_state(xfs_bmbt_disk_get_blockcount(r),
				ext_flag);
}
#endif /* XFS_NATIVE_HOST */
#endif /* XFS_NATIVE_HOST */




+0 −13
Original line number Original line Diff line number Diff line
@@ -291,15 +291,11 @@ extern xfs_exntst_t xfs_bmbt_get_state(xfs_bmbt_rec_t *r);


#ifndef XFS_NATIVE_HOST
#ifndef XFS_NATIVE_HOST
extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
extern xfs_exntst_t xfs_bmbt_disk_get_state(xfs_bmbt_rec_t *r);
extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
extern xfs_fsblock_t xfs_bmbt_disk_get_startblock(xfs_bmbt_rec_t *r);
extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
#else
#else
#define xfs_bmbt_disk_get_all(r, s)	xfs_bmbt_get_all(r, s)
#define xfs_bmbt_disk_get_all(r, s)	xfs_bmbt_get_all(r, s)
#define xfs_bmbt_disk_get_state(r)	xfs_bmbt_get_state(r)
#define xfs_bmbt_disk_get_blockcount(r)	xfs_bmbt_get_blockcount(r)
#define xfs_bmbt_disk_get_blockcount(r)	xfs_bmbt_get_blockcount(r)
#define xfs_bmbt_disk_get_startblock(r)	xfs_bmbt_get_blockcount(r)
#define xfs_bmbt_disk_get_startoff(r)	xfs_bmbt_get_startoff(r)
#define xfs_bmbt_disk_get_startoff(r)	xfs_bmbt_get_startoff(r)
#endif /* XFS_NATIVE_HOST */
#endif /* XFS_NATIVE_HOST */


@@ -340,15 +336,6 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int);
extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t,
extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t,
				xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t);
				xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t);


#ifdef DEBUG
/*
 * Get the data from the pointed-to record.
 */
extern int xfs_bmbt_get_rec(struct xfs_btree_cur *, xfs_fileoff_t *,
				xfs_fsblock_t *, xfs_filblks_t *,
				xfs_exntst_t *, int *);
#endif

#endif	/* __KERNEL__ */
#endif	/* __KERNEL__ */


#endif	/* __XFS_BMAP_BTREE_H__ */
#endif	/* __XFS_BMAP_BTREE_H__ */
+0 −15
Original line number Original line Diff line number Diff line
@@ -2165,21 +2165,6 @@ xfs_da_reada_buf(
		return rval;
		return rval;
}
}


/*
 * Calculate the number of bits needed to hold i different values.
 */
uint
xfs_da_log2_roundup(uint i)
{
	uint rval;

	for (rval = 0; rval < NBBY * sizeof(i); rval++) {
		if ((1 << rval) >= i)
			break;
	}
	return(rval);
}

kmem_zone_t *xfs_da_state_zone;	/* anchor for state struct zone */
kmem_zone_t *xfs_da_state_zone;	/* anchor for state struct zone */
kmem_zone_t *xfs_dabuf_zone;		/* dabuf zone */
kmem_zone_t *xfs_dabuf_zone;		/* dabuf zone */


+0 −1
Original line number Original line Diff line number Diff line
@@ -249,7 +249,6 @@ int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
					  xfs_dabuf_t *dead_buf);
					  xfs_dabuf_t *dead_buf);


uint xfs_da_hashname(const uchar_t *name_string, int name_length);
uint xfs_da_hashname(const uchar_t *name_string, int name_length);
uint xfs_da_log2_roundup(uint i);
xfs_da_state_t *xfs_da_state_alloc(void);
xfs_da_state_t *xfs_da_state_alloc(void);
void xfs_da_state_free(xfs_da_state_t *state);
void xfs_da_state_free(xfs_da_state_t *state);


Loading