From 961da2716b4ac7633f529739b4599698e7252872 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 27 Sep 2004 19:14:10 +0000 Subject: [PATCH] Give cluster_write() an explicit vnode argument. In the future a struct buf will not automatically point out a vnode for us. --- sys/gnu/ext2fs/ext2_readwrite.c | 2 +- sys/gnu/fs/ext2fs/ext2_readwrite.c | 2 +- sys/kern/vfs_cluster.c | 7 +------ sys/sys/buf.h | 2 +- sys/ufs/ffs/ffs_vnops.c | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c index 50fae6b84119..6194911942f5 100644 --- a/sys/gnu/ext2fs/ext2_readwrite.c +++ b/sys/gnu/ext2fs/ext2_readwrite.c @@ -272,7 +272,7 @@ WRITE(ap) } else if (xfersize + blkoffset == fs->s_frag_size) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; - cluster_write(bp, ip->i_size, seqcount); + cluster_write(vp, bp, ip->i_size, seqcount); } else { bawrite(bp); } diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c index 50fae6b84119..6194911942f5 100644 --- a/sys/gnu/fs/ext2fs/ext2_readwrite.c +++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c @@ -272,7 +272,7 @@ WRITE(ap) } else if (xfersize + blkoffset == fs->s_frag_size) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; - cluster_write(bp, ip->i_size, seqcount); + cluster_write(vp, bp, ip->i_size, seqcount); } else { bawrite(bp); } diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 453831fe0a4f..3eadf00acc3f 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -603,18 +603,13 @@ cluster_wbuild_wb(struct vnode *vp, long size, daddr_t start_lbn, int len) * 4. end of a cluster - asynchronously write cluster */ void -cluster_write(bp, filesize, seqcount) - struct buf *bp; - u_quad_t filesize; - int seqcount; +cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount) { - struct vnode *vp; daddr_t lbn; int maxclen, cursize; int lblocksize; int async; - vp = bp->b_vp; if (vp->v_type == VREG) { async = vp->v_mount->mnt_flag & MNT_ASYNC; lblocksize = vp->v_mount->mnt_stat.f_iosize; diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 1494fbc00650..c88f6f58d5b3 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -507,7 +507,7 @@ void cluster_callback(struct buf *); int cluster_read(struct vnode *, u_quad_t, daddr_t, long, struct ucred *, long, int, struct buf **); int cluster_wbuild(struct vnode *, long, daddr_t, int); -void cluster_write(struct buf *, u_quad_t, int); +void cluster_write(struct vnode *, struct buf *, u_quad_t, int); void vfs_bio_set_validclean(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); void vfs_busy_pages(struct buf *, int clear_modify); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 4f446880cd96..616f9e8186dc 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -699,7 +699,7 @@ ffs_write(ap) } else if (xfersize + blkoffset == fs->fs_bsize) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; - cluster_write(bp, ip->i_size, seqcount); + cluster_write(vp, bp, ip->i_size, seqcount); } else { bawrite(bp); }