typedef struct xfs_dir2_put_args {
xfs_off_t cook; /* cookie of (next) entry */
xfs_intino_t ino; /* inode number */
- struct dirent *dbp; /* buffer pointer */
+ struct xfs_dirent *dbp; /* buffer pointer */
char *name; /* directory entry name */
int namelen; /* length of name */
int done; /* output: set if value was stored */
extern int
xfs_dir2_block_getdents(struct xfs_trans *tp, struct xfs_inode *dp,
- struct uio *uio, int *eofp, struct dirent *dbp,
+ struct uio *uio, int *eofp, struct xfs_dirent *dbp,
xfs_dir2_put_t put);
extern int
extern int
xfs_dir2_leaf_getdents(struct xfs_trans *tp, struct xfs_inode *dp,
- struct uio *uio, int *eofp, struct dirent *dbp,
+ struct uio *uio, int *eofp, struct xfs_dirent *dbp,
xfs_dir2_put_t put);
extern int
extern int
xfs_dir2_sf_getdents(struct xfs_inode *dp, struct uio *uio, int *eofp,
- struct dirent *dbp, xfs_dir2_put_t put);
+ struct xfs_dirent *dbp, xfs_dir2_put_t put);
extern int
xfs_dir2_sf_lookup(struct xfs_da_args *args);
{
xfs_dircook_t cook; /* cookie of (next) entry */
xfs_intino_t ino; /* inode number */
- struct dirent *dbp; /* buffer pointer */
+ struct xfs_dirent *dbp; /* buffer pointer */
char *name; /* directory entry name */
int namelen; /* length of name */
int done; /* output: set if value was stored */
int xfs_dir_shortform_to_leaf(struct xfs_da_args *args);
int xfs_dir_shortform_removename(struct xfs_da_args *args);
int xfs_dir_shortform_getdents(struct xfs_inode *dp, struct uio *uio, int *eofp,
- struct dirent *dbp, xfs_dir_put_t put);
+ struct xfs_dirent *dbp, xfs_dir_put_t put);
int xfs_dir_shortform_replace(struct xfs_da_args *args);
/*
int index_to_remove);
int xfs_dir_leaf_getdents_int(struct xfs_dabuf *bp, struct xfs_inode *dp,
xfs_dablk_t bno, struct uio *uio,
- int *eobp, struct dirent *dbp,
+ int *eobp, struct xfs_dirent *dbp,
xfs_dir_put_t put, xfs_daddr_t nextda);
/*
# -DLI_DEBUG log item (ino/buf) manipulation
# -DXACT_DEBUG transaction state changes
#
-LCFLAGS += -Wno-unknown-pragmas -Wno-unused -Wno-uninitialized -I.
+LCFLAGS += -I.
# don't try linking xfs_repair with a debug libxfs.
DEBUG = -DNDEBUG
void
libxfs_mod_sb(xfs_trans_t *tp, __int64_t fields)
{
- int fd;
xfs_buf_t *bp;
xfs_mount_t *mp;
libxfs_trans_commit(xfs_trans_t *tp, uint flags, xfs_lsn_t *commit_lsn_p)
{
xfs_sb_t *sbp;
- int error;
if (tp == NULL)
return 0;
*/
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
rval = xfs_dir2_sf_removename(&args);
- else if (rval = xfs_dir2_isblock(tp, dp, &v))
+ else if ((rval = xfs_dir2_isblock(tp, dp, &v)))
return rval;
else if (v)
rval = xfs_dir2_block_removename(&args);
- else if (rval = xfs_dir2_isleaf(tp, dp, &v))
+ else if ((rval = xfs_dir2_isleaf(tp, dp, &v)))
return rval;
else if (v)
rval = xfs_dir2_leaf_removename(&args);
xfs_bmap_free_item_t *free; /* free extent list item */
xfs_bmap_free_item_t *next; /* next item on free list */
int error;
- xfs_trans_t *ntp;
if (flist->xbf_count == 0) {
*committed = 0;
for (free = flist->xbf_first; free != NULL; free = next) {
next = free->xbfi_next;
- if (error = xfs_free_extent(*tp, free->xbfi_startblock,
- free->xbfi_blockcount))
+ if ((error = xfs_free_extent(*tp, free->xbfi_startblock,
+ free->xbfi_blockcount)))
return error;
xfs_bmap_del_free(flist, NULL, free);
}
xfs_agblock_t freeend; /* end of freespace extent */
xfs_agblock_t newbno1; /* return block number */
xfs_agblock_t newbno2; /* other new block number */
- xfs_extlen_t newlen1; /* length with newbno1 */
- xfs_extlen_t newlen2; /* length with newbno2 */
+ xfs_extlen_t newlen1=0; /* length with newbno1 */
+ xfs_extlen_t newlen2=0; /* length with newbno2 */
xfs_agblock_t wantend; /* end of target extent */
ASSERT(freelen >= wantlen);
int i; /* operation results */
xfs_agblock_t nfbno1; /* first new free startblock */
xfs_agblock_t nfbno2; /* second new free startblock */
- xfs_extlen_t nflen1; /* first new free length */
- xfs_extlen_t nflen2; /* second new free length */
+ xfs_extlen_t nflen1=0; /* first new free length */
+ xfs_extlen_t nflen2=0; /* second new free length */
/*
* Look up the record in the by-size tree if necessary.
*/
if (flags & XFSA_FIXUP_CNT_OK) {
#ifdef DEBUG
- if (error = xfs_alloc_get_rec(cnt_cur, &nfbno1, &nflen1, &i))
+ if ((error = xfs_alloc_get_rec(cnt_cur, &nfbno1, &nflen1, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(
i == 1 && nfbno1 == fbno && nflen1 == flen);
#endif
} else {
- if (error = xfs_alloc_lookup_eq(cnt_cur, fbno, flen, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, fbno, flen, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
}
*/
if (flags & XFSA_FIXUP_BNO_OK) {
#ifdef DEBUG
- if (error = xfs_alloc_get_rec(bno_cur, &nfbno1, &nflen1, &i))
+ if ((error = xfs_alloc_get_rec(bno_cur, &nfbno1, &nflen1, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(
i == 1 && nfbno1 == fbno && nflen1 == flen);
#endif
} else {
- if (error = xfs_alloc_lookup_eq(bno_cur, fbno, flen, &i))
+ if ((error = xfs_alloc_lookup_eq(bno_cur, fbno, flen, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
}
/*
* Delete the entry from the by-size btree.
*/
- if (error = xfs_alloc_delete(cnt_cur, &i))
+ if ((error = xfs_alloc_delete(cnt_cur, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
/*
* Add new by-size btree entry(s).
*/
if (nfbno1 != NULLAGBLOCK) {
- if (error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 0);
- if (error = xfs_alloc_insert(cnt_cur, &i))
+ if ((error = xfs_alloc_insert(cnt_cur, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
}
if (nfbno2 != NULLAGBLOCK) {
- if (error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 0);
- if (error = xfs_alloc_insert(cnt_cur, &i))
+ if ((error = xfs_alloc_insert(cnt_cur, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
}
/*
* No remaining freespace, just delete the by-block tree entry.
*/
- if (error = xfs_alloc_delete(bno_cur, &i))
+ if ((error = xfs_alloc_delete(bno_cur, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
} else {
/*
* Update the by-block entry to start later|be shorter.
*/
- if (error = xfs_alloc_update(bno_cur, nfbno1, nflen1))
+ if ((error = xfs_alloc_update(bno_cur, nfbno1, nflen1)))
return error;
}
if (nfbno2 != NULLAGBLOCK) {
/*
* 2 resulting free entries, need to add one.
*/
- if (error = xfs_alloc_lookup_eq(bno_cur, nfbno2, nflen2, &i))
+ if ((error = xfs_alloc_lookup_eq(bno_cur, nfbno2, nflen2, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 0);
- if (error = xfs_alloc_insert(bno_cur, &i))
+ if ((error = xfs_alloc_insert(bno_cur, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
}
ASSERT(agno != NULLAGNUMBER);
d = XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR);
- if (error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, 1, 0, &bp))
+ if ((error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, 1, 0, &bp)))
return error;
ASSERT(bp);
ASSERT(!XFS_BUF_GETERROR(bp));
xfs_alloc_ag_vextent(
xfs_alloc_arg_t *args) /* argument structure for allocation */
{
- int error;
+ int error=0;
#ifdef XFS_ALLOC_TRACE
static char fname[] = "xfs_alloc_ag_vextent";
#endif
* Look for the closest free block <= bno, it must contain bno
* if any free block does.
*/
- if (error = xfs_alloc_lookup_le(bno_cur, args->agbno, args->minlen,
- &i))
+ if ((error = xfs_alloc_lookup_le(bno_cur, args->agbno, args->minlen, &i)))
goto error0;
if (!i) {
/*
/*
* Grab the freespace record.
*/
- if (error = xfs_alloc_get_rec(bno_cur, &fbno, &flen, &i))
+ if ((error = xfs_alloc_get_rec(bno_cur, &fbno, &flen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
ASSERT(fbno <= args->agbno);
ASSERT(args->agbno + args->len <=
INT_GET(XFS_BUF_TO_AGF(args->agbp)->agf_length,
ARCH_CONVERT));
- if (error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen,
- args->agbno, args->len, XFSA_FIXUP_BNO_OK)) {
+ if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen,
+ args->agbno, args->len, XFSA_FIXUP_BNO_OK))) {
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_ERROR);
goto error0;
}
/*
* See if there are any free extents as big as maxlen.
*/
- if (error = xfs_alloc_lookup_ge(cnt_cur, 0, args->maxlen, &i))
+ if ((error = xfs_alloc_lookup_ge(cnt_cur, 0, args->maxlen, &i)))
goto error0;
/*
* If none, then pick up the last entry in the tree unless the
* tree is empty.
*/
if (!i) {
- if (error = xfs_alloc_ag_vextent_small(args, cnt_cur, <bno,
- <len, &i))
+ if ((error = xfs_alloc_ag_vextent_small(args, cnt_cur, <bno,
+ <len, &i)))
goto error0;
if (i == 0 || ltlen == 0) {
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
*/
while (xfs_btree_islastblock(cnt_cur, 0)) {
xfs_extlen_t bdiff;
- int besti;
- xfs_extlen_t blen;
- xfs_agblock_t bnew;
+ int besti=0;
+ xfs_extlen_t blen=0;
+ xfs_agblock_t bnew=0;
#if defined(DEBUG) && defined(__KERNEL__)
if (!dofirst)
if (ltlen || args->alignment > 1) {
cnt_cur->bc_ptrs[0] = 1;
do {
- if (error = xfs_alloc_get_rec(cnt_cur, <bno,
- <len, &i))
+ if ((error = xfs_alloc_get_rec(cnt_cur, <bno,
+ <len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
if (ltlen >= args->minlen)
break;
- if (error = xfs_alloc_increment(cnt_cur, 0, &i))
+ if ((error = xfs_alloc_increment(cnt_cur, 0, &i)))
goto error0;
} while (i);
ASSERT(ltlen >= args->minlen);
* For each entry, decide if it's better than
* the previous best entry.
*/
- if (error = xfs_alloc_get_rec(cnt_cur, <bno, <len,
- &i))
+ if ((error = xfs_alloc_get_rec(cnt_cur, <bno, <len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
if (!xfs_alloc_compute_aligned(ltbno, ltlen,
* Point at the best entry, and retrieve it again.
*/
cnt_cur->bc_ptrs[0] = besti;
- if (error = xfs_alloc_get_rec(cnt_cur, <bno, <len, &i))
+ if ((error = xfs_alloc_get_rec(cnt_cur, <bno, <len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
ltend = ltbno + ltlen;
/*
* Fix up the btree entries.
*/
- if (error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno,
- ltlen, bnew, blen, XFSA_FIXUP_CNT_OK))
+ if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno,
+ ltlen, bnew, blen, XFSA_FIXUP_CNT_OK)))
goto error0;
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
xfs_btree_del_cursor(bno_cur_lt, XFS_BTREE_NOERROR);
/*
* Lookup <= bno to find the leftward search's starting point.
*/
- if (error = xfs_alloc_lookup_le(bno_cur_lt, args->agbno, args->maxlen,
- &i))
+ if ((error = xfs_alloc_lookup_le(bno_cur_lt, args->agbno, args->maxlen, &i)))
goto error0;
if (!i) {
/*
/*
* Found something. Duplicate the cursor for the rightward search.
*/
- else if (error = xfs_btree_dup_cursor(bno_cur_lt, &bno_cur_gt))
+ else if ((error = xfs_btree_dup_cursor(bno_cur_lt, &bno_cur_gt)))
goto error0;
/*
* Increment the cursor, so we will point at the entry just right
* of the leftward entry if any, or to the leftmost entry.
*/
- if (error = xfs_alloc_increment(bno_cur_gt, 0, &i))
+ if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i)))
goto error0;
if (!i) {
/*
*/
do {
if (bno_cur_lt) {
- if (error = xfs_alloc_get_rec(bno_cur_lt, <bno,
- <len, &i))
+ if ((error = xfs_alloc_get_rec(bno_cur_lt, <bno, <len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
if (xfs_alloc_compute_aligned(ltbno, ltlen,
args->alignment, args->minlen,
<bnoa, <lena))
break;
- if (error = xfs_alloc_decrement(bno_cur_lt, 0, &i))
+ if ((error = xfs_alloc_decrement(bno_cur_lt, 0, &i)))
goto error0;
if (!i) {
xfs_btree_del_cursor(bno_cur_lt,
}
}
if (bno_cur_gt) {
- if (error = xfs_alloc_get_rec(bno_cur_gt, >bno,
- >len, &i))
+ if ((error = xfs_alloc_get_rec(bno_cur_gt, >bno, >len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
if (xfs_alloc_compute_aligned(gtbno, gtlen,
args->alignment, args->minlen,
>bnoa, >lena))
break;
- if (error = xfs_alloc_increment(bno_cur_gt, 0, &i))
+ if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i)))
goto error0;
if (!i) {
xfs_btree_del_cursor(bno_cur_gt,
* space, or run off the end.
*/
while (bno_cur_lt && bno_cur_gt) {
- if (error = xfs_alloc_get_rec(
+ if ((error = xfs_alloc_get_rec(
bno_cur_gt, >bno,
- >len, &i))
+ >len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
xfs_alloc_compute_aligned(gtbno, gtlen,
/*
* Fell off the right end.
*/
- if (error = xfs_alloc_increment(
- bno_cur_gt, 0, &i))
+ if ((error = xfs_alloc_increment(
+ bno_cur_gt, 0, &i)))
goto error0;
if (!i) {
xfs_btree_del_cursor(
* space, or run off the end.
*/
while (bno_cur_lt && bno_cur_gt) {
- if (error = xfs_alloc_get_rec(
+ if ((error = xfs_alloc_get_rec(
bno_cur_lt, <bno,
- <len, &i))
+ <len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
xfs_alloc_compute_aligned(ltbno, ltlen,
/*
* Fell off the left end.
*/
- if (error = xfs_alloc_decrement(
- bno_cur_lt, 0, &i))
+ if ((error = xfs_alloc_decrement(
+ bno_cur_lt, 0, &i)))
goto error0;
if (!i) {
xfs_btree_del_cursor(bno_cur_lt,
ASSERT(ltnew + rlen <= INT_GET(XFS_BUF_TO_AGF(args->agbp)->agf_length,
ARCH_CONVERT));
args->agbno = ltnew;
- if (error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno, ltlen,
- ltnew, rlen, XFSA_FIXUP_BNO_OK))
+ if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno, ltlen,
+ ltnew, rlen, XFSA_FIXUP_BNO_OK)))
goto error0;
TRACE_ALLOC(j ? "gt" : "lt", args);
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
/*
* Look for an entry >= maxlen+alignment-1 blocks.
*/
- if (error = xfs_alloc_lookup_ge(cnt_cur, 0,
- args->maxlen + args->alignment - 1, &i))
+ if ((error = xfs_alloc_lookup_ge(cnt_cur, 0,
+ args->maxlen + args->alignment - 1, &i)))
goto error0;
/*
* If none, then pick up the last entry in the tree unless the
* tree is empty.
*/
if (!i) {
- if (error = xfs_alloc_ag_vextent_small(args, cnt_cur, &fbno,
- &flen, &i))
+ if ((error = xfs_alloc_ag_vextent_small(args, cnt_cur, &fbno,
+ &flen, &i)))
goto error0;
if (i == 0 || flen == 0) {
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
* There's a freespace as big as maxlen+alignment-1, get it.
*/
else {
- if (error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, &i))
+ if ((error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
}
bestflen = flen;
bestfbno = fbno;
for (;;) {
- if (error = xfs_alloc_decrement(cnt_cur, 0, &i))
+ if ((error = xfs_alloc_decrement(cnt_cur, 0, &i)))
goto error0;
if (i == 0)
break;
- if (error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen,
- &i))
+ if ((error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen,
+ &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
if (flen < bestrlen)
break;
}
}
- if (error = xfs_alloc_lookup_eq(cnt_cur, bestfbno, bestflen,
- &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, bestfbno, bestflen,
+ &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
rlen = bestrlen;
*/
bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
args->agno, XFS_BTNUM_BNO, 0, 0);
- if (error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen,
- rbno, rlen, XFSA_FIXUP_CNT_OK))
+ if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen,
+ rbno, rlen, XFSA_FIXUP_CNT_OK)))
goto error0;
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
xfs_btree_del_cursor(bno_cur, XFS_BTREE_NOERROR);
#endif
int i;
- if (error = xfs_alloc_decrement(ccur, 0, &i))
+ if ((error = xfs_alloc_decrement(ccur, 0, &i)))
goto error0;
if (i) {
- if (error = xfs_alloc_get_rec(ccur, &fbno, &flen, &i))
+ if ((error = xfs_alloc_get_rec(ccur, &fbno, &flen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
}
else if (args->minlen == 1 && args->alignment == 1 && !args->isfl &&
(INT_GET(XFS_BUF_TO_AGF(args->agbp)->agf_flcount,
ARCH_CONVERT) > args->minleft)) {
- if (error = xfs_alloc_get_freelist(args->tp, args->agbp, &fbno))
+ if ((error = xfs_alloc_get_freelist(args->tp, args->agbp, &fbno)))
goto error0;
if (fbno != NULLAGBLOCK) {
if (args->userdata) {
* Look for a neighboring block on the left (lower block numbers)
* that is contiguous with this space.
*/
- if (error = xfs_alloc_lookup_le(bno_cur, bno, len, &haveleft))
+ if ((error = xfs_alloc_lookup_le(bno_cur, bno, len, &haveleft)))
goto error0;
if (haveleft) {
/*
* There is a block to our left.
*/
- if (error = xfs_alloc_get_rec(bno_cur, <bno, <len, &i))
+ if ((error = xfs_alloc_get_rec(bno_cur, <bno, <len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
* Look for a neighboring block on the right (higher block numbers)
* that is contiguous with this space.
*/
- if (error = xfs_alloc_increment(bno_cur, 0, &haveright))
+ if ((error = xfs_alloc_increment(bno_cur, 0, &haveright)))
goto error0;
if (haveright) {
/*
* There is a block to our right.
*/
- if (error = xfs_alloc_get_rec(bno_cur, >bno, >len, &i))
+ if ((error = xfs_alloc_get_rec(bno_cur, >bno, >len, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
/*
* Delete the old by-size entry on the left.
*/
- if (error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_delete(cnt_cur, &i))
+ if ((error = xfs_alloc_delete(cnt_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
* Delete the old by-size entry on the right.
*/
- if (error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_delete(cnt_cur, &i))
+ if ((error = xfs_alloc_delete(cnt_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
* Delete the old by-block entry for the right block.
*/
- if (error = xfs_alloc_delete(bno_cur, &i))
+ if ((error = xfs_alloc_delete(bno_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
* Move the by-block cursor back to the left neighbor.
*/
- if (error = xfs_alloc_decrement(bno_cur, 0, &i))
+ if ((error = xfs_alloc_decrement(bno_cur, 0, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
#ifdef DEBUG
xfs_agblock_t xxbno;
xfs_extlen_t xxlen;
- if (error = xfs_alloc_get_rec(bno_cur, &xxbno, &xxlen,
- &i))
+ if ((error = xfs_alloc_get_rec(bno_cur, &xxbno, &xxlen,
+ &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(
i == 1 && xxbno == ltbno && xxlen == ltlen,
*/
nbno = ltbno;
nlen = len + ltlen + gtlen;
- if (error = xfs_alloc_update(bno_cur, nbno, nlen))
+ if ((error = xfs_alloc_update(bno_cur, nbno, nlen)))
goto error0;
}
/*
/*
* Delete the old by-size entry on the left.
*/
- if (error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_delete(cnt_cur, &i))
+ if ((error = xfs_alloc_delete(cnt_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
* Back up the by-block cursor to the left neighbor, and
* update its length.
*/
- if (error = xfs_alloc_decrement(bno_cur, 0, &i))
+ if ((error = xfs_alloc_decrement(bno_cur, 0, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
nbno = ltbno;
nlen = len + ltlen;
- if (error = xfs_alloc_update(bno_cur, nbno, nlen))
+ if ((error = xfs_alloc_update(bno_cur, nbno, nlen)))
goto error0;
}
/*
/*
* Delete the old by-size entry on the right.
*/
- if (error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_delete(cnt_cur, &i))
+ if ((error = xfs_alloc_delete(cnt_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
/*
*/
nbno = bno;
nlen = len + gtlen;
- if (error = xfs_alloc_update(bno_cur, nbno, nlen))
+ if ((error = xfs_alloc_update(bno_cur, nbno, nlen)))
goto error0;
}
/*
else {
nbno = bno;
nlen = len;
- if (error = xfs_alloc_insert(bno_cur, &i))
+ if ((error = xfs_alloc_insert(bno_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
}
/*
* In all cases we need to insert the new freespace in the by-size tree.
*/
- if (error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i))
+ if ((error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 0, error0);
- if (error = xfs_alloc_insert(cnt_cur, &i))
+ if ((error = xfs_alloc_insert(cnt_cur, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
pag = args->pag;
tp = args->tp;
if (!pag->pagf_init) {
- if (error = xfs_alloc_read_agf(mp, tp, args->agno, flags,
- &agbp))
+ if ((error = xfs_alloc_read_agf(mp, tp, args->agno, flags,
+ &agbp)))
return error;
if (!pag->pagf_init) {
args->agbp = NULL;
* Can fail if we're not blocking on locks, and it's held.
*/
if (agbp == NULL) {
- if (error = xfs_alloc_read_agf(mp, tp, args->agno, flags,
- &agbp))
+ if ((error = xfs_alloc_read_agf(mp, tp, args->agno, flags,
+ &agbp)))
return error;
if (agbp == NULL) {
args->agbp = NULL;
while (INT_GET(agf->agf_flcount, ARCH_CONVERT) > need) {
xfs_buf_t *bp;
- if (error = xfs_alloc_get_freelist(tp, agbp, &bno))
+ if ((error = xfs_alloc_get_freelist(tp, agbp, &bno)))
return error;
- if (error = xfs_free_ag_extent(tp, agbp, args->agno, bno, 1, 1))
+ if ((error = xfs_free_ag_extent(tp, agbp, args->agno, bno, 1, 1)))
return error;
bp = xfs_btree_get_bufs(mp, tp, args->agno, bno, 0);
xfs_trans_binval(tp, bp);
targs.alignment = targs.minlen = targs.prod = targs.isfl = 1;
targs.type = XFS_ALLOCTYPE_THIS_AG;
targs.pag = pag;
- if (error = xfs_alloc_read_agfl(mp, tp, targs.agno, &agflbp))
+ if ((error = xfs_alloc_read_agfl(mp, tp, targs.agno, &agflbp)))
return error;
/*
* Make the freelist longer if it's too short.
/*
* Allocate as many blocks as possible at once.
*/
- if (error = xfs_alloc_ag_vextent(&targs))
+ if ((error = xfs_alloc_ag_vextent(&targs)))
return error;
/*
* Stop if we run out. Won't happen if callers are obeying
* Put each allocated block on the list.
*/
for (bno = targs.agbno; bno < targs.agbno + targs.len; bno++) {
- if (error = xfs_alloc_put_freelist(tp, agbp, agflbp,
- bno))
+ if ((error = xfs_alloc_put_freelist(tp, agbp, agflbp,
+ bno)))
return error;
}
}
* Read the array of free blocks.
*/
mp = tp->t_mountp;
- if (error = xfs_alloc_read_agfl(mp, tp,
- INT_GET(agf->agf_seqno, ARCH_CONVERT), &agflbp))
+ if ((error = xfs_alloc_read_agfl(mp, tp,
+ INT_GET(agf->agf_seqno, ARCH_CONVERT), &agflbp)))
return error;
agfl = XFS_BUF_TO_AGFL(agflbp);
/*
xfs_buf_t *bp;
int error;
- if (error = xfs_alloc_read_agf(mp, tp, agno, flags, &bp))
+ if ((error = xfs_alloc_read_agf(mp, tp, agno, flags, &bp)))
return error;
if (bp)
xfs_trans_brelse(tp, bp);
ASSERT(agno != NULLAGNUMBER);
d = XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR);
- if (error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, 1,
+ if ((error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, 1,
(flags & XFS_ALLOC_FLAG_TRYLOCK) ? XFS_BUF_TRYLOCK : 0U,
- &bp))
+ &bp)))
return error;
ASSERT(!bp || !XFS_BUF_GETERROR(bp));
if (!bp) {
break;
}
args->agbno = XFS_FSB_TO_AGBNO(mp, args->fsbno);
- if (error = xfs_alloc_ag_vextent(args))
+ if ((error = xfs_alloc_ag_vextent(args)))
goto error0;
mrunlock(&mp->m_peraglock);
break;
for (;;) {
mrlock(&mp->m_peraglock, MR_ACCESS, PINOD);
args->pag = &mp->m_perag[args->agno];
- if (error = xfs_alloc_fix_freelist(args, flags)) {
+ if ((error = xfs_alloc_fix_freelist(args, flags))) {
TRACE_ALLOC("nofix", args);
goto error0;
}
* If we get a buffer back then the allocation will fly.
*/
if (args->agbp) {
- if (error = xfs_alloc_ag_vextent(args))
+ if ((error = xfs_alloc_ag_vextent(args)))
goto error0;
mrunlock(&mp->m_peraglock);
break;
args.minlen = args.minleft = args.minalignslop = 0;
mrlock(&args.mp->m_peraglock, MR_ACCESS, PINOD);
args.pag = &args.mp->m_perag[args.agno];
- if (error = xfs_alloc_fix_freelist(&args, 0))
+ if ((error = xfs_alloc_fix_freelist(&args, 0)))
goto error0;
#ifdef DEBUG
ASSERT(args.agbp != NULL);
xfs_agblock_t lbno; /* left block's block number */
xfs_buf_t *lbp; /* left block's buffer pointer */
xfs_alloc_block_t *left; /* left btree block */
- xfs_alloc_key_t *lkp; /* left block key pointer */
- xfs_alloc_ptr_t *lpp; /* left block address pointer */
- int lrecs; /* number of records in left block */
+ xfs_alloc_key_t *lkp=NULL; /* left block key pointer */
+ xfs_alloc_ptr_t *lpp=NULL; /* left block address pointer */
+ int lrecs=0; /* number of records in left block */
xfs_alloc_rec_t *lrp; /* left block record pointer */
xfs_mount_t *mp; /* mount structure */
int ptr; /* index in btree block for this rec */
xfs_alloc_block_t *right; /* right btree block */
xfs_alloc_key_t *rkp; /* right block key pointer */
xfs_alloc_ptr_t *rpp; /* right block address pointer */
- int rrecs; /* number of records in right block */
+ int rrecs=0; /* number of records in right block */
xfs_alloc_rec_t *rrp; /* right block record pointer */
xfs_btree_cur_t *tcur; /* temporary btree cursor */
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
#endif
/*
lpp = XFS_ALLOC_PTR_ADDR(block, 1, cur);
#ifdef DEBUG
for (i = ptr; i < INT_GET(block->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level)))
return error;
}
#endif
/*
* Put this buffer/block on the ag's freelist.
*/
- if (error = xfs_alloc_put_freelist(cur->bc_tp,
- cur->bc_private.a.agbp, NULL, bno))
+ if ((error = xfs_alloc_put_freelist(cur->bc_tp,
+ cur->bc_private.a.agbp, NULL, bno)))
return error;
xfs_trans_agbtree_delta(cur->bc_tp, -1);
xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp,
* Duplicate the cursor so our btree manipulations here won't
* disrupt the next level up.
*/
- if (error = xfs_btree_dup_cursor(cur, &tcur))
+ if ((error = xfs_btree_dup_cursor(cur, &tcur)))
return error;
/*
* If there's a right sibling, see if it's ok to shift an entry
*/
i = xfs_btree_lastrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_increment(tcur, level, &i))
+ if ((error = xfs_alloc_increment(tcur, level, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
i = xfs_btree_lastrec(tcur, level);
rbp = tcur->bc_bufs[level];
right = XFS_BUF_TO_ALLOC_BLOCK(rbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, right, level, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right, level, rbp)))
goto error0;
#endif
/*
*/
if (INT_GET(right->bb_numrecs, ARCH_CONVERT) - 1 >=
XFS_ALLOC_BLOCK_MINRECS(level, cur)) {
- if (error = xfs_alloc_lshift(tcur, level, &i))
+ if ((error = xfs_alloc_lshift(tcur, level, &i)))
goto error0;
if (i) {
ASSERT(INT_GET(block->bb_numrecs, ARCH_CONVERT) >=
if (lbno != NULLAGBLOCK) {
i = xfs_btree_firstrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_decrement(tcur, level, &i))
+ if ((error = xfs_alloc_decrement(tcur, level, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
}
*/
i = xfs_btree_firstrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_alloc_decrement(tcur, level, &i))
+ if ((error = xfs_alloc_decrement(tcur, level, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
xfs_btree_firstrec(tcur, level);
lbp = tcur->bc_bufs[level];
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
goto error0;
#endif
/*
*/
if (INT_GET(left->bb_numrecs, ARCH_CONVERT) - 1 >=
XFS_ALLOC_BLOCK_MINRECS(level, cur)) {
- if (error = xfs_alloc_rshift(tcur, level, &i))
+ if ((error = xfs_alloc_rshift(tcur, level, &i)))
goto error0;
if (i) {
ASSERT(INT_GET(block->bb_numrecs, ARCH_CONVERT) >=
rbno = bno;
right = block;
rbp = bp;
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
cur->bc_private.a.agno, lbno, 0, &lbp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
}
/*
lbno = bno;
left = block;
lbp = bp;
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
cur->bc_private.a.agno, rbno, 0, &rbp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
right = XFS_BUF_TO_ALLOC_BLOCK(rbp);
- if (error = xfs_btree_check_sblock(cur, right, level, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right, level, rbp)))
return error;
}
/*
rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level)))
return error;
}
#endif
xfs_alloc_block_t *rrblock;
xfs_buf_t *rrbp;
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
cur->bc_private.a.agno, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0,
- &rrbp, XFS_ALLOC_BTREE_REF))
+ &rrbp, XFS_ALLOC_BTREE_REF)))
return error;
rrblock = XFS_BUF_TO_ALLOC_BLOCK(rrbp);
- if (error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))
+ if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp)))
return error;
INT_SET(rrblock->bb_leftsib, ARCH_CONVERT, lbno);
xfs_alloc_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB);
/*
* Free the deleting block by putting it on the freelist.
*/
- if (error = xfs_alloc_put_freelist(cur->bc_tp, cur->bc_private.a.agbp,
- NULL, rbno))
+ if ((error = xfs_alloc_put_freelist(cur->bc_tp, cur->bc_private.a.agbp,
+ NULL, rbno)))
return error;
xfs_trans_agbtree_delta(cur->bc_tp, -1);
/*
*/
if (level >= cur->bc_nlevels) {
XFS_STATS_INC(xs_abt_insrec);
- if (error = xfs_alloc_newroot(cur, &i))
+ if ((error = xfs_alloc_newroot(cur, &i)))
return error;
*bnop = NULLAGBLOCK;
*stat = i;
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
/*
* Check that the new entry is being inserted in the right place.
/*
* First, try shifting an entry to the right neighbor.
*/
- if (error = xfs_alloc_rshift(cur, level, &i))
+ if ((error = xfs_alloc_rshift(cur, level, &i)))
return error;
if (i) {
/* nothing */
* Next, try shifting an entry to the left neighbor.
*/
else {
- if (error = xfs_alloc_lshift(cur, level, &i))
+ if ((error = xfs_alloc_lshift(cur, level, &i)))
return error;
if (i)
optr = ptr = cur->bc_ptrs[level];
* variables because we could be in a
* different block now.
*/
- if (error = xfs_alloc_split(cur, level, &nbno,
- &nkey, &ncur, &i))
+ if ((error = xfs_alloc_split(cur, level, &nbno,
+ &nkey, &ncur, &i)))
return error;
if (i) {
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
#ifdef DEBUG
- if (error =
+ if ((error =
xfs_btree_check_sblock(cur,
- block, level, bp))
+ block, level, bp)))
return error;
#endif
ptr = cur->bc_ptrs[level];
pp = XFS_ALLOC_PTR_ADDR(block, 1, cur);
#ifdef DEBUG
for (i = INT_GET(block->bb_numrecs, ARCH_CONVERT); i >= ptr; i--) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT), level)))
return error;
}
#endif
ovbcopy(&pp[ptr - 1], &pp[ptr],
(INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*pp)); /* INT_: copy */
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, *bnop, level))
+ if ((error = xfs_btree_check_sptr(cur, *bnop, level)))
return error;
#endif
/*
{
xfs_agblock_t agbno; /* a.g. relative btree block number */
xfs_agnumber_t agno; /* allocation group number */
- xfs_alloc_block_t *block; /* current btree block */
+ xfs_alloc_block_t *block=NULL; /* current btree block */
int diff; /* difference for the current key */
int error; /* error return value */
- int keyno; /* current key number */
+ int keyno=0; /* current key number */
int level; /* level in the btree */
xfs_mount_t *mp; /* file system mount point */
* Need to get a new buffer. Read it, then
* set it in the cursor, releasing the old one.
*/
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp, agno,
- agbno, 0, &bp, XFS_ALLOC_BTREE_REF))
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, agno,
+ agbno, 0, &bp, XFS_ALLOC_BTREE_REF)))
return error;
xfs_btree_setbuf(cur, level, bp);
/*
* Point to the btree block, now that we have the buffer
*/
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
- if (error = xfs_btree_check_sblock(cur, block, level,
- bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level,
+ bp)))
return error;
} else
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
*/
else {
int high; /* high entry number */
- xfs_alloc_key_t *kkbase;/* base of keys in block */
- xfs_alloc_rec_t *krbase;/* base of records in block */
+ xfs_alloc_key_t *kkbase=NULL;/* base of keys in block */
+ xfs_alloc_rec_t *krbase=NULL;/* base of records in block */
int low; /* low entry number */
/*
keyno = 1;
agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, keyno, cur), ARCH_CONVERT);
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, agbno, level))
+ if ((error = xfs_btree_check_sptr(cur, agbno, level)))
return error;
#endif
cur->bc_ptrs[level] = keyno;
int i;
cur->bc_ptrs[0] = keyno;
- if (error = xfs_alloc_increment(cur, 0, &i))
+ if ((error = xfs_alloc_increment(cur, 0, &i)))
return error;
XFS_WANT_CORRUPTED_RETURN(i == 1);
*stat = 1;
int nrec; /* new number of left block entries */
xfs_buf_t *rbp; /* buffer for right (current) block */
xfs_alloc_block_t *right; /* right (current) btree block */
- xfs_alloc_key_t *rkp; /* key pointer for right block */
- xfs_alloc_ptr_t *rpp; /* address pointer for right block */
- xfs_alloc_rec_t *rrp; /* record pointer for right block */
+ xfs_alloc_key_t *rkp=NULL; /* key pointer for right block */
+ xfs_alloc_ptr_t *rpp=NULL; /* address pointer for right block */
+ xfs_alloc_rec_t *rrp=NULL; /* record pointer for right block */
/*
* Set up variables for this block as "right".
rbp = cur->bc_bufs[level];
right = XFS_BUF_TO_ALLOC_BLOCK(rbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, right, level, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right, level, rbp)))
return error;
#endif
/*
/*
* Set up the left neighbor as "left".
*/
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agno, INT_GET(right->bb_leftsib, ARCH_CONVERT), 0, &lbp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
/*
* If it's full, it can't take another entry.
lpp = XFS_ALLOC_PTR_ADDR(left, nrec, cur);
rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, INT_GET(*rpp, ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(*rpp, ARCH_CONVERT), level)))
return error;
#endif
*lpp = *rpp; /* INT_: copy */
if (level > 0) {
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT),
- level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT),
+ level)))
return error;
}
#endif
/*
* Update the parent key values of right.
*/
- if (error = xfs_alloc_updkey(cur, rkp, level + 1))
+ if ((error = xfs_alloc_updkey(cur, rkp, level + 1)))
return error;
/*
* Slide the cursor value left one.
/*
* Get a buffer from the freelist blocks, for the new root.
*/
- if (error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
- &nbno))
+ if ((error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
+ &nbno)))
return error;
/*
* None available, we fail.
lbp = cur->bc_bufs[cur->bc_nlevels - 1];
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, left, cur->bc_nlevels - 1, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, cur->bc_nlevels - 1, lbp)))
return error;
#endif
if (INT_GET(left->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) {
*/
lbno = XFS_DADDR_TO_AGBNO(mp, XFS_BUF_ADDR(lbp));
rbno = INT_GET(left->bb_rightsib, ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
cur->bc_private.a.agno, rbno, 0, &rbp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
right = XFS_BUF_TO_ALLOC_BLOCK(rbp);
- if (error = xfs_btree_check_sblock(cur, right,
- cur->bc_nlevels - 1, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right,
+ cur->bc_nlevels - 1, rbp)))
return error;
nptr = 1;
} else {
right = left;
rbno = XFS_DADDR_TO_AGBNO(mp, XFS_BUF_ADDR(rbp));
lbno = INT_GET(right->bb_leftsib, ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
cur->bc_private.a.agno, lbno, 0, &lbp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
- if (error = xfs_btree_check_sblock(cur, left,
- cur->bc_nlevels - 1, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left,
+ cur->bc_nlevels - 1, lbp)))
return error;
nptr = 2;
}
lbp = cur->bc_bufs[level];
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
#endif
/*
/*
* Set up the right neighbor as "right".
*/
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agno, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0, &rbp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
right = XFS_BUF_TO_ALLOC_BLOCK(rbp);
- if (error = xfs_btree_check_sblock(cur, right, level, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right, level, rbp)))
return error;
/*
* If it's full, it can't take another entry.
rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
for (i = INT_GET(right->bb_numrecs, ARCH_CONVERT) - 1; i >= 0; i--) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level)))
return error;
}
#endif
ovbcopy(rkp, rkp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
ovbcopy(rpp, rpp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, INT_GET(*lpp, ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(*lpp, ARCH_CONVERT), level)))
return error;
#endif
*rkp = *lkp; /* INT_: copy */
* Using a temporary cursor, update the parent key values of the
* block on the right.
*/
- if (error = xfs_btree_dup_cursor(cur, &tcur))
+ if ((error = xfs_btree_dup_cursor(cur, &tcur)))
return error;
i = xfs_btree_lastrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
* Allocate the new block from the freelist.
* If we can't do it, we're toast. Give up.
*/
- if (error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
- &rbno))
+ if ((error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
+ &rbno)))
return error;
if (rbno == NULLAGBLOCK) {
*stat = 0;
lbp = cur->bc_bufs[level];
left = XFS_BUF_TO_ALLOC_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
#endif
/*
rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level)))
return error;
}
#endif
xfs_alloc_block_t *rrblock; /* rr btree block */
xfs_buf_t *rrbp; /* buffer for rrblock */
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agno, INT_GET(right->bb_rightsib, ARCH_CONVERT), 0,
- &rrbp, XFS_ALLOC_BTREE_REF))
+ &rrbp, XFS_ALLOC_BTREE_REF)))
return error;
rrblock = XFS_BUF_TO_ALLOC_BLOCK(rrbp);
- if (error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))
+ if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp)))
return error;
INT_SET(rrblock->bb_leftsib, ARCH_CONVERT, rbno);
xfs_alloc_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB);
* the right block, no matter where this cursor was.
*/
if (level + 1 < cur->bc_nlevels) {
- if (error = xfs_btree_dup_cursor(cur, curp))
+ if ((error = xfs_btree_dup_cursor(cur, curp)))
return error;
(*curp)->bc_ptrs[level + 1]++;
}
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
#endif
ptr = cur->bc_ptrs[level];
*/
block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[level]);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level,
- cur->bc_bufs[level]))
+ if ((error = xfs_btree_check_sblock(cur, block, level,
+ cur->bc_bufs[level])))
return error;
#endif
/*
xfs_buf_t *bp; /* buffer pointer for block */
agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agno, agbno, 0, &bp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
lev--;
xfs_btree_setbuf(cur, lev, bp);
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
- if (error = xfs_btree_check_sblock(cur, block, lev, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, lev, bp)))
return error;
cur->bc_ptrs[lev] = INT_GET(block->bb_numrecs, ARCH_CONVERT);
}
* Otherwise we are done.
*/
for (level = 0, i = 2; i == 2; level++) {
- if (error = xfs_alloc_delrec(cur, level, &i))
+ if ((error = xfs_alloc_delrec(cur, level, &i)))
return error;
}
if (i == 0) {
for (level = 1; level < cur->bc_nlevels; level++) {
if (cur->bc_ptrs[level] == 0) {
- if (error = xfs_alloc_decrement(cur, level, &i))
+ if ((error = xfs_alloc_decrement(cur, level, &i)))
return error;
break;
}
ptr = cur->bc_ptrs[0];
block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))
+ if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0])))
return error;
#endif
/*
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
#endif
/*
bp = cur->bc_bufs[lev];
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, lev, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, lev, bp)))
return error;
#endif
if (++cur->bc_ptrs[lev] <= INT_GET(block->bb_numrecs, ARCH_CONVERT))
xfs_agblock_t agbno; /* block number of btree block */
agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.a.agno, agbno, 0, &bp,
- XFS_ALLOC_BTREE_REF))
+ XFS_ALLOC_BTREE_REF)))
return error;
lev--;
xfs_btree_setbuf(cur, lev, bp);
block = XFS_BUF_TO_ALLOC_BLOCK(bp);
- if (error = xfs_btree_check_sblock(cur, block, lev, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, lev, bp)))
return error;
cur->bc_ptrs[lev] = 1;
}
* Insert nrec/nbno into this level of the tree.
* Note if we fail, nbno will be null.
*/
- if (error = xfs_alloc_insrec(pcur, level++, &nbno, &nrec, &ncur,
- &i)) {
+ if ((error = xfs_alloc_insrec(pcur, level++, &nbno, &nrec, &ncur,
+ &i))) {
if (pcur != cur)
xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR);
return error;
*/
block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))
+ if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0])))
return error;
#endif
/*
INT_SET(key.ar_startblock, ARCH_CONVERT, bno);
INT_SET(key.ar_blockcount, ARCH_CONVERT, len);
- if (error = xfs_alloc_updkey(cur, &key, 1))
+ if ((error = xfs_alloc_updkey(cur, &key, 1)))
return error;
}
return 0;
#else
__uint32_t vw;
- if (vw = v) {
+ if ((vw = v)) {
if (vw & 0x0000ffff)
if (vw & 0x000000ff)
i = 0;
else
i = 24;
return i + xfs_lowbit[(vw >> i) & 0xff];
- } else if (vw = v >> 32) {
+ } else if ((vw = v >> 32)) {
if (vw & 0x0000ffff)
if (vw & 0x000000ff)
i = 32;
#else
__uint32_t vw;
- if (vw = v >> 32) {
+ if ((vw = v >> 32)) {
if (vw & 0xffff0000)
if (vw & 0xff000000)
i = 56;
else
i = 32;
return i + xfs_highbit[(vw >> (i - 32)) & 0xff];
- } else if (vw = v) {
+ } else if ((vw = v)) {
if (vw & 0xffff0000)
if (vw & 0xff000000)
i = 24;
if (cur)
ASSERT((cur->bc_private.b.flags &
XFS_BTCUR_BPRV_WASDEL) == 0);
- if (error = xfs_bmap_add_extent_hole_delay(ip, idx, cur, new,
- &logflags, rsvd))
+ if ((error = xfs_bmap_add_extent_hole_delay(ip, idx, cur, new,
+ &logflags, rsvd)))
goto done;
}
/*
if (cur)
ASSERT((cur->bc_private.b.flags &
XFS_BTCUR_BPRV_WASDEL) == 0);
- if (error = xfs_bmap_add_extent_hole_real(ip, idx, cur, new,
- &logflags, whichfork))
+ if ((error = xfs_bmap_add_extent_hole_real(ip, idx, cur, new,
+ &logflags, whichfork)))
goto done;
} else {
xfs_bmbt_irec_t prev; /* old extent at offset idx */
if (cur)
ASSERT(cur->bc_private.b.flags &
XFS_BTCUR_BPRV_WASDEL);
- if (error = xfs_bmap_add_extent_delay_real(ip,
+ if ((error = xfs_bmap_add_extent_delay_real(ip,
idx, &cur, new, &da_new, first, flist,
- &logflags, rsvd))
+ &logflags, rsvd)))
goto done;
} else if (new->br_state == XFS_EXT_NORM) {
ASSERT(new->br_state == XFS_EXT_NORM);
- if (error = xfs_bmap_add_extent_unwritten_real(
- ip, idx, &cur, new, &logflags))
+ if ((error = xfs_bmap_add_extent_unwritten_real(
+ ip, idx, &cur, new, &logflags)))
goto done;
} else {
ASSERT(new->br_state == XFS_EXT_UNWRITTEN);
- if (error = xfs_bmap_add_extent_unwritten_real(
- ip, idx, &cur, new, &logflags))
+ if ((error = xfs_bmap_add_extent_unwritten_real(
+ ip, idx, &cur, new, &logflags)))
goto done;
}
ASSERT(*curp == cur || *curp == NULL);
if (cur)
ASSERT((cur->bc_private.b.flags &
XFS_BTCUR_BPRV_WASDEL) == 0);
- if (error = xfs_bmap_add_extent_hole_real(ip, idx, cur,
- new, &logflags, whichfork))
+ if ((error = xfs_bmap_add_extent_hole_real(ip, idx, cur,
+ new, &logflags, whichfork)))
goto done;
}
}
xfs_fileoff_t new_endoff; /* end offset of new entry */
xfs_bmbt_irec_t r[3]; /* neighbor extent entries */
/* left is 0, right is 1, prev is 2 */
- int rval; /* return value (logging flags) */
+ int rval=0; /* return value (logging flags) */
int state = 0;/* state bits, accessed thru macros */
xfs_filblks_t temp; /* value for dnew calculations */
xfs_filblks_t temp2; /* value for dnew calculations */
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
RIGHT.br_startblock,
- RIGHT.br_blockcount, &i))
+ RIGHT.br_blockcount, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_delete(cur, 0, &i))
+ if ((error = xfs_bmbt_delete(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
LEFT.br_startblock,
LEFT.br_blockcount +
PREV.br_blockcount +
- RIGHT.br_blockcount, LEFT.br_state))
+ RIGHT.br_blockcount, LEFT.br_state)))
goto done;
}
*dnew = 0;
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, LEFT.br_startoff,
LEFT.br_startblock, LEFT.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
LEFT.br_startblock,
LEFT.br_blockcount +
- PREV.br_blockcount, LEFT.br_state))
+ PREV.br_blockcount, LEFT.br_state)))
goto done;
}
*dnew = 0;
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
RIGHT.br_startblock,
- RIGHT.br_blockcount, &i))
+ RIGHT.br_blockcount, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_update(cur, PREV.br_startoff,
new->br_startblock,
PREV.br_blockcount +
- RIGHT.br_blockcount, PREV.br_state))
+ RIGHT.br_blockcount, PREV.br_state)))
goto done;
}
*dnew = 0;
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 0);
cur->bc_rec.b.br_state = XFS_EXT_NORM;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, LEFT.br_startoff,
LEFT.br_startblock, LEFT.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
LEFT.br_startblock,
LEFT.br_blockcount +
new->br_blockcount,
- LEFT.br_state))
+ LEFT.br_state)))
goto done;
}
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 0);
cur->bc_rec.b.br_state = XFS_EXT_NORM;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
RIGHT.br_startblock,
- RIGHT.br_blockcount, &i))
+ RIGHT.br_blockcount, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, new->br_startoff,
+ if ((error = xfs_bmbt_update(cur, new->br_startoff,
new->br_startblock,
new->br_blockcount +
RIGHT.br_blockcount,
- RIGHT.br_state))
+ RIGHT.br_state)))
goto done;
}
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 0);
cur->bc_rec.b.br_state = XFS_EXT_NORM;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 0);
cur->bc_rec.b.br_state = XFS_EXT_NORM;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
xfs_exntst_t oldext; /* old extent state */
xfs_bmbt_irec_t r[3]; /* neighbor extent entries */
/* left is 0, right is 1, prev is 2 */
- int rval; /* return value (logging flags) */
+ int rval=0; /* return value (logging flags) */
int state = 0;/* state bits, accessed thru macros */
enum { /* bit number definitions for state */
LEFT_CONTIG, RIGHT_CONTIG,
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
RIGHT.br_startblock,
- RIGHT.br_blockcount, &i))
+ RIGHT.br_blockcount, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_delete(cur, 0, &i))
+ if ((error = xfs_bmbt_delete(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_delete(cur, 0, &i))
+ if ((error = xfs_bmbt_delete(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
LEFT.br_startblock,
LEFT.br_blockcount + PREV.br_blockcount +
- RIGHT.br_blockcount, LEFT.br_state))
+ RIGHT.br_blockcount, LEFT.br_state)))
goto done;
}
break;
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
PREV.br_startblock, PREV.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_delete(cur, 0, &i))
+ if ((error = xfs_bmbt_delete(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, LEFT.br_startoff,
+ if ((error = xfs_bmbt_update(cur, LEFT.br_startoff,
LEFT.br_startblock,
LEFT.br_blockcount + PREV.br_blockcount,
- LEFT.br_state))
+ LEFT.br_state)))
goto done;
}
break;
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff,
RIGHT.br_startblock,
- RIGHT.br_blockcount, &i))
+ RIGHT.br_blockcount, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_delete(cur, 0, &i))
+ if ((error = xfs_bmbt_delete(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, new->br_startoff,
+ if ((error = xfs_bmbt_update(cur, new->br_startoff,
new->br_startblock,
new->br_blockcount + RIGHT.br_blockcount,
- newext))
+ newext)))
goto done;
}
break;
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, new->br_startoff,
+ if ((error = xfs_bmbt_update(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- newext))
+ newext)))
goto done;
}
break;
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
PREV.br_startblock, PREV.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur,
+ if ((error = xfs_bmbt_update(cur,
PREV.br_startoff + new->br_blockcount,
PREV.br_startblock + new->br_blockcount,
PREV.br_blockcount - new->br_blockcount,
- oldext))
+ oldext)))
goto done;
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
goto done;
if (xfs_bmbt_update(cur, LEFT.br_startoff,
LEFT.br_startblock,
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
PREV.br_startblock, PREV.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur,
+ if ((error = xfs_bmbt_update(cur,
PREV.br_startoff + new->br_blockcount,
PREV.br_startblock + new->br_blockcount,
PREV.br_blockcount - new->br_blockcount,
- oldext))
+ oldext)))
goto done;
cur->bc_rec.b = *new;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
rval = XFS_ILOG_DEXT;
else {
rval = 0;
- if (error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
PREV.br_startblock,
- PREV.br_blockcount, &i))
+ PREV.br_blockcount, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_update(cur, PREV.br_startoff,
PREV.br_startblock,
PREV.br_blockcount - new->br_blockcount,
- oldext))
+ oldext)))
goto done;
- if (error = xfs_bmbt_increment(cur, 0, &i))
+ if ((error = xfs_bmbt_increment(cur, 0, &i)))
goto done;
- if (error = xfs_bmbt_update(cur, new->br_startoff,
+ if ((error = xfs_bmbt_update(cur, new->br_startoff,
new->br_startblock,
new->br_blockcount + RIGHT.br_blockcount,
- newext))
+ newext)))
goto done;
}
break;
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
PREV.br_startblock, PREV.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_update(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_update(cur, PREV.br_startoff,
PREV.br_startblock,
PREV.br_blockcount - new->br_blockcount,
- oldext))
+ oldext)))
goto done;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
new->br_startblock, new->br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 0);
cur->bc_rec.b.br_state = XFS_EXT_NORM;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else {
rval = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff,
PREV.br_startblock, PREV.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
/* new right extent - oldext */
- if (error = xfs_bmbt_update(cur, r[1].br_startoff,
+ if ((error = xfs_bmbt_update(cur, r[1].br_startoff,
r[1].br_startblock, r[1].br_blockcount,
- r[1].br_state))
+ r[1].br_state)))
goto done;
/* new left extent - oldext */
PREV.br_blockcount =
new->br_startoff - PREV.br_startoff;
cur->bc_rec.b = PREV;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
- if (error = xfs_bmbt_increment(cur, 0, &i))
+ if ((error = xfs_bmbt_increment(cur, 0, &i)))
goto done;
ASSERT(i == 1);
/* new middle extent - newext */
cur->bc_rec.b = *new;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
goto done;
ASSERT(i == 1);
}
static char fname[] = "xfs_bmap_add_extent_hole_delay";
#endif
xfs_bmbt_irec_t left; /* left neighbor extent entry */
- xfs_filblks_t newlen; /* new indirect size */
- xfs_filblks_t oldlen; /* old indirect size */
+ xfs_filblks_t newlen=0; /* new indirect size */
+ xfs_filblks_t oldlen=0; /* old indirect size */
xfs_bmbt_irec_t right; /* right neighbor extent entry */
int state; /* state bits, accessed thru macros */
xfs_filblks_t temp; /* temp for indirect calculations */
return 0;
}
*logflagsp = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, right.br_startoff,
- right.br_startblock, right.br_blockcount, &i))
+ if ((error = xfs_bmbt_lookup_eq(cur, right.br_startoff,
+ right.br_startblock, right.br_blockcount, &i)))
return error;
ASSERT(i == 1);
- if (error = xfs_bmbt_delete(cur, 0, &i))
+ if ((error = xfs_bmbt_delete(cur, 0, &i)))
return error;
ASSERT(i == 1);
- if (error = xfs_bmbt_decrement(cur, 0, &i))
+ if ((error = xfs_bmbt_decrement(cur, 0, &i)))
return error;
ASSERT(i == 1);
error = xfs_bmbt_update(cur, left.br_startoff,
return 0;
}
*logflagsp = 0;
- if (error = xfs_bmbt_lookup_eq(cur, left.br_startoff,
- left.br_startblock, left.br_blockcount, &i))
+ if ((error = xfs_bmbt_lookup_eq(cur, left.br_startoff,
+ left.br_startblock, left.br_blockcount, &i)))
return error;
ASSERT(i == 1);
error = xfs_bmbt_update(cur, left.br_startoff,
return 0;
}
*logflagsp = 0;
- if (error = xfs_bmbt_lookup_eq(cur, right.br_startoff,
- right.br_startblock, right.br_blockcount, &i))
+ if ((error = xfs_bmbt_lookup_eq(cur, right.br_startoff,
+ right.br_startblock, right.br_blockcount, &i)))
return error;
ASSERT(i == 1);
error = xfs_bmbt_update(cur, new->br_startoff,
return 0;
}
*logflagsp = XFS_ILOG_CORE;
- if (error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
- new->br_startblock, new->br_blockcount, &i))
+ if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff,
+ new->br_startblock, new->br_blockcount, &i)))
return error;
ASSERT(i == 0);
cur->bc_rec.b.br_state = new->br_state;
- if (error = xfs_bmbt_insert(cur, &i))
+ if ((error = xfs_bmbt_insert(cur, &i)))
return error;
ASSERT(i == 1);
return 0;
xfs_bmalloca_t *ap) /* bmap alloc argument struct */
{
xfs_fsblock_t adjust; /* adjustment to block numbers */
- xfs_alloctype_t atype; /* type for allocation routines */
+ xfs_alloctype_t atype=0; /* type for allocation routines */
int error; /* error return value */
xfs_agnumber_t fb_agno; /* ag number of ap->firstblock */
xfs_mount_t *mp; /* mount point structure */
int nullfb; /* true if ap->firstblock isn't set */
int rt; /* true if inode is realtime */
#ifdef __KERNEL__
- xfs_extlen_t prod; /* product factor for allocators */
- xfs_extlen_t ralen; /* realtime allocation length */
+ xfs_extlen_t prod=0; /* product factor for allocators */
+ xfs_extlen_t ralen=0; /* realtime allocation length */
#endif
#define ISLEGAL(x,y) \
/*
* Same adjustment for the end of the requested area.
*/
- if (temp = (ap->alen % extsz))
+ if ((temp = (ap->alen % extsz)))
ap->alen += extsz - temp;
/*
* If the previous block overlaps with this proposed allocation
* If the result isn't a multiple of rtextents we need to
* remove blocks until it is.
*/
- if (temp = (ap->alen % mp->m_sb.sb_rextsize)) {
+ if ((temp = (ap->alen % mp->m_sb.sb_rextsize))) {
/*
* We're not covering the original request, or
* we won't be able to once we fix the length.
*/
else if (!ap->eof) {
xfs_fsblock_t gotbno; /* right side block number */
- xfs_fsblock_t gotdiff; /* right side difference */
+ xfs_fsblock_t gotdiff=0; /* right side difference */
xfs_fsblock_t prevbno; /* left side block number */
- xfs_fsblock_t prevdiff; /* left side difference */
+ xfs_fsblock_t prevdiff=0; /* left side difference */
/*
* If there's a previous (left) block, select a requested
do_div(ap->rval, mp->m_sb.sb_rextsize);
rtb = ap->rval;
ap->alen = ralen;
- if (error = xfs_rtallocate_extent(ap->tp, ap->rval, 1, ap->alen,
- &ralen, atype, ap->wasdel, prod, &rtb))
+ if ((error = xfs_rtallocate_extent(ap->tp, ap->rval, 1, ap->alen,
+ &ralen, atype, ap->wasdel, prod, &rtb)))
return error;
if (rtb == NULLFSBLOCK && prod > 1 &&
(error = xfs_rtallocate_extent(ap->tp, ap->rval, 1,
int isaligned;
xfs_extlen_t longest;
xfs_extlen_t need;
- xfs_extlen_t nextminlen;
+ xfs_extlen_t nextminlen=0;
int notinit;
xfs_perag_t *pag;
xfs_agnumber_t startag;
}
if (ap->ip->i_d.di_extsize) {
args.prod = ap->ip->i_d.di_extsize;
- if (args.mod = (xfs_extlen_t)do_mod(ap->off, args.prod))
+ if ((args.mod = (xfs_extlen_t)do_mod(ap->off, args.prod)))
args.mod = (xfs_extlen_t)(args.prod - args.mod);
} else if (mp->m_sb.sb_blocksize >= NBPP) {
args.prod = 1;
args.mod = 0;
} else {
args.prod = NBPP >> mp->m_sb.sb_blocklog;
- if (args.mod = (xfs_extlen_t)(do_mod(ap->off, args.prod)))
+ if ((args.mod = (xfs_extlen_t)(do_mod(ap->off, args.prod))))
args.mod = (xfs_extlen_t)(args.prod - args.mod);
}
/*
args.wasdel = ap->wasdel;
args.isfl = 0;
args.userdata = ap->userdata;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
if (tryagain && args.fsbno == NULLFSBLOCK) {
/*
args.minlen = nextminlen;
args.minalignslop = 0;
isaligned = 1;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
}
if (isaligned && args.fsbno == NULLFSBLOCK) {
args.type = atype;
args.fsbno = ap->rval;
args.alignment = 0;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
}
if (args.fsbno == NULLFSBLOCK && nullfb &&
args.minlen = ap->minlen;
args.type = XFS_ALLOCTYPE_START_BNO;
args.fsbno = ap->rval;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
}
if (args.fsbno == NULLFSBLOCK && nullfb) {
args.type = XFS_ALLOCTYPE_FIRST_AG;
args.total = ap->minlen;
args.minleft = 0;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
ap->low = 1;
}
pp = XFS_BMAP_BROOT_PTR_ADDR(rblock, 1, ifp->if_broot_bytes);
*logflagsp = 0;
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), 1))
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), 1)))
return error;
#endif
cbno = INT_GET(*pp, ARCH_CONVERT);
- if (error = xfs_btree_read_bufl(mp, tp, cbno, 0, &cbp,
- XFS_BMAP_BTREE_REF))
+ if ((error = xfs_btree_read_bufl(mp, tp, cbno, 0, &cbp,
+ XFS_BMAP_BTREE_REF)))
return error;
cblock = XFS_BUF_TO_BMBT_BLOCK(cbp);
- if (error = xfs_btree_check_lblock(cur, cblock, 0, cbp))
+ if ((error = xfs_btree_check_lblock(cur, cblock, 0, cbp)))
return error;
xfs_bmap_add_free(cbno, 1, cur->bc_private.b.flist, mp);
if (!async)
{
xfs_filblks_t da_new; /* new delay-alloc indirect blocks */
xfs_filblks_t da_old; /* old delay-alloc indirect blocks */
- xfs_fsblock_t del_endblock; /* first block past del */
+ xfs_fsblock_t del_endblock=0; /* first block past del */
xfs_fileoff_t del_endoff; /* first offset past del */
int delay; /* current block is delayed allocated */
int do_fx; /* free extent at end of routine */
do_div(bno, mp->m_sb.sb_rextsize);
len = del->br_blockcount;
do_div(len, mp->m_sb.sb_rextsize);
- if (error = xfs_rtfree_extent(ip->i_transp, bno,
- (xfs_extlen_t)len))
+ if ((error = xfs_rtfree_extent(ip->i_transp, bno,
+ (xfs_extlen_t)len)))
goto done;
do_fx = 0;
nblks = len * mp->m_sb.sb_rextsize;
*/
del_endblock = del->br_startblock + del->br_blockcount;
if (cur) {
- if (error = xfs_bmbt_lookup_eq(cur, got.br_startoff,
+ if ((error = xfs_bmbt_lookup_eq(cur, got.br_startoff,
got.br_startblock, got.br_blockcount,
- &i))
+ &i)))
goto done;
ASSERT(i == 1);
}
flags |= XFS_ILOG_FEXT(whichfork);
break;
}
- if (error = xfs_bmbt_delete(cur, iflags & XFS_BMAPI_ASYNC, &i))
+ if ((error = xfs_bmbt_delete(cur, iflags & XFS_BMAPI_ASYNC, &i)))
goto done;
ASSERT(i == 1);
break;
flags |= XFS_ILOG_FEXT(whichfork);
break;
}
- if (error = xfs_bmbt_update(cur, del_endoff, del_endblock,
+ if ((error = xfs_bmbt_update(cur, del_endoff, del_endblock,
got.br_blockcount - del->br_blockcount,
- got.br_state))
+ got.br_state)))
goto done;
break;
flags |= XFS_ILOG_FEXT(whichfork);
break;
}
- if (error = xfs_bmbt_update(cur, got.br_startoff,
+ if ((error = xfs_bmbt_update(cur, got.br_startoff,
got.br_startblock,
got.br_blockcount - del->br_blockcount,
- got.br_state))
+ got.br_state)))
goto done;
break;
new.br_startblock = del_endblock;
flags |= XFS_ILOG_CORE;
if (cur) {
- if (error = xfs_bmbt_update(cur,
+ if ((error = xfs_bmbt_update(cur,
got.br_startoff,
got.br_startblock, temp,
- got.br_state))
+ got.br_state)))
goto done;
- if (error = xfs_bmbt_increment(cur, 0, &i))
+ if ((error = xfs_bmbt_increment(cur, 0, &i)))
goto done;
cur->bc_rec.b = new;
error = xfs_bmbt_insert(cur, &i);
* Reset the cursor, don't trust
* it after any insert operation.
*/
- if (error = xfs_bmbt_lookup_eq(cur,
+ if ((error = xfs_bmbt_lookup_eq(cur,
got.br_startoff,
got.br_startblock,
- temp, &i))
+ temp, &i)))
goto done;
ASSERT(i == 1);
/*
* Update the btree record back
* to the original value.
*/
- if (error = xfs_bmbt_update(cur,
+ if ((error = xfs_bmbt_update(cur,
got.br_startoff,
got.br_startblock,
got.br_blockcount,
- got.br_state))
+ got.br_state)))
goto done;
/*
* Reset the extent record back
args.minalignslop = 0;
args.wasdel = wasdel;
*logflagsp = 0;
- if (error = xfs_alloc_vextent(&args)) {
+ if ((error = xfs_alloc_vextent(&args))) {
xfs_iroot_realloc(ip, -1, whichfork);
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
return error;
args.mod = args.minleft = args.alignment = args.wasdel =
args.isfl = args.minalignslop = 0;
args.minlen = args.maxlen = args.prod = 1;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
goto done;
/*
* Can't fail, the space was reserved.
* pointer (leftmost) at each level.
*/
while (level-- > 0) {
- if (error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
- XFS_BMAP_BTREE_REF))
+ if ((error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
+ XFS_BMAP_BTREE_REF)))
return error;
block = XFS_BUF_TO_BMBT_BLOCK(bp);
XFS_WANT_CORRUPTED_GOTO(
*/
if (bno == NULLFSBLOCK)
break;
- if (error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
- XFS_BMAP_BTREE_REF))
+ if ((error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
+ XFS_BMAP_BTREE_REF)))
return error;
block = XFS_BUF_TO_BMBT_BLOCK(bp);
}
ifp = XFS_IFORK_PTR(ip, whichfork);
ASSERT(ifp->if_ext_max ==
XFS_IFORK_SIZE(ip, whichfork) / (uint)sizeof(xfs_bmbt_rec_t));
- if (wr = (flags & XFS_BMAPI_WRITE) != 0)
+ if ((wr = (flags & XFS_BMAPI_WRITE)) != 0)
XFS_STATS_INC(xs_blk_mapw);
else
XFS_STATS_INC(xs_blk_mapr);
cur = NULL;
if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) {
ASSERT(wr && tp);
- if (error = xfs_bmap_local_to_extents(tp, ip, firstblock, total,
- &logflags, whichfork))
+ if ((error = xfs_bmap_local_to_extents(tp, ip, firstblock, total,
+ &logflags, whichfork)))
goto error0;
}
if (wr && *firstblock == NULLFSBLOCK) {
*/
if (mp->m_dalign && alen >= mp->m_dalign &&
userdata && whichfork == XFS_DATA_FORK) {
- if (error = xfs_bmap_isaeof(ip, aoff,
- whichfork, &bma.aeof))
+ if ((error = xfs_bmap_isaeof(ip, aoff,
+ whichfork, &bma.aeof)))
goto error0;
} else
bma.aeof = 0;
/*
* Call allocator.
*/
- if (error = xfs_bmap_alloc(&bma))
+ if ((error = xfs_bmap_alloc(&bma)))
goto error0;
/*
* Copy out result fields.
*/
abno = bma.rval;
- if (flist->xbf_low = bma.low)
+ if ((flist->xbf_low = bma.low))
minleft = 0;
alen = bma.alen;
aoff = bma.off;
{
xfs_bmbt_block_t *block; /* bmap btree block */
xfs_fsblock_t bno; /* fs-relative block number */
- xfs_buf_t *bp; /* buffer for block */
+ xfs_buf_t *bp; /* buffer for block */
int error; /* error return value */
#ifdef XFS_BMBT_TRACE
static char fname[] = "xfs_bmbt_delrec";
int i; /* loop counter */
int j; /* temp state */
xfs_bmbt_key_t key; /* bmap btree key */
- xfs_bmbt_key_t *kp; /* pointer to bmap btree key */
+ xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */
xfs_fsblock_t lbno; /* left sibling block number */
- xfs_buf_t *lbp; /* left buffer pointer */
+ xfs_buf_t *lbp; /* left buffer pointer */
xfs_bmbt_block_t *left; /* left btree block */
xfs_bmbt_key_t *lkp; /* left btree key */
xfs_bmbt_ptr_t *lpp; /* left address pointer */
- int lrecs; /* left record count */
+ int lrecs=0; /* left record count */
xfs_bmbt_rec_t *lrp; /* left record pointer */
xfs_mount_t *mp; /* file system mount point */
xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */
int ptr; /* key/record index */
xfs_fsblock_t rbno; /* right sibling block number */
- xfs_buf_t *rbp; /* right buffer pointer */
+ xfs_buf_t *rbp; /* right buffer pointer */
xfs_bmbt_block_t *right; /* right btree block */
xfs_bmbt_key_t *rkp; /* right btree key */
xfs_bmbt_rec_t *rp; /* pointer to bmap btree rec */
xfs_bmbt_ptr_t *rpp; /* right address pointer */
xfs_bmbt_block_t *rrblock; /* right-right btree block */
- xfs_buf_t *rrbp; /* right-right buffer pointer */
- int rrecs; /* right record count */
+ xfs_buf_t *rrbp; /* right-right buffer pointer */
+ int rrecs=0; /* right record count */
xfs_bmbt_rec_t *rrp; /* right record pointer */
xfs_btree_cur_t *tcur; /* temporary btree cursor */
}
block = xfs_bmbt_get_block(cur, level, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, level, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
pp = XFS_BMAP_PTR_IADDR(block, 1, cur);
#ifdef DEBUG
for (i = ptr; i < INT_GET(block->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(pp[i], ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i], ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
if (level == cur->bc_nlevels - 1) {
xfs_iroot_realloc(cur->bc_private.b.ip, -1,
cur->bc_private.b.whichfork);
- if (error = xfs_bmbt_killroot(cur, async)) {
+ if ((error = xfs_bmbt_killroot(cur, async))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
*/
if (lbno == NULLFSBLOCK && rbno == NULLFSBLOCK &&
level == cur->bc_nlevels - 2) {
- if (error = xfs_bmbt_killroot(cur, async)) {
+ if ((error = xfs_bmbt_killroot(cur, async))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
return 0;
}
ASSERT(rbno != NULLFSBLOCK || lbno != NULLFSBLOCK);
- if (error = xfs_btree_dup_cursor(cur, &tcur)) {
+ if ((error = xfs_btree_dup_cursor(cur, &tcur))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
if (rbno != NULLFSBLOCK) {
i = xfs_btree_lastrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_bmbt_increment(tcur, level, &i)) {
+ if ((error = xfs_bmbt_increment(tcur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
rbp = tcur->bc_bufs[level];
right = XFS_BUF_TO_BMBT_BLOCK(rbp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, right, level, rbp)) {
+ if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
bno = INT_GET(right->bb_leftsib, ARCH_CONVERT);
if (INT_GET(right->bb_numrecs, ARCH_CONVERT) - 1 >=
XFS_BMAP_BLOCK_IMINRECS(level, cur)) {
- if (error = xfs_bmbt_lshift(tcur, level, &i)) {
+ if ((error = xfs_bmbt_lshift(tcur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR);
tcur = NULL;
if (level > 0) {
- if (error = xfs_bmbt_decrement(cur,
- level, &i)) {
+ if ((error = xfs_bmbt_decrement(cur,
+ level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur,
ERROR);
goto error0;
if (lbno != NULLFSBLOCK) {
i = xfs_btree_firstrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_bmbt_decrement(tcur, level, &i)) {
+ if ((error = xfs_bmbt_decrement(tcur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
/*
* decrement to last in block
*/
- if (error = xfs_bmbt_decrement(tcur, level, &i)) {
+ if ((error = xfs_bmbt_decrement(tcur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
lbp = tcur->bc_bufs[level];
left = XFS_BUF_TO_BMBT_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, left, level, lbp)) {
+ if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
bno = INT_GET(left->bb_rightsib, ARCH_CONVERT);
if (INT_GET(left->bb_numrecs, ARCH_CONVERT) - 1 >=
XFS_BMAP_BLOCK_IMINRECS(level, cur)) {
- if (error = xfs_bmbt_rshift(tcur, level, &i)) {
+ if ((error = xfs_bmbt_rshift(tcur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
rbno = bno;
right = block;
rbp = bp;
- if (error = xfs_btree_read_bufl(mp, cur->bc_tp, lbno, 0, &lbp,
- XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, lbno, 0, &lbp,
+ XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
left = XFS_BUF_TO_BMBT_BLOCK(lbp);
- if (error = xfs_btree_check_lblock(cur, left, level, lbp)) {
+ if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
lbno = bno;
left = block;
lbp = bp;
- if (error = xfs_btree_read_bufl(mp, cur->bc_tp, rbno, 0, &rbp,
- XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, rbno, 0, &rbp,
+ XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
right = XFS_BUF_TO_BMBT_BLOCK(rbp);
- if (error = xfs_btree_check_lblock(cur, right, level, rbp)) {
+ if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
rpp = XFS_BMAP_PTR_IADDR(right, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
left->bb_rightsib = right->bb_rightsib; /* INT_: direct copy */
xfs_bmbt_log_block(cur, lbp, XFS_BB_RIGHTSIB | XFS_BB_NUMRECS);
if (INT_GET(left->bb_rightsib, ARCH_CONVERT) != NULLDFSBNO) {
- if (error = xfs_btree_read_bufl(mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufl(mp, cur->bc_tp,
INT_GET(left->bb_rightsib, ARCH_CONVERT), 0, &rrbp,
- XFS_BMAP_BTREE_REF)) {
+ XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
rrblock = XFS_BUF_TO_BMBT_BLOCK(rrbp);
- if (error = xfs_btree_check_lblock(cur, rrblock, level, rrbp)) {
+ if ((error = xfs_btree_check_lblock(cur, rrblock, level, rrbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
cur->bc_bufs[level] = lbp;
cur->bc_ptrs[level] += lrecs;
cur->bc_ra[level] = 0;
- } else if (error = xfs_bmbt_increment(cur, level + 1, &i)) {
+ } else if ((error = xfs_bmbt_increment(cur, level + 1, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
goto error0;
}
int *stat) /* no-go/done/continue */
{
xfs_bmbt_block_t *block; /* bmap btree block */
- xfs_buf_t *bp; /* buffer for block */
+ xfs_buf_t *bp; /* buffer for block */
int error; /* error return value */
#ifdef XFS_BMBT_TRACE
static char fname[] = "xfs_bmbt_insrec";
#endif
int i; /* loop index */
xfs_bmbt_key_t key; /* bmap btree key */
- xfs_bmbt_key_t *kp; /* pointer to bmap btree key */
+ xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */
int logflags; /* inode logging flags */
xfs_fsblock_t nbno; /* new block number */
struct xfs_btree_cur *ncur; /* new btree cursor */
int optr; /* old key/record index */
xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */
int ptr; /* key/record index */
- xfs_bmbt_rec_t *rp; /* pointer to bmap btree rec */
+ xfs_bmbt_rec_t *rp=NULL; /* pointer to bmap btree rec */
ASSERT(level < cur->bc_nlevels);
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
XFS_STATS_INC(xs_bmbt_insrec);
block = xfs_bmbt_get_block(cur, level, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, level, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
logflags);
block = xfs_bmbt_get_block(cur, level, &bp);
} else {
- if (error = xfs_bmbt_rshift(cur, level, &i)) {
+ if ((error = xfs_bmbt_rshift(cur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
if (i) {
/* nothing */
} else {
- if (error = xfs_bmbt_lshift(cur, level, &i)) {
+ if ((error = xfs_bmbt_lshift(cur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
if (i) {
optr = ptr = cur->bc_ptrs[level];
} else {
- if (error = xfs_bmbt_split(cur, level,
+ if ((error = xfs_bmbt_split(cur, level,
&nbno, &nkey, &ncur,
- &i)) {
+ &i))) {
XFS_BMBT_TRACE_CURSOR(cur,
ERROR);
return error;
block = xfs_bmbt_get_block(
cur, level, &bp);
#ifdef DEBUG
- if (error =
+ if ((error =
xfs_btree_check_lblock(cur,
- block, level, bp)) {
+ block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(
cur, ERROR);
return error;
pp = XFS_BMAP_PTR_IADDR(block, 1, cur);
#ifdef DEBUG
for (i = INT_GET(block->bb_numrecs, ARCH_CONVERT); i >= ptr; i--) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT),
- level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT),
+ level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
ovbcopy(&pp[ptr - 1], &pp[ptr], /* INT_: direct copy */
(INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*pp));
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, (xfs_bmbt_ptr_t)*bnop,
- level)) {
+ if ((error = xfs_btree_check_lptr(cur, (xfs_bmbt_ptr_t)*bnop,
+ level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
{
xfs_bmbt_block_t *block;
xfs_bmbt_block_t *cblock;
- xfs_buf_t *cbp;
+ xfs_buf_t *cbp;
xfs_bmbt_key_t *ckp;
xfs_bmbt_ptr_t *cpp;
#ifdef DEBUG
cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(cblock->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(cpp[i], ARCH_CONVERT), level - 1)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(cpp[i], ARCH_CONVERT), level - 1))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
STATIC void
xfs_bmbt_log_keys(
xfs_btree_cur_t *cur,
- xfs_buf_t *bp,
+ xfs_buf_t *bp,
int kfirst,
int klast)
{
STATIC void
xfs_bmbt_log_ptrs(
xfs_btree_cur_t *cur,
- xfs_buf_t *bp,
+ xfs_buf_t *bp,
int pfirst,
int plast)
{
xfs_lookup_t dir,
int *stat) /* success/failure */
{
- xfs_bmbt_block_t *block;
- xfs_buf_t *bp;
- xfs_daddr_t d;
+ xfs_bmbt_block_t *block=NULL;
+ xfs_buf_t *bp;
+ xfs_daddr_t d;
xfs_sfiloff_t diff;
int error; /* error return value */
#ifdef XFS_BMBT_TRACE
static char fname[] = "xfs_bmbt_lookup";
#endif
- xfs_fsblock_t fsbno;
+ xfs_fsblock_t fsbno=0;
int high;
int i;
- int keyno;
- xfs_bmbt_key_t *kkbase;
+ int keyno=0;
+ xfs_bmbt_key_t *kkbase=NULL;
xfs_bmbt_key_t *kkp;
- xfs_bmbt_rec_t *krbase;
+ xfs_bmbt_rec_t *krbase=NULL;
xfs_bmbt_rec_t *krp;
int level;
int low;
if (bp && XFS_BUF_ADDR(bp) != d)
bp = (xfs_buf_t *)0;
if (!bp) {
- if (error = xfs_btree_read_bufl(mp, tp, fsbno,
- 0, &bp, XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, tp, fsbno,
+ 0, &bp, XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
xfs_btree_setbuf(cur, level, bp);
block = XFS_BUF_TO_BMBT_BLOCK(bp);
- if (error = xfs_btree_check_lblock(cur, block,
- level, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block,
+ level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
keyno = 1;
pp = XFS_BMAP_PTR_IADDR(block, keyno, cur);
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
if (dir == XFS_LOOKUP_GE && keyno > INT_GET(block->bb_numrecs, ARCH_CONVERT) &&
INT_GET(block->bb_rightsib, ARCH_CONVERT) != NULLDFSBNO) {
cur->bc_ptrs[0] = keyno;
- if (error = xfs_bmbt_increment(cur, 0, &i)) {
+ if ((error = xfs_bmbt_increment(cur, 0, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
int i; /* loop counter */
#endif
xfs_bmbt_key_t key; /* bmap btree key */
- xfs_buf_t *lbp; /* left buffer pointer */
+ xfs_buf_t *lbp; /* left buffer pointer */
xfs_bmbt_block_t *left; /* left btree block */
- xfs_bmbt_key_t *lkp; /* left btree key */
+ xfs_bmbt_key_t *lkp=NULL; /* left btree key */
xfs_bmbt_ptr_t *lpp; /* left address pointer */
int lrecs; /* left record count */
- xfs_bmbt_rec_t *lrp; /* left record pointer */
+ xfs_bmbt_rec_t *lrp=NULL; /* left record pointer */
xfs_mount_t *mp; /* file system mount point */
- xfs_buf_t *rbp; /* right buffer pointer */
+ xfs_buf_t *rbp; /* right buffer pointer */
xfs_bmbt_block_t *right; /* right btree block */
- xfs_bmbt_key_t *rkp; /* right btree key */
- xfs_bmbt_ptr_t *rpp; /* right address pointer */
- xfs_bmbt_rec_t *rrp; /* right record pointer */
+ xfs_bmbt_key_t *rkp=NULL; /* right btree key */
+ xfs_bmbt_ptr_t *rpp=NULL; /* right address pointer */
+ xfs_bmbt_rec_t *rrp=NULL; /* right record pointer */
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
XFS_BMBT_TRACE_ARGI(cur, level);
rbp = cur->bc_bufs[level];
right = XFS_BUF_TO_BMBT_BLOCK(rbp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, right, level, rbp)) {
+ if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
return 0;
}
mp = cur->bc_mp;
- if (error = xfs_btree_read_bufl(mp, cur->bc_tp, INT_GET(right->bb_leftsib, ARCH_CONVERT), 0,
- &lbp, XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, INT_GET(right->bb_leftsib, ARCH_CONVERT), 0,
+ &lbp, XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
left = XFS_BUF_TO_BMBT_BLOCK(lbp);
- if (error = xfs_btree_check_lblock(cur, left, level, lbp)) {
+ if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
lpp = XFS_BMAP_PTR_IADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1, cur);
rpp = XFS_BMAP_PTR_IADDR(right, 1, cur);
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, INT_GET(*rpp, ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(*rpp, ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
if (level > 0) {
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT),
- level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT),
+ level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
INT_SET(key.br_startoff, ARCH_CONVERT, xfs_bmbt_get_startoff(rrp));
rkp = &key;
}
- if (error = xfs_bmbt_updkey(cur, rkp, level + 1)) {
+ if ((error = xfs_bmbt_updkey(cur, rkp, level + 1))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
#endif
int i; /* loop counter */
xfs_bmbt_key_t key; /* bmap btree key */
- xfs_buf_t *lbp; /* left buffer pointer */
+ xfs_buf_t *lbp; /* left buffer pointer */
xfs_bmbt_block_t *left; /* left btree block */
xfs_bmbt_key_t *lkp; /* left btree key */
xfs_bmbt_ptr_t *lpp; /* left address pointer */
xfs_bmbt_rec_t *lrp; /* left record pointer */
xfs_mount_t *mp; /* file system mount point */
- xfs_buf_t *rbp; /* right buffer pointer */
+ xfs_buf_t *rbp; /* right buffer pointer */
xfs_bmbt_block_t *right; /* right btree block */
xfs_bmbt_key_t *rkp; /* right btree key */
xfs_bmbt_ptr_t *rpp; /* right address pointer */
- xfs_bmbt_rec_t *rrp; /* right record pointer */
+ xfs_bmbt_rec_t *rrp=NULL; /* right record pointer */
struct xfs_btree_cur *tcur; /* temporary btree cursor */
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
lbp = cur->bc_bufs[level];
left = XFS_BUF_TO_BMBT_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, left, level, lbp)) {
+ if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
return 0;
}
mp = cur->bc_mp;
- if (error = xfs_btree_read_bufl(mp, cur->bc_tp, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0,
- &rbp, XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0,
+ &rbp, XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
right = XFS_BUF_TO_BMBT_BLOCK(rbp);
- if (error = xfs_btree_check_lblock(cur, right, level, rbp)) {
+ if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
rpp = XFS_BMAP_PTR_IADDR(right, 1, cur);
#ifdef DEBUG
for (i = INT_GET(right->bb_numrecs, ARCH_CONVERT) - 1; i >= 0; i--) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
ovbcopy(rkp, rkp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
ovbcopy(rpp, rpp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, INT_GET(*lpp, ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(*lpp, ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
xfs_btree_check_rec(XFS_BTNUM_BMAP, rrp, rrp + 1);
#endif
xfs_bmbt_log_block(cur, rbp, XFS_BB_NUMRECS);
- if (error = xfs_btree_dup_cursor(cur, &tcur)) {
+ if ((error = xfs_btree_dup_cursor(cur, &tcur))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
i = xfs_btree_lastrec(tcur, level);
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_bmbt_increment(tcur, level, &i)) {
+ if ((error = xfs_bmbt_increment(tcur, level, &i))) {
XFS_BMBT_TRACE_CURSOR(tcur, ERROR);
goto error1;
}
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
- if (error = xfs_bmbt_updkey(tcur, rkp, level + 1)) {
+ if ((error = xfs_bmbt_updkey(tcur, rkp, level + 1))) {
XFS_BMBT_TRACE_CURSOR(tcur, ERROR);
goto error1;
}
#endif
int i; /* loop counter */
xfs_fsblock_t lbno; /* left sibling block number */
- xfs_buf_t *lbp; /* left buffer pointer */
+ xfs_buf_t *lbp; /* left buffer pointer */
xfs_bmbt_block_t *left; /* left btree block */
xfs_bmbt_key_t *lkp; /* left btree key */
xfs_bmbt_ptr_t *lpp; /* left address pointer */
xfs_bmbt_rec_t *lrp; /* left record pointer */
- xfs_buf_t *rbp; /* right buffer pointer */
+ xfs_buf_t *rbp; /* right buffer pointer */
xfs_bmbt_block_t *right; /* right btree block */
xfs_bmbt_key_t *rkp; /* right btree key */
xfs_bmbt_ptr_t *rpp; /* right address pointer */
xfs_bmbt_block_t *rrblock; /* right-right btree block */
- xfs_buf_t *rrbp; /* right-right buffer pointer */
+ xfs_buf_t *rrbp; /* right-right buffer pointer */
xfs_bmbt_rec_t *rrp; /* right record pointer */
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return XFS_ERROR(ENOSPC);
}
- if (error = xfs_alloc_vextent(&args)) {
+ if ((error = xfs_alloc_vextent(&args))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
rbp = xfs_btree_get_bufl(args.mp, args.tp, args.fsbno, 0);
right = XFS_BUF_TO_BMBT_BLOCK(rbp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, left, level, rbp)) {
+ if ((error = xfs_btree_check_lblock(cur, left, level, rbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
rpp = XFS_BMAP_PTR_IADDR(right, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
xfs_bmbt_log_block(cur, rbp, XFS_BB_ALL_BITS);
xfs_bmbt_log_block(cur, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB);
if (INT_GET(right->bb_rightsib, ARCH_CONVERT) != NULLDFSBNO) {
- if (error = xfs_btree_read_bufl(args.mp, args.tp,
+ if ((error = xfs_btree_read_bufl(args.mp, args.tp,
INT_GET(right->bb_rightsib, ARCH_CONVERT), 0, &rrbp,
- XFS_BMAP_BTREE_REF)) {
+ XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
rrblock = XFS_BUF_TO_BMBT_BLOCK(rrbp);
- if (error = xfs_btree_check_lblock(cur, rrblock, level, rrbp)) {
+ if ((error = xfs_btree_check_lblock(cur, rrblock, level, rrbp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
cur->bc_ptrs[level] -= INT_GET(left->bb_numrecs, ARCH_CONVERT);
}
if (level + 1 < cur->bc_nlevels) {
- if (error = xfs_btree_dup_cursor(cur, curp)) {
+ if ((error = xfs_btree_dup_cursor(cur, curp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
int level)
{
xfs_bmbt_block_t *block;
- xfs_buf_t *bp;
+ xfs_buf_t *bp;
#ifdef DEBUG
int error;
#endif
for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) {
block = xfs_bmbt_get_block(cur, level, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, level, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
int *stat) /* success/failure */
{
xfs_bmbt_block_t *block;
- xfs_buf_t *bp;
+ xfs_buf_t *bp;
int error; /* error return value */
#ifdef XFS_BMBT_TRACE
static char fname[] = "xfs_bmbt_decrement";
}
block = xfs_bmbt_get_block(cur, level, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, level, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
mp = cur->bc_mp;
for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) {
fsbno = INT_GET(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
- if (error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
- XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
+ XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
lev--;
xfs_btree_setbuf(cur, lev, bp);
block = XFS_BUF_TO_BMBT_BLOCK(bp);
- if (error = xfs_btree_check_lblock(cur, block, lev, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
for (level = 0, i = 2; i == 2; level++) {
- if (error = xfs_bmbt_delrec(cur, level, async, &i)) {
+ if ((error = xfs_bmbt_delrec(cur, level, async, &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
if (i == 0) {
for (level = 1; level < cur->bc_nlevels; level++) {
if (cur->bc_ptrs[level] == 0) {
- if (error = xfs_bmbt_decrement(cur, level,
- &i)) {
+ if ((error = xfs_bmbt_decrement(cur, level,
+ &i))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
xfs_bmbt_get_block(
xfs_btree_cur_t *cur,
int level,
- xfs_buf_t **bpp)
+ xfs_buf_t **bpp)
{
xfs_ifork_t *ifp;
xfs_bmbt_block_t *rval;
int *stat) /* success/failure */
{
xfs_bmbt_block_t *block;
- xfs_buf_t *bp;
+ xfs_buf_t *bp;
int error; /* error return value */
#ifdef XFS_BMBT_TRACE
static char fname[] = "xfs_bmbt_increment";
xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA);
block = xfs_bmbt_get_block(cur, level, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, level, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
for (lev = level + 1; lev < cur->bc_nlevels; lev++) {
block = xfs_bmbt_get_block(cur, lev, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, lev, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
mp = cur->bc_mp;
for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) {
fsbno = INT_GET(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
- if (error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
- XFS_BMAP_BTREE_REF)) {
+ if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
+ XFS_BMAP_BTREE_REF))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
lev--;
xfs_btree_setbuf(cur, lev, bp);
block = XFS_BUF_TO_BMBT_BLOCK(bp);
- if (error = xfs_btree_check_lblock(cur, block, lev, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
ncur = (xfs_btree_cur_t *)0;
pcur = cur;
do {
- if (error = xfs_bmbt_insrec(pcur, level++, &nbno, &nrec, &ncur,
- &i)) {
+ if ((error = xfs_bmbt_insrec(pcur, level++, &nbno, &nrec, &ncur,
+ &i))) {
if (pcur != cur)
xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR);
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
void
xfs_bmbt_log_block(
xfs_btree_cur_t *cur,
- xfs_buf_t *bp,
+ xfs_buf_t *bp,
int fields)
{
int first;
void
xfs_bmbt_log_recs(
xfs_btree_cur_t *cur,
- xfs_buf_t *bp,
+ xfs_buf_t *bp,
int rfirst,
int rlast)
{
{
xfs_alloc_arg_t args; /* allocation arguments */
xfs_bmbt_block_t *block; /* bmap btree block */
- xfs_buf_t *bp; /* buffer for block */
+ xfs_buf_t *bp; /* buffer for block */
xfs_bmbt_block_t *cblock; /* child btree block */
xfs_bmbt_key_t *ckp; /* child key pointer */
xfs_bmbt_ptr_t *cpp; /* child ptr pointer */
args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
if (args.fsbno == NULLFSBLOCK) {
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
args.type = XFS_ALLOCTYPE_FIRST_AG;
else
args.type = XFS_ALLOCTYPE_NEAR_BNO;
- if (error = xfs_alloc_vextent(&args)) {
+ if ((error = xfs_alloc_vextent(&args))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(cblock->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_lptr(cur, INT_GET(pp[i], ARCH_CONVERT), level)) {
+ if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i], ARCH_CONVERT), level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
#endif
bcopy(pp, cpp, INT_GET(cblock->bb_numrecs, ARCH_CONVERT) * sizeof(*pp));
#ifdef DEBUG
- if (error = xfs_btree_check_lptr(cur, (xfs_bmbt_ptr_t)args.fsbno,
- level)) {
+ if ((error = xfs_btree_check_lptr(cur, (xfs_bmbt_ptr_t)args.fsbno,
+ level))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
xfs_exntst_t state)
{
xfs_bmbt_block_t *block;
- xfs_buf_t *bp;
+ xfs_buf_t *bp;
int error;
#ifdef XFS_BMBT_TRACE
static char fname[] = "xfs_bmbt_update";
(xfs_dfilblks_t)len, (int)state);
block = xfs_bmbt_get_block(cur, 0, &bp);
#ifdef DEBUG
- if (error = xfs_btree_check_lblock(cur, block, 0, bp)) {
+ if ((error = xfs_btree_check_lblock(cur, block, 0, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
return 0;
}
INT_SET(key.br_startoff, ARCH_CONVERT, off);
- if (error = xfs_bmbt_updkey(cur, &key, 1)) {
+ if ((error = xfs_bmbt_updkey(cur, &key, 1))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
return error;
}
XFS_FSB_SANITY_CHECK(mp, INT_GET(block->bb_rightsib, ARCH_CONVERT)));
if (XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK,
XFS_RANDOM_BTREE_CHECK_LBLOCK)) {
-#pragma mips_frequency_hint NEVER
if (bp)
xfs_buftrace("LBTREE ERROR", bp);
return XFS_ERROR(EFSCORRUPTED);
if (XFS_TEST_ERROR(!sblock_ok, cur->bc_mp,
XFS_ERRTAG_BTREE_CHECK_SBLOCK,
XFS_RANDOM_BTREE_CHECK_SBLOCK)) {
-#pragma mips_frequency_hint NEVER
if (bp)
xfs_buftrace("SBTREE ERROR", bp);
return XFS_ERROR(EFSCORRUPTED);
for (i = 0; i < new->bc_nlevels; i++) {
new->bc_ptrs[i] = cur->bc_ptrs[i];
new->bc_ra[i] = cur->bc_ra[i];
- if (bp = cur->bc_bufs[i]) {
- if (error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
- XFS_BUF_ADDR(bp), mp->m_bsize, 0, &bp)) {
-#pragma mips_frequency_hint NEVER
+ if ((bp = cur->bc_bufs[i])) {
+ if ((error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
+ XFS_BUF_ADDR(bp), mp->m_bsize, 0, &bp))) {
xfs_btree_del_cursor(new, error);
*ncur = NULL;
return error;
xfs_agi_t *agi; /* (I) allocation group inodespace */
xfs_btree_cur_t *cur; /* return value */
xfs_ifork_t *ifp; /* (I) inode fork pointer */
- int nlevels; /* number of levels in the btree */
+ int nlevels=0; /* number of levels in the btree */
ASSERT(xfs_btree_cur_zone != NULL);
/*
ASSERT(fsbno != NULLFSBLOCK);
d = XFS_FSB_TO_DADDR(mp, fsbno);
- if (error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
- mp->m_bsize, lock, &bp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
+ mp->m_bsize, lock, &bp))) {
return error;
}
ASSERT(!bp || !XFS_BUF_GETERROR(bp));
int refval) /* ref count value for buffer */
{
xfs_buf_t *bp; /* return value */
- xfs_daddr_t d; /* real disk block address */
+ xfs_daddr_t d; /* real disk block address */
int error;
ASSERT(agno != NULLAGNUMBER);
ASSERT(agbno != NULLAGBLOCK);
d = XFS_AGB_TO_DADDR(mp, agno, agbno);
- if (error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
- mp->m_bsize, lock, &bp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
+ mp->m_bsize, lock, &bp))) {
return error;
}
ASSERT(!bp || !XFS_BUF_GETERROR(bp));
xfs_da_state_blk_t *blk;
xfs_da_intnode_t *node;
xfs_da_node_entry_t *btree;
- xfs_dahash_t lasthash;
+ xfs_dahash_t lasthash=0;
int level, count;
level = path->active-1;
{
xfs_da_blkinfo_t *old_info, *new_info, *tmp_info;
xfs_da_args_t *args;
- int before, error;
+ int before=0, error;
xfs_dabuf_t *bp;
/*
xfs_da_blkinfo_t *info;
xfs_da_intnode_t *node;
xfs_da_args_t *args;
- xfs_dablk_t blkno;
+ xfs_dablk_t blkno=0;
int level, error;
/*
/*
* Find a spot in the file space to put the new block.
*/
- if (error = xfs_bmap_first_unused(tp, dp, count, &bno, w)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_bmap_first_unused(tp, dp, count, &bno, w))) {
return error;
}
if (w == XFS_DATA_FORK && XFS_DIR_IS_V2(mp))
*/
nmap = 1;
ASSERT(args->firstblock != NULL);
- if (error = xfs_bmapi(tp, dp, bno, count,
+ if ((error = xfs_bmapi(tp, dp, bno, count,
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|
XFS_BMAPI_CONTIG,
args->firstblock, args->total, &map, &nmap,
- args->flist)) {
-#pragma mips_frequency_hint NEVER
+ args->flist))) {
return error;
}
ASSERT(nmap <= 1);
* try without the CONTIG flag. Loop until we get it all.
*/
else if (nmap == 0 && count > 1) {
-#pragma mips_frequency_hint NEVER
mapp = kmem_alloc(sizeof(*mapp) * count, KM_SLEEP);
for (b = bno, mapi = 0; b < bno + count; ) {
nmap = MIN(XFS_BMAP_MAX_NMAP, count);
c = (int)(bno + count - b);
- if (error = xfs_bmapi(tp, dp, b, c,
+ if ((error = xfs_bmapi(tp, dp, b, c,
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|
XFS_BMAPI_METADATA,
args->firstblock, args->total,
- &mapp[mapi], &nmap, args->flist)) {
+ &mapp[mapi], &nmap, args->flist))) {
kmem_free(mapp, sizeof(*mapp) * count);
return error;
}
mapp[mapi - 1].br_blockcount;
}
} else {
-#pragma mips_frequency_hint NEVER
mapi = 0;
mapp = NULL;
}
if (got != count || mapp[0].br_startoff != bno ||
mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount !=
bno + count) {
-#pragma mips_frequency_hint NEVER
if (mapp != &map)
kmem_free(mapp, sizeof(*mapp) * count);
return XFS_ERROR(ENOSPC);
*/
if (w == XFS_DATA_FORK && XFS_DIR_IS_V1(mp)) {
ASSERT(mapi == 1);
- if (error = xfs_bmap_last_offset(tp, dp, &bno, w))
+ if ((error = xfs_bmap_last_offset(tp, dp, &bno, w)))
return error;
size = XFS_FSB_TO_B(mp, bno);
if (size != dp->i_d.di_size) {
* Read the last block in the btree space.
*/
last_blkno = (xfs_dablk_t)lastoff - mp->m_dirblkfsbs;
- if (error = xfs_da_read_buf(tp, ip, last_blkno, -1, &last_buf, w))
+ if ((error = xfs_da_read_buf(tp, ip, last_blkno, -1, &last_buf, w)))
return error;
/*
* Copy the last block into the dead buffer and log it.
/*
* If the moved block has a left sibling, fix up the pointers.
*/
- if (sib_blkno = INT_GET(dead_info->back, ARCH_CONVERT)) {
- if (error = xfs_da_read_buf(tp, ip, sib_blkno, -1, &sib_buf, w))
+ if ((sib_blkno = INT_GET(dead_info->back, ARCH_CONVERT))) {
+ if ((error = xfs_da_read_buf(tp, ip, sib_blkno, -1, &sib_buf, w)))
goto done;
sib_info = sib_buf->data;
if (INT_GET(sib_info->forw, ARCH_CONVERT) != last_blkno ||
/*
* If the moved block has a right sibling, fix up the pointers.
*/
- if (sib_blkno = INT_GET(dead_info->forw, ARCH_CONVERT)) {
- if (error = xfs_da_read_buf(tp, ip, sib_blkno, -1, &sib_buf, w))
+ if ((sib_blkno = INT_GET(dead_info->forw, ARCH_CONVERT))) {
+ if ((error = xfs_da_read_buf(tp, ip, sib_blkno, -1, &sib_buf, w)))
goto done;
sib_info = sib_buf->data;
if ( INT_GET(sib_info->back, ARCH_CONVERT) != last_blkno
* Walk down the tree looking for the parent of the moved block.
*/
for (;;) {
- if (error = xfs_da_read_buf(tp, ip, par_blkno, -1, &par_buf, w))
+ if ((error = xfs_da_read_buf(tp, ip, par_blkno, -1, &par_buf, w)))
goto done;
par_node = par_buf->data;
if (INT_GET(par_node->hdr.info.magic, ARCH_CONVERT) != XFS_DA_NODE_MAGIC ||
error = XFS_ERROR(EFSCORRUPTED);
goto done;
}
- if (error = xfs_da_read_buf(tp, ip, par_blkno, -1, &par_buf, w))
+ if ((error = xfs_da_read_buf(tp, ip, par_blkno, -1, &par_buf, w)))
goto done;
par_node = par_buf->data;
if (INT_GET(par_node->hdr.level, ARCH_CONVERT) != level ||
&done)) == ENOSPC) {
if (w != XFS_DATA_FORK)
goto done;
- if (error = xfs_da_swap_lastblock(args, &dead_blkno,
- &dead_buf))
+ if ((error = xfs_da_swap_lastblock(args, &dead_blkno,
+ &dead_buf)))
goto done;
} else if (error)
goto done;
* Adjust the directory size for version 1.
*/
if (w == XFS_DATA_FORK && XFS_DIR_IS_V1(mp)) {
- if (error = xfs_bmap_last_offset(tp, dp, &bno, w))
+ if ((error = xfs_bmap_last_offset(tp, dp, &bno, w)))
return error;
size = XFS_FSB_TO_B(dp->i_mount, bno);
if (size != dp->i_d.di_size) {
for (i = 0, off = bno; i < nmap; i++) {
if (mapp[i].br_startblock == HOLESTARTBLOCK ||
mapp[i].br_startblock == DELAYSTARTBLOCK) {
-#pragma mips_frequency_hint NEVER
return 0;
}
if (off != mapp[i].br_startoff) {
-#pragma mips_frequency_hint NEVER
return 0;
}
off += mapp[i].br_blockcount;
int caller,
inst_t *ra)
{
- xfs_buf_t *bp = 0;
- xfs_buf_t **bplist;
- int error;
+ xfs_buf_t *bp = 0;
+ xfs_buf_t **bplist;
+ int error=0;
int i;
xfs_bmbt_irec_t map;
xfs_bmbt_irec_t *mapp;
xfs_daddr_t mappedbno;
xfs_mount_t *mp;
- int nbplist;
+ int nbplist=0;
int nfsb;
int nmap;
xfs_dabuf_t *rbp;
if (nfsb == 1) {
xfs_fsblock_t fsb;
- if (error =
+ if ((error =
xfs_bmapi_single(trans, dp, whichfork, &fsb,
- (xfs_fileoff_t)bno)) {
-#pragma mips_frequency_hint NEVER
+ (xfs_fileoff_t)bno))) {
return error;
}
mapp = ↦
if (fsb == NULLFSBLOCK) {
-#pragma mips_frequency_hint NEVER
nmap = 0;
} else {
map.br_startblock = fsb;
nmap = 1;
}
} else {
-#pragma mips_frequency_hint NEVER
xfs_fsblock_t firstblock;
firstblock = NULLFSBLOCK;
mapp = kmem_alloc(sizeof(*mapp) * nfsb, KM_SLEEP);
nmap = nfsb;
- if (error = xfs_bmapi(trans, dp, (xfs_fileoff_t)bno,
+ if ((error = xfs_bmapi(trans, dp, (xfs_fileoff_t)bno,
nfsb,
XFS_BMAPI_METADATA |
XFS_BMAPI_AFLAG(whichfork),
- &firstblock, 0, mapp, &nmap, NULL))
+ &firstblock, 0, mapp, &nmap, NULL)))
goto exit0;
}
} else {
nmap = 1;
}
if (!xfs_da_map_covers_blocks(nmap, mapp, bno, nfsb)) {
-#pragma mips_frequency_hint NEVER
error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED);
goto exit0;
}
if (caller != 3 && nmap > 1) {
-#pragma mips_frequency_hint NEVER
bplist = kmem_alloc(sizeof(*bplist) * nmap, KM_SLEEP);
nbplist = 0;
} else
#endif
}
if (error) {
-#pragma mips_frequency_hint NEVER
if (bp)
xfs_trans_brelse(trans, bp);
goto exit1;
}
}
if (bplist) {
-#pragma mips_frequency_hint NEVER
bplist[nbplist++] = bp;
}
}
* Build a dabuf structure.
*/
if (bplist) {
-#pragma mips_frequency_hint NEVER
rbp = xfs_da_buf_make(nbplist, bplist, ra);
} else if (bp)
rbp = xfs_da_buf_make(1, &bp, ra);
(INT_GET(free->hdr.magic, ARCH_CONVERT) != XFS_DIR2_FREE_MAGIC),
mp, XFS_ERRTAG_DA_READ_BUF,
XFS_RANDOM_DA_READ_BUF)) {
-#pragma mips_frequency_hint NEVER
xfs_buftrace("DA READ ERROR", rbp->bps[0]);
error = XFS_ERROR(EFSCORRUPTED);
xfs_da_brelse(trans, rbp);
}
}
if (bplist) {
-#pragma mips_frequency_hint NEVER
kmem_free(bplist, sizeof(*bplist) * nmap);
}
if (mapp != &map) {
-#pragma mips_frequency_hint NEVER
kmem_free(mapp, sizeof(*mapp) * nfsb);
}
if (bpp)
args.trans = trans;
ASSERT((dir->i_d.di_mode & IFMT) == IFDIR);
- if (error = xfs_dir_ino_validate(trans->t_mountp, parent_dir->i_ino))
+ if ((error = xfs_dir_ino_validate(trans->t_mountp, parent_dir->i_ino)))
return error;
return(xfs_dir_shortform_create(&args, parent_dir->i_ino));
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
- if (retval = xfs_dir_ino_validate(trans->t_mountp, inum))
+ if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum)))
return (retval);
XFS_STATS_INC(xs_dir_create);
return(XFS_ERROR(EINVAL));
}
- if (retval = xfs_dir_ino_validate(trans->t_mountp, inum))
+ if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum)))
return retval;
/*
args.dp = dp;
args.trans = tp;
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
- if (error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino))) {
return error;
}
return xfs_dir2_sf_create(&args, pdp->i_ino);
int v; /* type-checking value */
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
- if (rval = xfs_dir_ino_validate(tp->t_mountp, inum)) {
-#pragma mips_frequency_hint NEVER
+ if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) {
return rval;
}
XFS_STATS_INC(xs_dir_create);
*/
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
rval = xfs_dir2_sf_addname(&args);
- else if (rval = xfs_dir2_isblock(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isblock(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_block_addname(&args);
- else if (rval = xfs_dir2_isleaf(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isleaf(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_leaf_addname(&args);
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
-#pragma mips_frequency_hint NEVER
return XFS_ERROR(EINVAL);
}
XFS_STATS_INC(xs_dir_lookup);
*/
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
rval = xfs_dir2_sf_lookup(&args);
- else if (rval = xfs_dir2_isblock(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isblock(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_block_lookup(&args);
- else if (rval = xfs_dir2_isleaf(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isleaf(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_leaf_lookup(&args);
*/
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
rval = xfs_dir2_sf_removename(&args);
- else if (rval = xfs_dir2_isblock(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isblock(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_block_removename(&args);
- else if (rval = xfs_dir2_isleaf(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isleaf(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_leaf_removename(&args);
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
-#pragma mips_frequency_hint NEVER
return XFS_ERROR(EINVAL);
}
- if (rval = xfs_dir_ino_validate(tp->t_mountp, inum)) {
-#pragma mips_frequency_hint NEVER
+ if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) {
return rval;
}
/*
*/
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
rval = xfs_dir2_sf_replace(&args);
- else if (rval = xfs_dir2_isblock(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isblock(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_block_replace(&args);
- else if (rval = xfs_dir2_isleaf(tp, dp, &v)) {
-#pragma mips_frequency_hint NEVER
+ else if ((rval = xfs_dir2_isleaf(tp, dp, &v))) {
return rval;
} else if (v)
rval = xfs_dir2_leaf_replace(&args);
/*
* Find the first hole for our block.
*/
- if (error = xfs_bmap_first_unused(tp, dp, count, &bno, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_bmap_first_unused(tp, dp, count, &bno, XFS_DATA_FORK))) {
return error;
}
nmap = 1;
/*
* Try mapping the new block contiguously (one extent).
*/
- if (error = xfs_bmapi(tp, dp, bno, count,
+ if ((error = xfs_bmapi(tp, dp, bno, count,
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
args->firstblock, args->total, &map, &nmap,
- args->flist)) {
-#pragma mips_frequency_hint NEVER
+ args->flist))) {
return error;
}
ASSERT(nmap <= 1);
* Try again with contiguous flag turned on.
*/
else if (nmap == 0 && count > 1) {
-#pragma mips_frequency_hint NEVER
xfs_fileoff_t b; /* current file offset */
/*
*/
nmap = MIN(XFS_BMAP_MAX_NMAP, count);
c = (int)(bno + count - b);
- if (error = xfs_bmapi(tp, dp, b, c,
+ if ((error = xfs_bmapi(tp, dp, b, c,
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA,
args->firstblock, args->total,
- &mapp[mapi], &nmap, args->flist)) {
+ &mapp[mapi], &nmap, args->flist))) {
kmem_free(mapp, sizeof(*mapp) * count);
return error;
}
* Didn't work.
*/
else {
-#pragma mips_frequency_hint NEVER
mapi = 0;
mapp = NULL;
}
if (got != count || mapp[0].br_startoff != bno ||
mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount !=
bno + count) {
-#pragma mips_frequency_hint NEVER
if (mapp != &map)
kmem_free(mapp, sizeof(*mapp) * count);
return XFS_ERROR(ENOSPC);
int rval; /* return value */
mp = dp->i_mount;
- if (rval = xfs_bmap_last_offset(tp, dp, &last, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((rval = xfs_bmap_last_offset(tp, dp, &last, XFS_DATA_FORK))) {
return rval;
}
rval = XFS_FSB_TO_B(mp, last) == mp->m_dirblksize;
int rval; /* return value */
mp = dp->i_mount;
- if (rval = xfs_bmap_last_offset(tp, dp, &last, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((rval = xfs_bmap_last_offset(tp, dp, &last, XFS_DATA_FORK))) {
return rval;
}
*vp = last == mp->m_dirleafblk + (1 << mp->m_sb.sb_dirblklog);
/*
* Unmap the fsblock(s).
*/
- if (error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
+ if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
- &done)) {
-#pragma mips_frequency_hint NEVER
+ &done))) {
/*
* ENOSPC actually can happen if we're in a removename with
* no space reservation, and the resulting block removal
if (dp->i_d.di_size > XFS_DIR2_DB_OFF_TO_BYTE(mp, db + 1, 0))
return 0;
bno = da;
- if (error = xfs_bmap_last_before(tp, dp, &bno, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_bmap_last_before(tp, dp, &bno, XFS_DATA_FORK))) {
/*
* This can't really happen unless there's kernel corruption.
*/
xfs_inode_t *dp; /* directory inode */
xfs_dir2_data_unused_t *dup; /* block unused entry */
int error; /* error return value */
- xfs_dir2_data_unused_t *enddup; /* unused at end of data */
+ xfs_dir2_data_unused_t *enddup=NULL; /* unused at end of data */
xfs_dahash_t hash; /* hash value of found entry */
int high; /* high index for binary srch */
int highstale; /* high stale index */
- int lfloghigh; /* last final leaf to log */
- int lfloglow; /* first final leaf to log */
+ int lfloghigh=0; /* last final leaf to log */
+ int lfloglow=0; /* first final leaf to log */
int len; /* length of the new entry */
int low; /* low index for binary srch */
int lowstale; /* low stale index */
- int mid; /* midpoint for binary srch */
+ int mid=0; /* midpoint for binary srch */
xfs_mount_t *mp; /* filesystem mount point */
int needlog; /* need to log header */
int needscan; /* need to rescan freespace */
/*
* Read the (one and only) directory block into dabuf bp.
*/
- if (error =
- xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error =
+ xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp, XFS_DATA_FORK))) {
return error;
}
ASSERT(bp != NULL);
* Check the magic number, corrupted if wrong.
*/
if (INT_GET(block->hdr.magic, ARCH_CONVERT) != XFS_DIR2_BLOCK_MAGIC) {
-#pragma mips_frequency_hint NEVER
xfs_da_brelse(tp, bp);
return XFS_ERROR(EFSCORRUPTED);
}
* to hold the new leaf too?
*/
if (INT_GET(dup->length, ARCH_CONVERT) < len + (uint)sizeof(*blp)) {
-#pragma mips_frequency_hint NEVER
/*
* Yes, we use the second-largest
* entry instead if it works.
* just check its length.
*/
if (INT_GET(dup->length, ARCH_CONVERT) < len) {
-#pragma mips_frequency_hint NEVER
dup = NULL;
}
}
* Will need to compact to make this work.
*/
else {
-#pragma mips_frequency_hint NEVER
/*
* Tag just before the first leaf entry.
*/
* If we don't have space for the new entry & leaf ...
*/
if (!dup) {
-#pragma mips_frequency_hint NEVER
/*
* Not trying to actually do anything, or don't have
* a space reservation: return no-space.
* XXX should be the one closest to mid but mid is not yet computed.
*/
if (compact) {
-#pragma mips_frequency_hint NEVER
int fromidx; /* source leaf index */
int toidx; /* target leaf index */
high = mid - 1;
}
while (mid >= 0 && INT_GET(blp[mid].hashval, ARCH_CONVERT) >= args->hashval) {
-#pragma mips_frequency_hint NEVER
mid--;
}
/*
* Get the buffer, look up the entry.
* If not found (ENOENT) then return, have no buffer.
*/
- if (error = xfs_dir2_block_lookup_int(args, &bp, &ent))
+ if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent)))
return error;
dp = args->dp;
mp = dp->i_mount;
/*
* Read the buffer, return error if we can't get it.
*/
- if (error =
- xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error =
+ xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp, XFS_DATA_FORK))) {
return error;
}
ASSERT(bp != NULL);
* Back up to the first one with the right hash value.
*/
while (mid > 0 && INT_GET(blp[mid - 1].hashval, ARCH_CONVERT) == args->hashval) {
-#pragma mips_frequency_hint NEVER
mid--;
}
/*
* Look up the entry in the block. Gets the buffer and entry index.
* It will always be there, the vnodeops level does a lookup first.
*/
- if (error = xfs_dir2_block_lookup_int(args, &bp, &ent)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent))) {
return error;
}
dp = args->dp;
* Lookup the entry in the directory. Get buffer and entry index.
* This will always succeed since the caller has already done a lookup.
*/
- if (error = xfs_dir2_block_lookup_int(args, &bp, &ent)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_block_lookup_int(args, &bp, &ent))) {
return error;
}
dp = args->dp;
bestsp = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT);
if (INT_GET(bestsp[INT_GET(ltp->bestcount, ARCH_CONVERT) - 1], ARCH_CONVERT) ==
mp->m_dirblksize - (uint)sizeof(block->hdr)) {
-#pragma mips_frequency_hint NEVER
- if (error =
+ if ((error =
xfs_dir2_leaf_trim_data(args, lbp,
- (xfs_dir2_db_t)(INT_GET(ltp->bestcount, ARCH_CONVERT) - 1)))
+ (xfs_dir2_db_t)(INT_GET(ltp->bestcount, ARCH_CONVERT) - 1))))
goto out;
} else {
error = 0;
if (dbp == NULL &&
(error = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &dbp,
XFS_DATA_FORK))) {
-#pragma mips_frequency_hint NEVER
goto out;
}
block = dbp->data;
error = xfs_da_shrink_inode(args, mp->m_dirleafblk, lbp);
lbp = NULL;
if (error) {
-#pragma mips_frequency_hint NEVER
goto out;
}
/*
* Bomb out if the shortform directory is way too short.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(mp));
return XFS_ERROR(EIO);
}
*/
error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, &blkno);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
/*
*/
error = xfs_dir2_data_init(args, blkno, &bp);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
block = bp->data;
{
xfs_dir2_dataptr_t addr; /* addr for leaf lookup */
xfs_dir2_data_free_t *bf; /* bestfree table */
- xfs_dir2_block_tail_t *btp; /* block tail */
+ xfs_dir2_block_tail_t *btp=NULL; /* block tail */
int count; /* count of entries found */
xfs_dir2_data_t *d; /* data block pointer */
xfs_dir2_data_entry_t *dep; /* data entry */
xfs_dahash_t hash; /* hash of current name */
int i; /* leaf index */
int lastfree; /* last entry was unused */
- xfs_dir2_leaf_entry_t *lep; /* block leaf entries */
+ xfs_dir2_leaf_entry_t *lep=NULL; /* block leaf entries */
xfs_mount_t *mp; /* filesystem mount point */
char *p; /* current data position */
int stale; /* count of stale leaves */
error = xfs_da_get_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, blkno), -1, &bp,
XFS_DATA_FORK);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
ASSERT(bp != NULL);
* This interface will only put blocks in the leaf/node range.
* Since that's empty now, we'll get the root (block 0 in range).
*/
- if (error = xfs_da_grow_inode(args, &blkno)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_grow_inode(args, &blkno))) {
return error;
}
ldb = XFS_DIR2_DA_TO_DB(mp, blkno);
/*
* Initialize the leaf block, get a buffer for it.
*/
- if (error = xfs_dir2_leaf_init(args, ldb, &lbp, XFS_DIR2_LEAF1_MAGIC)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_leaf_init(args, ldb, &lbp, XFS_DIR2_LEAF1_MAGIC))) {
return error;
}
ASSERT(lbp != NULL);
error = xfs_da_read_buf(tp, dp, mp->m_dirleafblk, -1, &lbp,
XFS_DATA_FORK);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
ASSERT(lbp != NULL);
*/
if ((char *)bestsp - (char *)&leaf->ents[INT_GET(leaf->hdr.count, ARCH_CONVERT)] < needbytes &&
INT_GET(leaf->hdr.stale, ARCH_CONVERT) > 1) {
-#pragma mips_frequency_hint NEVER
compact = 1;
}
/*
*/
else if ((char *)bestsp - (char *)&leaf->ents[INT_GET(leaf->hdr.count, ARCH_CONVERT)] <
needbytes) {
-#pragma mips_frequency_hint NEVER
/*
* Just checking or no space reservation, give up.
*/
* changed anything.
*/
if (args->total == 0 && use_block == -1) {
-#pragma mips_frequency_hint NEVER
xfs_da_brelse(tp, lbp);
return XFS_ERROR(ENOSPC);
}
* point later.
*/
if (compact) {
-#pragma mips_frequency_hint NEVER
xfs_dir2_leaf_compact_x1(lbp, &index, &lowstale, &highstale,
&lfloglow, &lfloghigh);
}
* a new one.
*/
if (use_block == -1) {
-#pragma mips_frequency_hint NEVER
/*
* Add the new data block.
*/
- if (error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE,
- &use_block)) {
+ if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE,
+ &use_block))) {
xfs_da_brelse(tp, lbp);
return error;
}
/*
* Initialize the block.
*/
- if (error = xfs_dir2_data_init(args, use_block, &dbp)) {
+ if ((error = xfs_dir2_data_init(args, use_block, &dbp))) {
xfs_da_brelse(tp, lbp);
return error;
}
* Just read that one in.
*/
else {
- if (error =
+ if ((error =
xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, use_block),
- -1, &dbp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ -1, &dbp, XFS_DATA_FORK))) {
xfs_da_brelse(tp, lbp);
return error;
}
leaf = bp->data;
if (INT_GET(leaf->hdr.stale, ARCH_CONVERT) == 0) {
-#pragma mips_frequency_hint NEVER
return;
}
/*
int keepstale; /* source index of kept stale */
xfs_dir2_leaf_t *leaf; /* leaf structure */
int lowstale; /* stale entry before index */
- int newindex; /* new insertion index */
+ int newindex=0; /* new insertion index */
int to; /* destination copy index */
leaf = bp->data;
error = xfs_da_get_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, bno), -1, &bp,
XFS_DATA_FORK);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
ASSERT(bp != NULL);
/*
* Look up name in the leaf block, returning both buffers and index.
*/
- if (error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) {
return error;
}
tp = args->trans;
/*
* Read the leaf block into the buffer.
*/
- if (error =
+ if ((error =
xfs_da_read_buf(tp, dp, mp->m_dirleafblk, -1, &lbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ XFS_DATA_FORK))) {
return error;
}
*lbpp = lbp;
if (newdb != curdb) {
if (dbp)
xfs_da_brelse(tp, dbp);
- if (error =
+ if ((error =
xfs_da_read_buf(tp, dp,
XFS_DIR2_DB_TO_DA(mp, newdb), -1, &dbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ XFS_DATA_FORK))) {
xfs_da_brelse(tp, lbp);
return error;
}
/*
* Lookup the leaf entry, get the leaf and data blocks read in.
*/
- if (error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) {
return error;
}
dp = args->dp;
*/
if (INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) ==
mp->m_dirblksize - (uint)sizeof(data->hdr)) {
-#pragma mips_frequency_hint NEVER
ASSERT(db != mp->m_dirdatablk);
- if (error = xfs_dir2_shrink_inode(args, db, dbp)) {
+ if ((error = xfs_dir2_shrink_inode(args, db, dbp))) {
/*
* Nope, can't get rid of it because it caused
* allocation of a bmap btree block to do so.
/*
* Look up the entry.
*/
- if (error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp))) {
return error;
}
dp = args->dp;
xfs_da_args_t *args, /* operation arguments */
xfs_dabuf_t *lbp) /* leaf buffer */
{
- xfs_dahash_t hash; /* hash from this entry */
+ xfs_dahash_t hash=0; /* hash from this entry */
xfs_dahash_t hashwant; /* hash value looking for */
int high; /* high leaf index */
int low; /* low leaf index */
xfs_dir2_leaf_t *leaf; /* leaf structure */
xfs_dir2_leaf_entry_t *lep; /* leaf entry */
- int mid; /* current leaf index */
+ int mid=0; /* current leaf index */
leaf = lbp->data;
#ifndef __KERNEL__
*/
if (hash == hashwant) {
while (mid > 0 && INT_GET(lep[mid - 1].hashval, ARCH_CONVERT) == hashwant) {
-#pragma mips_frequency_hint NEVER
mid--;
}
}
/*
* Read the offending data block. We need its buffer.
*/
- if (error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, db), -1, &dbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, db), -1, &dbp,
+ XFS_DATA_FORK))) {
return error;
}
#ifdef DEBUG
/*
* Get rid of the data block.
*/
- if (error = xfs_dir2_shrink_inode(args, db, dbp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_shrink_inode(args, db, dbp))) {
ASSERT(error != ENOSPC);
xfs_da_brelse(tp, dbp);
return error;
/*
* Get the last offset in the file.
*/
- if (error = xfs_bmap_last_offset(tp, dp, &fo, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_bmap_last_offset(tp, dp, &fo, XFS_DATA_FORK))) {
return error;
}
fo -= mp->m_dirblkfsbs;
* operations.
*/
while (fo > mp->m_dirfreeblk) {
- if (error = xfs_dir2_node_trim_free(args, fo, &rval)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_node_trim_free(args, fo, &rval))) {
return error;
}
if (rval)
/*
* Now find the block just before the freespace block.
*/
- if (error = xfs_bmap_last_before(tp, dp, &fo, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_bmap_last_before(tp, dp, &fo, XFS_DATA_FORK))) {
return error;
}
/*
/*
* Read the freespace block.
*/
- if (error = xfs_da_read_buf(tp, dp, mp->m_dirfreeblk, -1, &fbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_read_buf(tp, dp, mp->m_dirfreeblk, -1, &fbp,
+ XFS_DATA_FORK))) {
return error;
}
free = fbp->data;
*/
error = xfs_dir2_shrink_inode(args, XFS_DIR2_FREE_FIRSTDB(mp), fbp);
if (error) {
-#pragma mips_frequency_hint NEVER
/*
* This can't fail here because it can only happen when
* punching out the middle of an extent, and this is an
/*
* Add a freespace block to the directory.
*/
- if (error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fdb)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fdb))) {
return error;
}
ASSERT(fdb == XFS_DIR2_FREE_FIRSTDB(mp));
/*
* Get the buffer for the new freespace block.
*/
- if (error = xfs_da_get_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fdb), -1, &fbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_get_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fdb), -1, &fbp,
+ XFS_DATA_FORK))) {
return error;
}
ASSERT(fbp != NULL);
* a compact.
*/
if (INT_GET(leaf->hdr.count, ARCH_CONVERT) == XFS_DIR2_MAX_LEAF_ENTS(mp)) {
-#pragma mips_frequency_hint NEVER
if (INT_ISZERO(leaf->hdr.stale, ARCH_CONVERT))
return XFS_ERROR(ENOSPC);
compact = INT_GET(leaf->hdr.stale, ARCH_CONVERT) > 1;
* the entry closest to index.
*/
if (compact) {
-#pragma mips_frequency_hint NEVER
xfs_dir2_leaf_compact_x1(bp, &index, &lowstale, &highstale,
&lfloglow, &lfloghigh);
}
xfs_inode_t *dp; /* incore directory inode */
int error; /* error return value */
int fi; /* free entry index */
- xfs_dir2_free_t *free; /* free block structure */
+ xfs_dir2_free_t *free=NULL; /* free block structure */
int index; /* leaf entry index */
xfs_dir2_leaf_t *leaf; /* leaf structure */
- int length; /* length of new data entry */
+ int length=0; /* length of new data entry */
xfs_dir2_leaf_entry_t *lep; /* leaf entry */
xfs_mount_t *mp; /* filesystem mount point */
xfs_dir2_db_t newdb; /* new data block number */
curfdb = curbp ? state->extrablk.blkno : -1;
curdb = -1;
length = XFS_DIR2_DATA_ENTSIZE(args->namelen);
- if (free = (curbp ? curbp->data : NULL))
+ if ((free = (curbp ? curbp->data : NULL)))
ASSERT(INT_GET(free->hdr.magic, ARCH_CONVERT) == XFS_DIR2_FREE_MAGIC);
}
/*
/*
* Read the free block.
*/
- if (error = xfs_da_read_buf(tp, dp,
+ if ((error = xfs_da_read_buf(tp, dp,
XFS_DIR2_DB_TO_DA(mp,
newfdb),
-1, &curbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ XFS_DATA_FORK))) {
return error;
}
curfdb = newfdb;
* If it has room, return it.
*/
if (INT_GET(free->bests[fi], ARCH_CONVERT) == NULLDATAOFF) {
-#pragma mips_frequency_hint NEVER
return XFS_ERROR(EFSCORRUPTED);
}
if (INT_GET(free->bests[fi], ARCH_CONVERT) >= length) {
/*
* Read the data block.
*/
- if (error =
+ if ((error =
xfs_da_read_buf(tp, dp,
XFS_DIR2_DB_TO_DA(mp, newdb), -1,
- &curbp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ &curbp, XFS_DATA_FORK))) {
return error;
}
xfs_dir2_data_check(dp, curbp);
* If we are holding a buffer, give it back in case our caller
* finds it useful.
*/
- if (state->extravalid = (curbp != NULL)) {
+ if ((state->extravalid = (curbp != NULL))) {
state->extrablk.bp = curbp;
state->extrablk.index = -1;
/*
* Silently return if nothing to do.
*/
if (count == 0) {
-#pragma mips_frequency_hint NEVER
return;
}
tp = args->trans;
/*
* If the block order is wrong, swap the arguments.
*/
- if (swap = xfs_dir2_leafn_order(blk1->bp, blk2->bp)) {
-#pragma mips_frequency_hint NEVER
+ if ((swap = xfs_dir2_leafn_order(blk1->bp, blk2->bp))) {
xfs_da_state_blk_t *tmp; /* temp for block swap */
tmp = blk1;
* read in the free block.
*/
fdb = XFS_DIR2_DB_TO_FDB(mp, db);
- if (error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fdb),
- -1, &fbp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fdb),
+ -1, &fbp, XFS_DATA_FORK))) {
return error;
}
free = fbp->data;
* (usually).
*/
if (longest == mp->m_dirblksize - (uint)sizeof(data->hdr)) {
-#pragma mips_frequency_hint NEVER
/*
* Try to punch out the data block.
*/
* in the free block.
*/
if (data == NULL) {
-#pragma mips_frequency_hint NEVER
/*
* One less used entry in the free table.
*/
ASSERT(oldblk->magic == XFS_DIR2_LEAFN_MAGIC);
error = xfs_da_grow_inode(args, &blkno);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
/*
error = xfs_dir2_leaf_init(args, XFS_DIR2_DA_TO_DB(mp, blkno),
&newblk->bp, XFS_DIR2_LEAFN_MAGIC);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
newblk->blkno = blkno;
xfs_dir2_leafn_rebalance(state, oldblk, newblk);
error = xfs_da_blk_link(state, oldblk, newblk);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
/*
* to merge with the forward block unless it is NULL.
*/
if (count == 0) {
-#pragma mips_frequency_hint NEVER
/*
* Make altpath point to the block we want to keep and
* path point to the block we want to drop (this one).
/*
* Read the sibling leaf block.
*/
- if (error =
+ if ((error =
xfs_da_read_buf(state->args->trans, state->args->dp, blkno,
- -1, &bp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ -1, &bp, XFS_DATA_FORK))) {
return error;
}
ASSERT(bp != NULL);
error = xfs_da_path_shift(state, &state->path, forward, 0,
&rval);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
*action = rval ? 0 : 1;
if (error)
rval = error;
if (rval != ENOENT) {
-#pragma mips_frequency_hint NEVER
goto done;
}
/*
rval = xfs_dir2_node_addname_int(args,
state->extravalid ? &state->extrablk : NULL);
if (rval) {
-#pragma mips_frequency_hint NEVER
goto done;
}
blk = &state->path.blk[state->path.active - 1];
if (!args->justcheck)
xfs_da_fixhashpath(state, &state->path);
} else {
-#pragma mips_frequency_hint NEVER
/*
* It didn't work, we need to split the leaf block.
*/
xfs_dir2_db_t fbno; /* freespace block number */
xfs_dabuf_t *fbp; /* freespace buffer */
int findex; /* freespace entry index */
- xfs_dir2_db_t foundbno; /* found freespace block no */
+ xfs_dir2_db_t foundbno=0; /* found freespace block no */
int foundindex; /* found freespace entry idx */
- xfs_dir2_free_t *free; /* freespace block structure */
+ xfs_dir2_free_t *free=NULL; /* freespace block structure */
xfs_dir2_db_t ifbno; /* initial freespace block no */
xfs_dir2_db_t lastfbno; /* highest freespace block no */
int length; /* length of the new entry */
if (dbno == -1) {
xfs_fileoff_t fo; /* freespace block number */
- if (error = xfs_bmap_last_offset(tp, dp, &fo, XFS_DATA_FORK))
+ if ((error = xfs_bmap_last_offset(tp, dp, &fo, XFS_DATA_FORK)))
return error;
lastfbno = XFS_DIR2_DA_TO_DB(mp, (xfs_dablk_t)fo);
fbno = ifbno;
* This should be really rare, so there's no reason
* to avoid it.
*/
- if (error = xfs_da_read_buf(tp, dp,
+ if ((error = xfs_da_read_buf(tp, dp,
XFS_DIR2_DB_TO_DA(mp, fbno), -1, &fbp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ XFS_DATA_FORK))) {
return error;
}
if (fbp == NULL) {
-#pragma mips_frequency_hint NEVER
continue;
}
free = fbp->data;
* freeblock, we need to add a new freeblock.
*/
if (dbno == -1 && foundindex == -1) {
-#pragma mips_frequency_hint NEVER
/*
* Not allowed to allocate, so return failure.
*/
/*
* Add the new freeblock.
*/
- if (error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE,
- &fbno)) {
+ if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE,
+ &fbno))) {
return error;
}
/*
* Get a buffer for the new block.
*/
- if (error = xfs_da_get_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fbno),
- -1, &fbp, XFS_DATA_FORK)) {
+ if ((error = xfs_da_get_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fbno),
+ -1, &fbp, XFS_DATA_FORK))) {
return error;
}
ASSERT(fbp != NULL);
* go read the freeblock again.
*/
if (dbno == -1 && fbp == NULL) {
-#pragma mips_frequency_hint NEVER
/*
* We're going to use the empty slot we found before.
*/
findex = foundindex;
fbno = foundbno;
- if (error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fbno),
- -1, &fbp, XFS_DATA_FORK)) {
+ if ((error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, fbno),
+ -1, &fbp, XFS_DATA_FORK))) {
return error;
}
ASSERT(fbp != NULL);
* the freespace entries refer to it.
*/
if (dbno == -1) {
-#pragma mips_frequency_hint NEVER
/*
* Not allowed to allocate, return failure.
*/
if (fblk && fblk->bp)
fblk->bp = NULL;
fbno = XFS_DIR2_DB_TO_FDB(mp, dbno);
- if (error = xfs_da_read_buf(tp, dp,
+ if ((error = xfs_da_read_buf(tp, dp,
XFS_DIR2_DB_TO_DA(mp, fbno), -1, &fbp,
- XFS_DATA_FORK)) {
+ XFS_DATA_FORK))) {
xfs_da_buf_done(dbp);
return error;
}
/*
* Read the data block in.
*/
- if (error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, dbno),
- -1, &dbp, XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_read_buf(tp, dp, XFS_DIR2_DB_TO_DA(mp, dbno),
+ -1, &dbp, XFS_DATA_FORK))) {
if (fblk == NULL || fblk->bp == NULL)
xfs_da_buf_done(fbp);
return error;
*/
error = xfs_da_node_lookup_int(state, &rval);
if (error) {
-#pragma mips_frequency_hint NEVER
rval = error;
}
/*
* Didn't find it, upper layer screwed up.
*/
if (rval != EEXIST) {
-#pragma mips_frequency_hint NEVER
xfs_da_state_free(state);
return rval;
}
error = xfs_dir2_leafn_remove(args, blk->bp, blk->index,
&state->extrablk, &rval);
if (error) {
-#pragma mips_frequency_hint NEVER
return error;
}
/*
*/
error = xfs_da_node_lookup_int(state, &rval);
if (error) {
-#pragma mips_frequency_hint NEVER
rval = error;
}
/*
* Didn't find it, and we're holding a data block. Drop it.
*/
else if (state->extravalid) {
-#pragma mips_frequency_hint NEVER
xfs_da_brelse(args->trans, state->extrablk.bp);
state->extrablk.bp = NULL;
}
/*
* Read the freespace block.
*/
- if (error = xfs_da_read_buf(tp, dp, (xfs_dablk_t)fo, -1, &bp,
- XFS_DATA_FORK)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_da_read_buf(tp, dp, (xfs_dablk_t)fo, -1, &bp,
+ XFS_DATA_FORK))) {
return error;
}
free = bp->data;
/*
* Blow the block away.
*/
- if (error =
+ if ((error =
xfs_dir2_shrink_inode(args, XFS_DIR2_DA_TO_DB(mp, (xfs_dablk_t)fo),
- bp)) {
+ bp))) {
/*
* Can't fail with ENOSPC since that only happens with no
* space reservation, when breaking up an extent into two
xfs_mount_t *mp; /* mount structure pointer */
int namelen; /* total name bytes */
xfs_ino_t parent; /* parent inode number */
- int size; /* total computed size */
+ int size=0; /* total computed size */
mp = dp->i_mount;
block = kmem_alloc(mp->m_dirblksize, KM_SLEEP);
bcopy(bp->data, block, mp->m_dirblksize);
logflags = XFS_ILOG_CORE;
- if (error = xfs_dir2_shrink_inode(args, mp->m_dirdatablk, bp)) {
-#pragma mips_frequency_hint NEVER
+ if ((error = xfs_dir2_shrink_inode(args, mp->m_dirdatablk, bp))) {
ASSERT(error != ENOSPC);
goto out;
}
* Make sure the shortform value has some of its header.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* Do we have to change to 8 byte inodes?
*/
if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->hdr.i8count == 0) {
-#pragma mips_frequency_hint NEVER
/*
* Yes, adjust the entry size and the total size.
*/
if (new_isize > XFS_IFORK_DSIZE(dp) ||
(pick =
xfs_dir2_sf_addname_pick(args, objchange, &sfep, &offset)) == 0) {
-#pragma mips_frequency_hint NEVER
/*
* Just checking or no space reservation, it doesn't fit.
*/
*/
#if XFS_BIG_FILESYSTEMS
if (objchange) {
-#pragma mips_frequency_hint NEVER
return 2;
}
#else
* Bail out if the directory is way too short.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* Bail out if the directory is way too short.
*/
if (oldsize < offsetof(xfs_dir2_sf_hdr_t, parent)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* Didn't find it.
*/
if (i == sfp->hdr.count) {
-#pragma mips_frequency_hint NEVER
return XFS_ERROR(ENOENT);
}
/*
* Are we changing inode number size?
*/
if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) {
-#pragma mips_frequency_hint NEVER
if (sfp->hdr.i8count == 1)
xfs_dir2_sf_toino4(args);
else
xfs_inode_t *dp; /* incore directory inode */
int i; /* entry index */
#if XFS_BIG_FILESYSTEMS || defined(DEBUG)
- xfs_ino_t ino; /* entry old inode number */
+ xfs_ino_t ino=0; /* entry old inode number */
#endif
xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */
xfs_dir2_sf_t *sfp; /* shortform structure */
* Bail out if the shortform directory is way too small.
*/
if (dp->i_d.di_size < offsetof(xfs_dir2_sf_hdr_t, parent)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* New inode number is large, and need to convert to 8-byte inodes.
*/
if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->hdr.i8count == 0) {
-#pragma mips_frequency_hint NEVER
int error; /* error return value */
int newsize; /* new inode size */
* Didn't find it.
*/
if (i == sfp->hdr.count) {
-#pragma mips_frequency_hint NEVER
ASSERT(args->oknoent);
return XFS_ERROR(ENOENT);
}
*/
if (ino > XFS_DIR2_MAX_SHORT_INUM &&
args->inumber <= XFS_DIR2_MAX_SHORT_INUM) {
-#pragma mips_frequency_hint NEVER
/*
* And the old count was one, so need to convert to small.
*/
* failed part way through.
*/
if (dp->i_d.di_size < sizeof(xfs_dir_sf_hdr_t)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* failed part way through.
*/
if (dp->i_d.di_size < sizeof(xfs_dir_sf_hdr_t)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* failed part way through.
*/
if (dp->i_d.di_size < sizeof(xfs_dir_sf_hdr_t)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* failed part way through.
*/
if (dp->i_d.di_size < sizeof(xfs_dir_sf_hdr_t)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
* failed part way through.
*/
if (dp->i_d.di_size < sizeof(xfs_dir_sf_hdr_t)) {
-#pragma mips_frequency_hint NEVER
ASSERT(XFS_FORCED_SHUTDOWN(dp->i_mount));
return XFS_ERROR(EIO);
}
xfs_dir_leaf_hdr_t *hdr_s, *hdr_d;
xfs_mount_t *mp;
char *tmpbuffer;
- char *tmpbuffer2;
+ char *tmpbuffer2=NULL;
int rval;
int lbsize;
*/
if (musthave || justcheck) {
tmpbuffer2 = kmem_alloc(lbsize, KM_SLEEP);
- bcopy(bp->data, tmpbuffer2, lbsize);
+ bcopy(bp->data, tmpbuffer2, lbsize);
}
bzero(bp->data, lbsize);
xfs_alloc_arg_t args; /* allocation argument structure */
int blks_per_cluster; /* fs blocks per inode cluster */
xfs_btree_cur_t *cur; /* inode btree cursor */
- xfs_daddr_t d; /* disk addr of buffer */
+ xfs_daddr_t d; /* disk addr of buffer */
int error;
xfs_buf_t *fbuf; /* new free inodes' buffer */
xfs_dinode_t *free; /* new free inode structure */
* Allow space for the inode btree to split.
*/
args.minleft = XFS_IN_MAXLEVELS(args.mp) - 1;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
/*
args.alignment = args.mp->m_sb.sb_inoalignmt;
else
args.alignment = 1;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
}
for (thisino = newino;
thisino < newino + newlen;
thisino += XFS_INODES_PER_CHUNK) {
- if (error = xfs_inobt_lookup_eq(cur, thisino,
- XFS_INODES_PER_CHUNK, XFS_INOBT_ALL_FREE, &i)) {
+ if ((error = xfs_inobt_lookup_eq(cur, thisino,
+ XFS_INODES_PER_CHUNK, XFS_INOBT_ALL_FREE, &i))) {
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
return error;
}
ASSERT(i == 0);
- if (error = xfs_inobt_insert(cur, &i)) {
+ if ((error = xfs_inobt_insert(cur, &i))) {
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
return error;
}
* Try to allocate some new inodes in the allocation
* group.
*/
- if (error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced)) {
+ if ((error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced))) {
xfs_trans_brelse(tp, agbp);
if (error == ENOSPC) {
*inop = NULLFSINO;
if (cur->bc_nlevels == 1) {
int freecount = 0;
- if (error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &i))
+ if ((error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
do {
- if (error = xfs_inobt_get_rec(cur, &rec.ir_startino,
- &rec.ir_freecount, &rec.ir_free, &i, ARCH_NOCONVERT))
+ if ((error = xfs_inobt_get_rec(cur, &rec.ir_startino,
+ &rec.ir_freecount, &rec.ir_free, &i, ARCH_NOCONVERT)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
freecount += rec.ir_freecount;
- if (error = xfs_inobt_increment(cur, 0, &i))
+ if ((error = xfs_inobt_increment(cur, 0, &i)))
goto error0;
} while (i == 1);
* If in the same a.g. as the parent, try to get near the parent.
*/
if (pagno == agno) {
- if (error = xfs_inobt_lookup_le(cur, pagino, 0, 0, &i))
+ if ((error = xfs_inobt_lookup_le(cur, pagino, 0, 0, &i)))
goto error0;
if (i != 0 &&
(error = xfs_inobt_get_rec(cur, &rec.ir_startino,
* Duplicate the cursor, search left & right
* simultaneously.
*/
- if (error = xfs_btree_dup_cursor(cur, &tcur))
+ if ((error = xfs_btree_dup_cursor(cur, &tcur)))
goto error0;
/*
* Search left with tcur, back up 1 record.
*/
- if (error = xfs_inobt_decrement(tcur, 0, &i))
+ if ((error = xfs_inobt_decrement(tcur, 0, &i)))
goto error1;
doneleft = !i;
if (!doneleft) {
- if (error = xfs_inobt_get_rec(tcur,
+ if ((error = xfs_inobt_get_rec(tcur,
&trec.ir_startino,
&trec.ir_freecount,
- &trec.ir_free, &i, ARCH_NOCONVERT))
+ &trec.ir_free, &i, ARCH_NOCONVERT)))
goto error1;
XFS_WANT_CORRUPTED_GOTO(i == 1, error1);
}
/*
* Search right with cur, go forward 1 record.
*/
- if (error = xfs_inobt_increment(cur, 0, &i))
+ if ((error = xfs_inobt_increment(cur, 0, &i)))
goto error1;
doneright = !i;
if (!doneright) {
- if (error = xfs_inobt_get_rec(cur,
+ if ((error = xfs_inobt_get_rec(cur,
&rec.ir_startino,
&rec.ir_freecount,
- &rec.ir_free, &i, ARCH_NOCONVERT))
+ &rec.ir_free, &i, ARCH_NOCONVERT)))
goto error1;
XFS_WANT_CORRUPTED_GOTO(i == 1, error1);
}
* further left.
*/
if (useleft) {
- if (error = xfs_inobt_decrement(tcur, 0,
- &i))
+ if ((error = xfs_inobt_decrement(tcur, 0,
+ &i)))
goto error1;
doneleft = !i;
if (!doneleft) {
- if (error = xfs_inobt_get_rec(
+ if ((error = xfs_inobt_get_rec(
tcur,
&trec.ir_startino,
&trec.ir_freecount,
- &trec.ir_free, &i, ARCH_NOCONVERT))
+ &trec.ir_free, &i, ARCH_NOCONVERT)))
goto error1;
XFS_WANT_CORRUPTED_GOTO(i == 1,
error1);
* further right.
*/
else {
- if (error = xfs_inobt_increment(cur, 0,
- &i))
+ if ((error = xfs_inobt_increment(cur, 0,
+ &i)))
goto error1;
doneright = !i;
if (!doneright) {
- if (error = xfs_inobt_get_rec(
+ if ((error = xfs_inobt_get_rec(
cur,
&rec.ir_startino,
&rec.ir_freecount,
- &rec.ir_free, &i, ARCH_NOCONVERT))
+ &rec.ir_free, &i, ARCH_NOCONVERT)))
goto error1;
XFS_WANT_CORRUPTED_GOTO(i == 1,
error1);
* See if the most recently allocated block has any free.
*/
else if (INT_GET(agi->agi_newino, ARCH_CONVERT) != NULLAGINO) {
- if (error = xfs_inobt_lookup_eq(cur,
- INT_GET(agi->agi_newino, ARCH_CONVERT), 0, 0, &i))
+ if ((error = xfs_inobt_lookup_eq(cur,
+ INT_GET(agi->agi_newino, ARCH_CONVERT), 0, 0, &i)))
goto error0;
if (i == 1 &&
(error = xfs_inobt_get_rec(cur, &rec.ir_startino,
else {
if (error)
goto error0;
- if (error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &i))
+ if ((error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &i)))
goto error0;
ASSERT(i == 1);
for (;;) {
- if (error = xfs_inobt_get_rec(cur,
+ if ((error = xfs_inobt_get_rec(cur,
&rec.ir_startino,
&rec.ir_freecount, &rec.ir_free,
- &i, ARCH_NOCONVERT))
+ &i, ARCH_NOCONVERT)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
if (rec.ir_freecount > 0)
break;
- if (error = xfs_inobt_increment(cur, 0, &i))
+ if ((error = xfs_inobt_increment(cur, 0, &i)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
}
ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino + offset);
XFS_INOBT_CLR_FREE(&rec, offset, ARCH_NOCONVERT);
rec.ir_freecount--;
- if (error = xfs_inobt_update(cur, rec.ir_startino, rec.ir_freecount,
- rec.ir_free))
+ if ((error = xfs_inobt_update(cur, rec.ir_startino, rec.ir_freecount,
+ rec.ir_free)))
goto error0;
INT_MOD(agi->agi_freecount, ARCH_CONVERT, -1);
xfs_ialloc_log_agi(tp, agbp, XFS_AGI_FREECOUNT);
if (cur->bc_nlevels == 1) {
int freecount = 0;
- if (error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &i))
+ if ((error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &i)))
goto error0;
do {
- if (error = xfs_inobt_get_rec(cur, &rec.ir_startino,
- &rec.ir_freecount, &rec.ir_free, &i, ARCH_NOCONVERT))
+ if ((error = xfs_inobt_get_rec(cur, &rec.ir_startino,
+ &rec.ir_freecount, &rec.ir_free, &i, ARCH_NOCONVERT)))
goto error0;
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
freecount += rec.ir_freecount;
- if (error = xfs_inobt_increment(cur, 0, &i))
+ if ((error = xfs_inobt_increment(cur, 0, &i)))
goto error0;
} while (i == 1);
ASSERT(freecount == INT_GET(agi->agi_freecount, ARCH_CONVERT) ||
return error;
cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO,
(xfs_inode_t *)0, 0);
- if (error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))
+ if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i)))
goto error0;
- if (error = xfs_inobt_get_rec(cur, &chunk_agino, &chunk_cnt,
- &chunk_free, &i, ARCH_NOCONVERT))
+ if ((error = xfs_inobt_get_rec(cur, &chunk_agino, &chunk_cnt,
+ &chunk_free, &i, ARCH_NOCONVERT)))
goto error0;
if (i == 0)
error = XFS_ERROR(EINVAL);
ASSERT(agno != NULLAGNUMBER);
d = XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR);
- if (error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, 1, 0, &bp))
+ if ((error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, 1, 0, &bp)))
return error;
ASSERT(bp && !XFS_BUF_GETERROR(bp));
/*
int error; /* error return value */
int i; /* loop index */
xfs_inobt_key_t key; /* key value being inserted */
- xfs_inobt_key_t *kp; /* pointer to btree keys */
+ xfs_inobt_key_t *kp=NULL; /* pointer to btree keys */
xfs_agblock_t nbno; /* block number of allocated block */
xfs_btree_cur_t *ncur; /* new cursor to be used at next lvl */
xfs_inobt_key_t nkey; /* new key value, from split */
int optr; /* old ptr value */
xfs_inobt_ptr_t *pp; /* pointer to btree addresses */
int ptr; /* index in btree block for this rec */
- xfs_inobt_rec_t *rp; /* pointer to btree records */
+ xfs_inobt_rec_t *rp=NULL; /* pointer to btree records */
/*
* If we made it to the root level, allocate a new root block
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
/*
* Check that the new entry is being inserted in the right place.
/*
* First, try shifting an entry to the right neighbor.
*/
- if (error = xfs_inobt_rshift(cur, level, &i))
+ if ((error = xfs_inobt_rshift(cur, level, &i)))
return error;
if (i) {
/* nothing */
* Next, try shifting an entry to the left neighbor.
*/
else {
- if (error = xfs_inobt_lshift(cur, level, &i))
+ if ((error = xfs_inobt_lshift(cur, level, &i)))
return error;
if (i) {
optr = ptr = cur->bc_ptrs[level];
* re-set our variables because
* we could be in a different block now.
*/
- if (error = xfs_inobt_split(cur, level, &nbno,
- &nkey, &ncur, &i))
+ if ((error = xfs_inobt_split(cur, level, &nbno,
+ &nkey, &ncur, &i)))
return error;
if (i) {
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur,
- block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur,
+ block, level, bp)))
return error;
#endif
ptr = cur->bc_ptrs[level];
pp = XFS_INOBT_PTR_ADDR(block, 1, cur);
#ifdef DEBUG
for (i = INT_GET(block->bb_numrecs, ARCH_CONVERT); i >= ptr; i--) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT), level)))
return error;
}
#endif
* Now stuff the new data in, bump numrecs and log the new data.
*/
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, *bnop, level))
+ if ((error = xfs_btree_check_sptr(cur, *bnop, level)))
return error;
#endif
kp[ptr - 1] = key; /* INT_: struct copy */
{
xfs_agblock_t agbno; /* a.g. relative btree block number */
xfs_agnumber_t agno; /* allocation group number */
- xfs_inobt_block_t *block; /* current btree block */
+ xfs_inobt_block_t *block=NULL; /* current btree block */
int diff; /* difference for the current key */
int error; /* error return value */
- int keyno; /* current key number */
+ int keyno=0; /* current key number */
int level; /* level in the btree */
xfs_mount_t *mp; /* file system mount point */
* Need to get a new buffer. Read it, then
* set it in the cursor, releasing the old one.
*/
- if (error = xfs_btree_read_bufs(mp, cur->bc_tp,
- agno, agbno, 0, &bp, XFS_INO_BTREE_REF))
+ if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
+ agno, agbno, 0, &bp, XFS_INO_BTREE_REF)))
return error;
xfs_btree_setbuf(cur, level, bp);
/*
* Point to the btree block, now that we have the buffer
*/
block = XFS_BUF_TO_INOBT_BLOCK(bp);
- if (error = xfs_btree_check_sblock(cur, block, level,
- bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level,
+ bp)))
return error;
} else
block = XFS_BUF_TO_INOBT_BLOCK(bp);
*/
else {
int high; /* high entry number */
- xfs_inobt_key_t *kkbase;/* base of keys in block */
- xfs_inobt_rec_t *krbase;/* base of records in block */
+ xfs_inobt_key_t *kkbase=NULL;/* base of keys in block */
+ xfs_inobt_rec_t *krbase=NULL;/* base of records in block */
int low; /* low entry number */
/*
keyno = 1;
agbno = INT_GET(*XFS_INOBT_PTR_ADDR(block, keyno, cur), ARCH_CONVERT);
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, agbno, level))
+ if ((error = xfs_btree_check_sptr(cur, agbno, level)))
return error;
#endif
cur->bc_ptrs[level] = keyno;
int i;
cur->bc_ptrs[0] = keyno;
- if (error = xfs_inobt_increment(cur, 0, &i))
+ if ((error = xfs_inobt_increment(cur, 0, &i)))
return error;
ASSERT(i == 1);
*stat = 1;
xfs_inobt_key_t key; /* key value for leaf level upward */
xfs_buf_t *lbp; /* buffer for left neighbor block */
xfs_inobt_block_t *left; /* left neighbor btree block */
- xfs_inobt_key_t *lkp; /* key pointer for left block */
+ xfs_inobt_key_t *lkp=NULL; /* key pointer for left block */
xfs_inobt_ptr_t *lpp; /* address pointer for left block */
- xfs_inobt_rec_t *lrp; /* record pointer for left block */
+ xfs_inobt_rec_t *lrp=NULL; /* record pointer for left block */
int nrec; /* new number of left block entries */
xfs_buf_t *rbp; /* buffer for right (current) block */
xfs_inobt_block_t *right; /* right (current) btree block */
- xfs_inobt_key_t *rkp; /* key pointer for right block */
- xfs_inobt_ptr_t *rpp; /* address pointer for right block */
- xfs_inobt_rec_t *rrp; /* record pointer for right block */
+ xfs_inobt_key_t *rkp=NULL; /* key pointer for right block */
+ xfs_inobt_ptr_t *rpp=NULL; /* address pointer for right block */
+ xfs_inobt_rec_t *rrp=NULL; /* record pointer for right block */
/*
* Set up variables for this block as "right".
rbp = cur->bc_bufs[level];
right = XFS_BUF_TO_INOBT_BLOCK(rbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, right, level, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right, level, rbp)))
return error;
#endif
/*
/*
* Set up the left neighbor as "left".
*/
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.i.agno, INT_GET(right->bb_leftsib, ARCH_CONVERT), 0, &lbp,
- XFS_INO_BTREE_REF))
+ XFS_INO_BTREE_REF)))
return error;
left = XFS_BUF_TO_INOBT_BLOCK(lbp);
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
/*
* If it's full, it can't take another entry.
lpp = XFS_INOBT_PTR_ADDR(left, nrec, cur);
rpp = XFS_INOBT_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, INT_GET(*rpp, ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(*rpp, ARCH_CONVERT), level)))
return error;
#endif
*lpp = *rpp; /* INT_: no-change copy */
if (level > 0) {
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT),
- level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT),
+ level)))
return error;
}
#endif
/*
* Update the parent key values of right.
*/
- if (error = xfs_inobt_updkey(cur, rkp, level + 1))
+ if ((error = xfs_inobt_updkey(cur, rkp, level + 1)))
return error;
/*
* Slide the cursor value left one.
args.isfl = args.userdata = args.minalignslop = 0;
args.minlen = args.maxlen = args.prod = 1;
args.type = XFS_ALLOCTYPE_NEAR_BNO;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
/*
* None available, we fail.
bp = cur->bc_bufs[cur->bc_nlevels - 1];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, cur->bc_nlevels - 1, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, cur->bc_nlevels - 1, bp)))
return error;
#endif
if (INT_GET(block->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) {
lbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(lbp));
left = block;
rbno = INT_GET(left->bb_rightsib, ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
- rbno, 0, &rbp, XFS_INO_BTREE_REF))
+ if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
+ rbno, 0, &rbp, XFS_INO_BTREE_REF)))
return error;
bp = rbp;
right = XFS_BUF_TO_INOBT_BLOCK(rbp);
- if (error = xfs_btree_check_sblock(cur, right,
- cur->bc_nlevels - 1, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right,
+ cur->bc_nlevels - 1, rbp)))
return error;
nptr = 1;
} else {
rbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(rbp));
right = block;
lbno = INT_GET(right->bb_leftsib, ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
- lbno, 0, &lbp, XFS_INO_BTREE_REF))
+ if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
+ lbno, 0, &lbp, XFS_INO_BTREE_REF)))
return error;
bp = lbp;
left = XFS_BUF_TO_INOBT_BLOCK(lbp);
- if (error = xfs_btree_check_sblock(cur, left,
- cur->bc_nlevels - 1, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left,
+ cur->bc_nlevels - 1, lbp)))
return error;
nptr = 2;
}
xfs_inobt_block_t *right; /* right neighbor btree block */
xfs_inobt_key_t *rkp; /* key pointer for right block */
xfs_inobt_ptr_t *rpp; /* address pointer for right block */
- xfs_inobt_rec_t *rrp; /* record pointer for right block */
+ xfs_inobt_rec_t *rrp=NULL; /* record pointer for right block */
xfs_btree_cur_t *tcur; /* temporary cursor */
/*
lbp = cur->bc_bufs[level];
left = XFS_BUF_TO_INOBT_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
#endif
/*
/*
* Set up the right neighbor as "right".
*/
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.i.agno, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0, &rbp,
- XFS_INO_BTREE_REF))
+ XFS_INO_BTREE_REF)))
return error;
right = XFS_BUF_TO_INOBT_BLOCK(rbp);
- if (error = xfs_btree_check_sblock(cur, right, level, rbp))
+ if ((error = xfs_btree_check_sblock(cur, right, level, rbp)))
return error;
/*
* If it's full, it can't take another entry.
rpp = XFS_INOBT_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
for (i = INT_GET(right->bb_numrecs, ARCH_CONVERT) - 1; i >= 0; i--) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level)))
return error;
}
#endif
ovbcopy(rkp, rkp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
ovbcopy(rpp, rpp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
#ifdef DEBUG
- if (error = xfs_btree_check_sptr(cur, INT_GET(*lpp, ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(*lpp, ARCH_CONVERT), level)))
return error;
#endif
*rkp = *lkp; /* INT_: no change copy */
* Using a temporary cursor, update the parent key values of the
* block on the right.
*/
- if (error = xfs_btree_dup_cursor(cur, &tcur))
+ if ((error = xfs_btree_dup_cursor(cur, &tcur)))
return error;
xfs_btree_lastrec(tcur, level);
if ((error = xfs_inobt_increment(tcur, level, &i)) ||
args.isfl = args.userdata = args.minalignslop = 0;
args.minlen = args.maxlen = args.prod = 1;
args.type = XFS_ALLOCTYPE_NEAR_BNO;
- if (error = xfs_alloc_vextent(&args))
+ if ((error = xfs_alloc_vextent(&args)))
return error;
if (args.fsbno == NULLFSBLOCK) {
*stat = 0;
*/
left = XFS_BUF_TO_INOBT_BLOCK(lbp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, left, level, lbp))
+ if ((error = xfs_btree_check_sblock(cur, left, level, lbp)))
return error;
#endif
/*
rpp = XFS_INOBT_PTR_ADDR(right, 1, cur);
#ifdef DEBUG
for (i = 0; i < INT_GET(right->bb_numrecs, ARCH_CONVERT); i++) {
- if (error = xfs_btree_check_sptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level))
+ if ((error = xfs_btree_check_sptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level)))
return error;
}
#endif
xfs_inobt_block_t *rrblock; /* rr btree block */
xfs_buf_t *rrbp; /* buffer for rrblock */
- if (error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
+ if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
INT_GET(right->bb_rightsib, ARCH_CONVERT), 0, &rrbp,
- XFS_INO_BTREE_REF))
+ XFS_INO_BTREE_REF)))
return error;
rrblock = XFS_BUF_TO_INOBT_BLOCK(rrbp);
- if (error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))
+ if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp)))
return error;
INT_SET(rrblock->bb_leftsib, ARCH_CONVERT, args.agbno);
xfs_inobt_log_block(args.tp, rrbp, XFS_BB_LEFTSIB);
* the right block, no matter where this cursor was.
*/
if (level + 1 < cur->bc_nlevels) {
- if (error = xfs_btree_dup_cursor(cur, curp))
+ if ((error = xfs_btree_dup_cursor(cur, curp)))
return error;
(*curp)->bc_ptrs[level + 1]++;
}
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
#endif
ptr = cur->bc_ptrs[level];
*/
block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[level]);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level,
- cur->bc_bufs[level]))
+ if ((error = xfs_btree_check_sblock(cur, block, level,
+ cur->bc_bufs[level])))
return error;
#endif
/*
xfs_buf_t *bp; /* buffer containing btree block */
agbno = INT_GET(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.i.agno, agbno, 0, &bp,
- XFS_INO_BTREE_REF))
+ XFS_INO_BTREE_REF)))
return error;
lev--;
xfs_btree_setbuf(cur, lev, bp);
block = XFS_BUF_TO_INOBT_BLOCK(bp);
- if (error = xfs_btree_check_sblock(cur, block, lev, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, lev, bp)))
return error;
cur->bc_ptrs[lev] = INT_GET(block->bb_numrecs, ARCH_CONVERT);
}
ptr = cur->bc_ptrs[0];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, 0, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, 0, bp)))
return error;
#endif
/*
bp = cur->bc_bufs[level];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, level, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
return error;
#endif
/*
bp = cur->bc_bufs[lev];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, lev, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, lev, bp)))
return error;
#endif
if (++cur->bc_ptrs[lev] <= INT_GET(block->bb_numrecs, ARCH_CONVERT))
xfs_agblock_t agbno; /* block number of btree block */
agbno = INT_GET(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
- if (error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
+ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
cur->bc_private.i.agno, agbno, 0, &bp,
- XFS_INO_BTREE_REF))
+ XFS_INO_BTREE_REF)))
return error;
lev--;
xfs_btree_setbuf(cur, lev, bp);
block = XFS_BUF_TO_INOBT_BLOCK(bp);
- if (error = xfs_btree_check_sblock(cur, block, lev, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, lev, bp)))
return error;
cur->bc_ptrs[lev] = 1;
}
* Insert nrec/nbno into this level of the tree.
* Note if we fail, nbno will be null.
*/
- if (error = xfs_inobt_insrec(pcur, level++, &nbno, &nrec, &ncur,
- &i)) {
+ if ((error = xfs_inobt_insrec(pcur, level++, &nbno, &nrec, &ncur,
+ &i))) {
if (pcur != cur)
xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR);
return error;
bp = cur->bc_bufs[0];
block = XFS_BUF_TO_INOBT_BLOCK(bp);
#ifdef DEBUG
- if (error = xfs_btree_check_sblock(cur, block, 0, bp))
+ if ((error = xfs_btree_check_sblock(cur, block, 0, bp)))
return error;
#endif
/*
xfs_inobt_key_t key; /* key containing [ino] */
INT_SET(key.ir_startino, ARCH_CONVERT, ino);
- if (error = xfs_inobt_updkey(cur, &key, 1))
+ if ((error = xfs_inobt_updkey(cur, &key, 1)))
return error;
}
return 0;
* Calculate the difference between the value there
* and what we're looking for.
*/
- if (wdiff = (*b ^ want) & mask) {
+ if ((wdiff = (*b ^ want) & mask)) {
/*
* Different. Mark where we are and return.
*/
/*
* Compute difference between actual and desired value.
*/
- if (wdiff = *b ^ want) {
+ if ((wdiff = *b ^ want)) {
/*
* Different, mark where we are and return.
*/
/*
* Compute difference between actual and desired value.
*/
- if (wdiff = (*b ^ want) & mask) {
+ if ((wdiff = (*b ^ want) & mask)) {
/*
* Different, mark where we are and return.
*/
* Calculate the difference between the value there
* and what we're looking for.
*/
- if (wdiff = (*b ^ want) & mask) {
+ if ((wdiff = (*b ^ want) & mask)) {
/*
* Different. Mark where we are and return.
*/
/*
* Compute difference between actual and desired value.
*/
- if (wdiff = *b ^ want) {
+ if ((wdiff = *b ^ want)) {
/*
* Different, mark where we are and return.
*/
* If not ending on a word boundary, deal with the last
* (partial) word.
*/
- if (lastbit = len - i) {
+ if ((lastbit = len - i)) {
/*
* Calculate mask for all the relevant bits in this word.
*/
/*
* Compute difference between actual and desired value.
*/
- if (wdiff = (*b ^ want) & mask) {
+ if ((wdiff = (*b ^ want) & mask)) {
/*
* Different, mark where we are and return.
*/
* If not ending on a word boundary, deal with the last
* (partial) word.
*/
- if (lastbit = len - i) {
+ if ((lastbit = len - i)) {
/*
* Compute a mask of relevant bits.
*/