summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2006-04-01 02:43:06 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2006-04-01 02:43:06 +0000
commitdccd2930b7bf6167e9de50eabecc1b7d2348f992 (patch)
treebefb492ffefe8f55c35a1ebd5dcbb72a1a5b43bb /sys
parent66ba0ae50698db3a62ac54da8aa006a1f913164e (diff)
Correctly map blocks for FFS2 in ufs_bmaparray()
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ufs/ufs_bmap.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 09b25a5d6d1..b8f5aa7beb6 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_bmap.c,v 1.19 2005/12/28 20:48:18 pedro Exp $ */
+/* $OpenBSD: ufs_bmap.c,v 1.20 2006/04/01 02:43:05 pedro Exp $ */
/* $NetBSD: ufs_bmap.c,v 1.3 1996/02/09 22:36:00 christos Exp $ */
/*
@@ -103,7 +103,7 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, struct indir *ap,
struct mount *mp;
struct vnode *devvp;
struct indir a[NIADDR+1], *xap;
- daddr_t daddr;
+ ufs2_daddr_t daddr;
long metalbn;
int error, maxrun = 0, num;
@@ -187,6 +187,22 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, struct indir *ap,
}
}
+#ifdef FFS2
+ if (ip->i_ump->um_fstype == UM_UFS2) {
+ daddr = ((ufs2_daddr_t *)bp->b_data)[xap->in_off];
+ if (num == 1 && daddr && runp)
+ for (bn = xap->in_off + 1;
+ bn < MNINDIR(ump) && *runp < maxrun &&
+ is_sequential(ump,
+ ((ufs2_daddr_t *)bp->b_data)[bn - 1],
+ ((ufs2_daddr_t *)bp->b_data)[bn]);
+ ++bn, ++*runp);
+
+ continue;
+ }
+
+#endif /* FFS2 */
+
daddr = ((daddr_t *)bp->b_data)[xap->in_off];
if (num == 1 && daddr && runp)
for (bn = xap->in_off + 1;