diff options
author | dillon <dillon@FreeBSD.org> | 1999-09-17 05:57:57 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-09-17 05:57:57 +0000 |
commit | 581716d4dfa79a615e2d311e2da0b1eca85bb5b6 (patch) | |
tree | ca5c480c585acbc3d10eb3b4ab470a7596253dbb /sys/nfs/nfs_vnops.c | |
parent | 4c1e280de7db1d524317194a371a5d246f0f5cfa (diff) | |
download | FreeBSD-src-581716d4dfa79a615e2d311e2da0b1eca85bb5b6.zip FreeBSD-src-581716d4dfa79a615e2d311e2da0b1eca85bb5b6.tar.gz |
Asynchronized client-side nfs_commit. NFS commit operations were
previously issued synchronously even if async daemons (nfsiod's) were
available. The commit has been moved from the strategy code to the doio
code in order to asynchronize it.
Removed use of lastr in preparation for removal of vnode->v_lastr. It
has been replaced with seqcount, which is already supported by the system
and, in fact, gives us a better heuristic for sequential detection then
lastr ever did.
Made major performance improvements to the server side commit. The
server previously fsync'd the entire file for each commit rpc. The
server now bawrite()s only those buffers related to the offset/size
specified in the commit rpc.
Note that we do not commit the meta-data yet. This works still needs
to be done.
Note that a further optimization can be done (and has not yet been done)
on the client: we can merge multiple potential commit rpc's into a
single rpc with a greater file offset/size range and greatly reduce
rpc traffic.
Reviewed by: Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com>
Diffstat (limited to 'sys/nfs/nfs_vnops.c')
-rw-r--r-- | sys/nfs/nfs_vnops.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index f7250cc..370a33d 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -220,8 +220,6 @@ static struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc = { &fifo_nfsv2nodeop_p, nfsv2_fifoop_entries }; VNODEOP_SET(fifo_nfsv2nodeop_opv_desc); -static int nfs_commit __P((struct vnode *vp, u_quad_t offset, int cnt, - struct ucred *cred, struct proc *procp)); static int nfs_mknodrpc __P((struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap)); @@ -2587,9 +2585,9 @@ nfs_lookitup(dvp, name, len, cred, procp, npp) /* * Nfs Version 3 commit rpc */ -static int +int nfs_commit(vp, offset, cnt, cred, procp) - register struct vnode *vp; + struct vnode *vp; u_quad_t offset; int cnt; struct ucred *cred; @@ -3076,8 +3074,10 @@ nfs_writebp(bp, force, procp) { int s; int oldflags = bp->b_flags; +#if 0 int retv = 1; off_t off; +#endif if (BUF_REFCNT(bp) == 0) panic("bwrite: buffer is not locked???"); @@ -3101,12 +3101,16 @@ nfs_writebp(bp, force, procp) curproc->p_stats->p_ru.ru_oublock++; splx(s); + vfs_busy_pages(bp, 1); +#if 0 + /* + * XXX removed, moved to nfs_doio XXX + */ /* * If B_NEEDCOMMIT is set, a commit rpc may do the trick. If not * an actual write will have to be scheduled via. VOP_STRATEGY(). * If B_WRITEINPROG is already set, then push it with a write anyhow. */ - vfs_busy_pages(bp, 1); if ((oldflags & (B_NEEDCOMMIT | B_WRITEINPROG)) == B_NEEDCOMMIT) { off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff; bp->b_flags |= B_WRITEINPROG; @@ -3121,12 +3125,11 @@ nfs_writebp(bp, force, procp) nfs_clearcommit(bp->b_vp->v_mount); } } - if (retv) { - if (force) - bp->b_flags |= B_WRITEINPROG; - BUF_KERNPROC(bp); - VOP_STRATEGY(bp->b_vp, bp); - } +#endif + if (force) + bp->b_flags |= B_WRITEINPROG; + BUF_KERNPROC(bp); + VOP_STRATEGY(bp->b_vp, bp); if( (oldflags & B_ASYNC) == 0) { int rtval = biowait(bp); |