Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24593
b: refs/heads/master
c: 0b7e56a
h: refs/heads/master
i:
  24591: 9ef0676
v: v3
  • Loading branch information
Mandy Kirkconnell authored and Nathan Scott committed Mar 28, 2006
1 parent a68e43e commit 7059175
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 116 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ccb8b5f650e80b7cc7ef76289348472e026b6ac
refs/heads/master: 0b7e56a450a4800c5f48f3a345a5a7de2f38041c
107 changes: 0 additions & 107 deletions trunk/fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions trunk/fs/xfs/xfs_bmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit 7059175

Please sign in to comment.