mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-23 02:04:46 +00:00
Implement the async mount option for NFSv3. This makes NFS pretend that all
writes sent to the server were synchronous and therefore no commits are needed. This is the same as the vfs.nfs.async variable on the server but allows each client to choose whether to work this way. Also make the vfs.nfs.async variable do the 'right' thing for NFSv3, i.e. pretend that the write was synchronous.
This commit is contained in:
parent
6362924f25
commit
d1e963a50e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26418
|
@ -34,7 +34,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_serv.c,v 1.41 1997/05/10 16:12:03 dfr Exp $
|
||||
* $Id: nfs_serv.c,v 1.42 1997/05/10 16:59:36 dfr Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -861,7 +861,10 @@ nfsrv_write(nfsd, slp, procp, mrq)
|
|||
return (0);
|
||||
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
|
||||
*tl++ = txdr_unsigned(retlen);
|
||||
if (stable == NFSV3WRITE_UNSTABLE)
|
||||
/*
|
||||
* If nfs_async is set, then pretend the write was FILESYNC.
|
||||
*/
|
||||
if (stable == NFSV3WRITE_UNSTABLE && !nfs_async)
|
||||
*tl++ = txdr_unsigned(stable);
|
||||
else
|
||||
*tl++ = txdr_unsigned(NFSV3WRITE_FILESYNC);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
|
||||
* $Id: nfs_vnops.c,v 1.51 1997/05/20 08:06:31 dfr Exp $
|
||||
* $Id: nfs_vnops.c,v 1.52 1997/06/03 10:03:40 dfr Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1249,6 +1249,8 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
|
|||
tsiz -= len;
|
||||
}
|
||||
nfsmout:
|
||||
if (vp->v_mount->mnt_flag & MNT_ASYNC)
|
||||
committed = NFSV3WRITE_FILESYNC;
|
||||
*iomode = committed;
|
||||
if (error)
|
||||
uiop->uio_resid = tsiz;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
|
||||
* $Id: nfs_vnops.c,v 1.51 1997/05/20 08:06:31 dfr Exp $
|
||||
* $Id: nfs_vnops.c,v 1.52 1997/06/03 10:03:40 dfr Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1249,6 +1249,8 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
|
|||
tsiz -= len;
|
||||
}
|
||||
nfsmout:
|
||||
if (vp->v_mount->mnt_flag & MNT_ASYNC)
|
||||
committed = NFSV3WRITE_FILESYNC;
|
||||
*iomode = committed;
|
||||
if (error)
|
||||
uiop->uio_resid = tsiz;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_serv.c,v 1.41 1997/05/10 16:12:03 dfr Exp $
|
||||
* $Id: nfs_serv.c,v 1.42 1997/05/10 16:59:36 dfr Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -861,7 +861,10 @@ nfsrv_write(nfsd, slp, procp, mrq)
|
|||
return (0);
|
||||
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
|
||||
*tl++ = txdr_unsigned(retlen);
|
||||
if (stable == NFSV3WRITE_UNSTABLE)
|
||||
/*
|
||||
* If nfs_async is set, then pretend the write was FILESYNC.
|
||||
*/
|
||||
if (stable == NFSV3WRITE_UNSTABLE && !nfs_async)
|
||||
*tl++ = txdr_unsigned(stable);
|
||||
else
|
||||
*tl++ = txdr_unsigned(NFSV3WRITE_FILESYNC);
|
||||
|
|
Loading…
Reference in a new issue