diff options
Diffstat (limited to 'sys/fs/ext2fs/ext2_bmap.c')
| -rw-r--r-- | sys/fs/ext2fs/ext2_bmap.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/fs/ext2fs/ext2_bmap.c b/sys/fs/ext2fs/ext2_bmap.c index 480f423fb3bb..ea28bb05b5ff 100644 --- a/sys/fs/ext2fs/ext2_bmap.c +++ b/sys/fs/ext2fs/ext2_bmap.c @@ -163,7 +163,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, int *runp, int *runb) struct buf *bp; struct ext2mount *ump; struct mount *mp; - struct indir a[NIADDR + 1], *ap; + struct indir a[EXT2_NIADDR + 1], *ap; daddr_t daddr; e2fs_lbn_t metalbn; int error, num, maxrun = 0, bsize; @@ -198,7 +198,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, int *runp, int *runb) } else if (runp) { daddr_t bnb = bn; - for (++bn; bn < NDADDR && *runp < maxrun && + for (++bn; bn < EXT2_NDADDR && *runp < maxrun && is_sequential(ump, ip->i_db[bn - 1], ip->i_db[bn]); ++bn, ++*runp); bn = bnb; @@ -325,17 +325,18 @@ ext2_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump) if ((long)bn < 0) bn = -(long)bn; - /* The first NDADDR blocks are direct blocks. */ - if (bn < NDADDR) + /* The first EXT2_NDADDR blocks are direct blocks. */ + if (bn < EXT2_NDADDR) return (0); /* * Determine the number of levels of indirection. After this loop * is done, blockcnt indicates the number of data blocks possible - * at the previous level of indirection, and NIADDR - i is the number - * of levels of indirection needed to locate the requested block. + * at the previous level of indirection, and EXT2_NIADDR - i is the + * number of levels of indirection needed to locate the requested block. */ - for (blockcnt = 1, i = NIADDR, bn -= NDADDR;; i--, bn -= blockcnt) { + for (blockcnt = 1, i = EXT2_NIADDR, bn -= EXT2_NDADDR; ; + i--, bn -= blockcnt) { if (i == 0) return (EFBIG); /* @@ -351,9 +352,9 @@ ext2_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump) /* Calculate the address of the first meta-block. */ if (realbn >= 0) - metalbn = -(realbn - bn + NIADDR - i); + metalbn = -(realbn - bn + EXT2_NIADDR - i); else - metalbn = -(-realbn - bn + NIADDR - i); + metalbn = -(-realbn - bn + EXT2_NIADDR - i); /* * At each iteration, off is the offset into the bap array which is @@ -362,9 +363,9 @@ ext2_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump) * into the argument array. */ ap->in_lbn = metalbn; - ap->in_off = off = NIADDR - i; + ap->in_off = off = EXT2_NIADDR - i; ap++; - for (++numlevels; i <= NIADDR; i++) { + for (++numlevels; i <= EXT2_NIADDR; i++) { /* If searching for a meta-data block, quit when found. */ if (metalbn == realbn) break; |
