Deleted Added
full compact
nfs_subs.c (9456) nfs_subs.c (9507)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
37 * $Id: nfs_subs.c,v 1.18 1995/06/28 12:01:05 davidg Exp $
37 * $Id: nfs_subs.c,v 1.19 1995/07/09 06:57:59 davidg Exp $
38 */
39
40/*
41 * These functions support the macros and help fiddle mbuf chains for
42 * the nfs op functions. They do things like create the rpc header and
43 * copy data between mbuf chains and uio lists.
44 */
45#include <sys/param.h>

--- 8 unchanged lines hidden (view full) ---

54#include <sys/stat.h>
55#include <sys/malloc.h>
56#ifdef VFS_LKM
57#include <sys/sysent.h>
58#include <sys/syscall.h>
59#endif
60
61#include <vm/vm.h>
38 */
39
40/*
41 * These functions support the macros and help fiddle mbuf chains for
42 * the nfs op functions. They do things like create the rpc header and
43 * copy data between mbuf chains and uio lists.
44 */
45#include <sys/param.h>

--- 8 unchanged lines hidden (view full) ---

54#include <sys/stat.h>
55#include <sys/malloc.h>
56#ifdef VFS_LKM
57#include <sys/sysent.h>
58#include <sys/syscall.h>
59#endif
60
61#include <vm/vm.h>
62#include <vm/vnode_pager.h>
62
63#include <nfs/rpcv2.h>
64#include <nfs/nfsproto.h>
65#include <nfs/nfsnode.h>
66#include <nfs/nfs.h>
67#include <nfs/xdr_subs.h>
68#include <nfs/nfsm_subs.h>
69#include <nfs/nfsmount.h>
70#include <nfs/nqnfs.h>
71#include <nfs/nfsrtt.h>
72
73#include <miscfs/specfs/specdev.h>
74
63
64#include <nfs/rpcv2.h>
65#include <nfs/nfsproto.h>
66#include <nfs/nfsnode.h>
67#include <nfs/nfs.h>
68#include <nfs/xdr_subs.h>
69#include <nfs/nfsm_subs.h>
70#include <nfs/nfsmount.h>
71#include <nfs/nqnfs.h>
72#include <nfs/nfsrtt.h>
73
74#include <miscfs/specfs/specdev.h>
75
75#include <vm/vnode_pager.h>
76
77#include <netinet/in.h>
78#ifdef ISO
79#include <netiso/iso.h>
80#endif
81
82/*
83 * Data items converted to xdr at startup, since they are constant
84 * This is kinda hokey, but may save a little time doing byte swaps

--- 1808 unchanged lines hidden (view full) ---

1893 if (err <= ELAST)
1894 return ((int)nfsrv_v2errmap[err - 1]);
1895 return (NFSERR_IO);
1896}
1897
1898int
1899nfsrv_vmio(struct vnode *vp) {
1900 vm_object_t object;
76#include <netinet/in.h>
77#ifdef ISO
78#include <netiso/iso.h>
79#endif
80
81/*
82 * Data items converted to xdr at startup, since they are constant
83 * This is kinda hokey, but may save a little time doing byte swaps

--- 1808 unchanged lines hidden (view full) ---

1892 if (err <= ELAST)
1893 return ((int)nfsrv_v2errmap[err - 1]);
1894 return (NFSERR_IO);
1895}
1896
1897int
1898nfsrv_vmio(struct vnode *vp) {
1899 vm_object_t object;
1901 vm_pager_t pager;
1902
1903 if ((vp == NULL) || (vp->v_type != VREG))
1904 return 1;
1905
1906retry:
1907 if ((vp->v_flag & VVMIO) == 0) {
1908 struct vattr vat;
1909 struct proc *p = curproc;

--- 8 unchanged lines hidden (view full) ---

1918 } else {
1919 if ((object = vp->v_object) &&
1920 (object->flags & OBJ_DEAD)) {
1921 tsleep(object, PVM, "nfdead", 0);
1922 goto retry;
1923 }
1924 if (!object)
1925 panic("nfsrv_vmio: VMIO object missing");
1900
1901 if ((vp == NULL) || (vp->v_type != VREG))
1902 return 1;
1903
1904retry:
1905 if ((vp->v_flag & VVMIO) == 0) {
1906 struct vattr vat;
1907 struct proc *p = curproc;

--- 8 unchanged lines hidden (view full) ---

1916 } else {
1917 if ((object = vp->v_object) &&
1918 (object->flags & OBJ_DEAD)) {
1919 tsleep(object, PVM, "nfdead", 0);
1920 goto retry;
1921 }
1922 if (!object)
1923 panic("nfsrv_vmio: VMIO object missing");
1926 pager = object->pager;
1927 if (!pager)
1928 panic("nfsrv_vmio: VMIO pager missing");
1929 (void) vm_object_lookup(pager);
1924 vm_object_reference(object);
1930 }
1931 return 0;
1932}
1933int
1934nfsrv_vput(struct vnode *vp) {
1935 if ((vp->v_flag & VVMIO) && vp->v_object) {
1936 vput(vp);
1937 vm_object_deallocate(vp->v_object);

--- 15 unchanged lines hidden ---
1925 }
1926 return 0;
1927}
1928int
1929nfsrv_vput(struct vnode *vp) {
1930 if ((vp->v_flag & VVMIO) && vp->v_object) {
1931 vput(vp);
1932 vm_object_deallocate(vp->v_object);

--- 15 unchanged lines hidden ---