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

Commit 0b7e56a4 authored by Mandy Kirkconnell's avatar Mandy Kirkconnell Committed by Nathan Scott
Browse files

[XFS] Remove unused/obsoleted function: xfs_bmap_do_search_extents()



SGI-PV: 951415
SGI-Modid: xfs-linux-melb:xfs-kern:208490a

Signed-off-by: default avatarMandy Kirkconnell <alkirkco@sgi.com>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 3ccb8b5f
Loading
Loading
Loading
Loading
+0 −107
Original line number Diff line number Diff line
@@ -3467,113 +3467,6 @@ xfs_bmap_local_to_extents(
	return error;
}

xfs_bmbt_rec_t *			/* pointer to found extent entry */
xfs_bmap_do_search_extents(
	xfs_bmbt_rec_t	*base,		/* base of extent list */
	xfs_extnum_t	lastx,		/* last extent index used */
	xfs_extnum_t	nextents,	/* number of file extents */
	xfs_fileoff_t	bno,		/* block number searched for */
	int		*eofp,		/* out: end of file found */
	xfs_extnum_t	*lastxp,	/* out: last extent index */
	xfs_bmbt_irec_t	*gotp,		/* out: extent entry found */
	xfs_bmbt_irec_t	*prevp)		/* out: previous extent entry found */
{
	xfs_bmbt_rec_t	*ep;		/* extent list entry pointer */
	xfs_bmbt_irec_t	got;		/* extent list entry, decoded */
	int		high;		/* high index of binary search */
	int		low;		/* low index of binary search */

	/*
	 * Initialize the extent entry structure to catch access to
	 * uninitialized br_startblock field.
	 */
	got.br_startoff = 0xffa5a5a5a5a5a5a5LL;
	got.br_blockcount = 0xa55a5a5a5a5a5a5aLL;
	got.br_state = XFS_EXT_INVALID;

#if XFS_BIG_BLKNOS
	got.br_startblock = 0xffffa5a5a5a5a5a5LL;
#else
	got.br_startblock = 0xffffa5a5;
#endif

	if (lastx != NULLEXTNUM && lastx < nextents)
		ep = base + lastx;
	else
		ep = NULL;
	prevp->br_startoff = NULLFILEOFF;
	if (ep && bno >= (got.br_startoff = xfs_bmbt_get_startoff(ep)) &&
	    bno < got.br_startoff +
		  (got.br_blockcount = xfs_bmbt_get_blockcount(ep)))
		*eofp = 0;
	else if (ep && lastx < nextents - 1 &&
		 bno >= (got.br_startoff = xfs_bmbt_get_startoff(ep + 1)) &&
		 bno < got.br_startoff +
		       (got.br_blockcount = xfs_bmbt_get_blockcount(ep + 1))) {
		lastx++;
		ep++;
		*eofp = 0;
	} else if (nextents == 0)
		*eofp = 1;
	else if (bno == 0 &&
		 (got.br_startoff = xfs_bmbt_get_startoff(base)) == 0) {
		ep = base;
		lastx = 0;
		got.br_blockcount = xfs_bmbt_get_blockcount(ep);
		*eofp = 0;
	} else {
		low = 0;
		high = nextents - 1;
		/* binary search the extents array */
		while (low <= high) {
			XFS_STATS_INC(xs_cmp_exlist);
			lastx = (low + high) >> 1;
			ep = base + lastx;
			got.br_startoff = xfs_bmbt_get_startoff(ep);
			got.br_blockcount = xfs_bmbt_get_blockcount(ep);
			if (bno < got.br_startoff)
				high = lastx - 1;
			else if (bno >= got.br_startoff + got.br_blockcount)
				low = lastx + 1;
			else {
				got.br_startblock = xfs_bmbt_get_startblock(ep);
				got.br_state = xfs_bmbt_get_state(ep);
				*eofp = 0;
				*lastxp = lastx;
				*gotp = got;
				return ep;
			}
		}
		if (bno >= got.br_startoff + got.br_blockcount) {
			lastx++;
			if (lastx == nextents) {
				*eofp = 1;
				got.br_startblock = xfs_bmbt_get_startblock(ep);
				got.br_state = xfs_bmbt_get_state(ep);
				*prevp = got;
				ep = NULL;
			} else {
				*eofp = 0;
				xfs_bmbt_get_all(ep, prevp);
				ep++;
				got.br_startoff = xfs_bmbt_get_startoff(ep);
				got.br_blockcount = xfs_bmbt_get_blockcount(ep);
			}
		} else {
			*eofp = 0;
			if (ep > base)
				xfs_bmbt_get_all(ep - 1, prevp);
		}
	}
	if (ep) {
		got.br_startblock = xfs_bmbt_get_startblock(ep);
		got.br_state = xfs_bmbt_get_state(ep);
	}
	*lastxp = lastx;
	*gotp = got;
	return ep;
}

/*
 * Search the extent records for the entry containing block bno.
 * If bno lies in a hole, point to the next entry.  If bno lies
+0 −8
Original line number Diff line number Diff line
@@ -362,14 +362,6 @@ xfs_bmbt_rec_t *
xfs_bmap_search_multi_extents(struct xfs_ifork *, xfs_fileoff_t, int *,
			xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t *);

/*
 * Search an extent list for the extent which includes block
 * bno.
 */
xfs_bmbt_rec_t *xfs_bmap_do_search_extents(xfs_bmbt_rec_t *,
			xfs_extnum_t, xfs_extnum_t, xfs_fileoff_t, int *,
			xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t *);

#endif	/* __KERNEL__ */

#endif	/* __XFS_BMAP_H__ */