diff options
author | Tor Egge <tegge@FreeBSD.org> | 2006-03-19 21:43:36 +0000 |
---|---|---|
committer | Tor Egge <tegge@FreeBSD.org> | 2006-03-19 21:43:36 +0000 |
commit | 7de3839d0ddba53272d35efe425248aa2a208cc2 (patch) | |
tree | 62885f3310d59355548c73b75827ccf24f094ff4 | |
parent | 30b3a49fab76b370ab9a1e12068d5b9ef6bd5928 (diff) |
Notes
-rw-r--r-- | sys/kern/vfs_cluster.c | 6 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 49 |
2 files changed, 39 insertions, 16 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 326682933cda..fb64a6e69a2e 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_object.h> #include <vm/vm_page.h> #include <sys/sysctl.h> +int softdep_wantrollbacks(struct buf *); #if defined(CLUSTERDEBUG) static int rcluster= 0; @@ -896,11 +897,6 @@ cluster_wbuild(vp, size, start_lbn, len) bremfree(tbp); tbp->b_flags &= ~B_DONE; } /* end of code for non-first buffers only */ - /* check for latent dependencies to be handled */ - if ((LIST_FIRST(&tbp->b_dep)) != NULL) { - tbp->b_iocmd = BIO_WRITE; - buf_start(tbp); - } /* * If the IO is via the VM then we do some * special VM hackery (yuck). Since the buffer's diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 2cc50181319e..fbc143c15d08 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1758,27 +1758,54 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp) { struct vnode *vp; int error; +#ifdef SOFTUPDATES + struct buf *tbp; +#endif vp = bo->__bo_vnode; if (bp->b_iocmd == BIO_WRITE) { -#ifdef SOFTUPDATES - if (LIST_FIRST(&bp->b_dep) != NULL) - buf_start(bp); -#endif if ((bp->b_flags & B_VALIDSUSPWRT) == 0 && bp->b_vp != NULL && bp->b_vp->v_mount != NULL && (bp->b_vp->v_mount->mnt_kern_flag & MNTK_SUSPENDED) != 0) panic("ffs_geom_strategy: bad I/O"); bp->b_flags &= ~B_VALIDSUSPWRT; if ((vp->v_vflag & VV_COPYONWRITE) && - vp->v_rdev->si_snapdata != NULL && - (error = (ffs_copyonwrite)(vp, bp)) != 0 && - error != EOPNOTSUPP) { - bp->b_error = error; - bp->b_ioflags |= BIO_ERROR; - bufdone(bp); - return; + vp->v_rdev->si_snapdata != NULL) { + if ((bp->b_flags & B_CLUSTER) != 0) { + TAILQ_FOREACH(tbp, &bp->b_cluster.cluster_head, + b_cluster.cluster_entry) { + error = ffs_copyonwrite(vp, tbp); + if (error != 0 && + error != EOPNOTSUPP) { + bp->b_error = error; + bp->b_ioflags |= BIO_ERROR; + bufdone(bp); + return; + } + } + } else { + error = ffs_copyonwrite(vp, bp); + if (error != 0 && error != EOPNOTSUPP) { + bp->b_error = error; + bp->b_ioflags |= BIO_ERROR; + bufdone(bp); + return; + } + } } +#ifdef SOFTUPDATES + if ((bp->b_flags & B_CLUSTER) != 0) { + TAILQ_FOREACH(tbp, &bp->b_cluster.cluster_head, + b_cluster.cluster_entry) { + if (LIST_FIRST(&tbp->b_dep) != NULL) + buf_start(tbp); + } + } else { + if (LIST_FIRST(&bp->b_dep) != NULL) + buf_start(bp); + } + +#endif } g_vfs_strategy(bo, bp); } |