nfs.h revision 1.1.1.1.6.2 1 1.1.1.1.6.2 yamt /* $NetBSD: nfs.h,v 1.1.1.1.6.2 2014/05/22 11:41:00 yamt Exp $ */
2 1.1.1.1.6.2 yamt /*-
3 1.1.1.1.6.2 yamt * Copyright (c) 1989, 1993
4 1.1.1.1.6.2 yamt * The Regents of the University of California. All rights reserved.
5 1.1.1.1.6.2 yamt *
6 1.1.1.1.6.2 yamt * This code is derived from software contributed to Berkeley by
7 1.1.1.1.6.2 yamt * Rick Macklem at The University of Guelph.
8 1.1.1.1.6.2 yamt *
9 1.1.1.1.6.2 yamt * Redistribution and use in source and binary forms, with or without
10 1.1.1.1.6.2 yamt * modification, are permitted provided that the following conditions
11 1.1.1.1.6.2 yamt * are met:
12 1.1.1.1.6.2 yamt * 1. Redistributions of source code must retain the above copyright
13 1.1.1.1.6.2 yamt * notice, this list of conditions and the following disclaimer.
14 1.1.1.1.6.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.1.1.6.2 yamt * notice, this list of conditions and the following disclaimer in the
16 1.1.1.1.6.2 yamt * documentation and/or other materials provided with the distribution.
17 1.1.1.1.6.2 yamt * 4. Neither the name of the University nor the names of its contributors
18 1.1.1.1.6.2 yamt * may be used to endorse or promote products derived from this software
19 1.1.1.1.6.2 yamt * without specific prior written permission.
20 1.1.1.1.6.2 yamt *
21 1.1.1.1.6.2 yamt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 1.1.1.1.6.2 yamt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1.1.1.6.2 yamt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1.1.1.6.2 yamt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 1.1.1.1.6.2 yamt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1.1.1.6.2 yamt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1.1.1.6.2 yamt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1.1.1.6.2 yamt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1.1.1.6.2 yamt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1.1.1.6.2 yamt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1.1.1.6.2 yamt * SUCH DAMAGE.
32 1.1.1.1.6.2 yamt *
33 1.1.1.1.6.2 yamt * FreeBSD: head/sys/fs/nfsclient/nfs.h 221040 2011-04-25 23:12:18Z rmacklem
34 1.1.1.1.6.2 yamt * $NetBSD: nfs.h,v 1.1.1.1.6.2 2014/05/22 11:41:00 yamt Exp $
35 1.1.1.1.6.2 yamt */
36 1.1.1.1.6.2 yamt
37 1.1.1.1.6.2 yamt #ifndef _NFSCLIENT_NFS_H_
38 1.1.1.1.6.2 yamt #define _NFSCLIENT_NFS_H_
39 1.1.1.1.6.2 yamt
40 1.1.1.1.6.2 yamt #if defined(_KERNEL)
41 1.1.1.1.6.2 yamt
42 1.1.1.1.6.2 yamt #ifndef NFS_TPRINTF_INITIAL_DELAY
43 1.1.1.1.6.2 yamt #define NFS_TPRINTF_INITIAL_DELAY 12
44 1.1.1.1.6.2 yamt #endif
45 1.1.1.1.6.2 yamt
46 1.1.1.1.6.2 yamt #ifndef NFS_TPRINTF_DELAY
47 1.1.1.1.6.2 yamt #define NFS_TPRINTF_DELAY 30
48 1.1.1.1.6.2 yamt #endif
49 1.1.1.1.6.2 yamt
50 1.1.1.1.6.2 yamt /*
51 1.1.1.1.6.2 yamt * Nfs version macros.
52 1.1.1.1.6.2 yamt */
53 1.1.1.1.6.2 yamt #define NFS_ISV3(v) \
54 1.1.1.1.6.2 yamt (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
55 1.1.1.1.6.2 yamt #define NFS_ISV4(v) \
56 1.1.1.1.6.2 yamt (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV4)
57 1.1.1.1.6.2 yamt #define NFS_ISV34(v) \
58 1.1.1.1.6.2 yamt (VFSTONFS((v)->v_mount)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4))
59 1.1.1.1.6.2 yamt
60 1.1.1.1.6.2 yamt /*
61 1.1.1.1.6.2 yamt * NFS iod threads can be in one of these three states once spawned.
62 1.1.1.1.6.2 yamt * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time.
63 1.1.1.1.6.2 yamt * NFSIOD_AVAILABLE - Available to be assigned an I/O operation.
64 1.1.1.1.6.2 yamt * NFSIOD_CREATED_FOR_NFS_ASYNCIO - Newly created for nfs_asyncio() and
65 1.1.1.1.6.2 yamt * will be used by the thread that called nfs_asyncio().
66 1.1.1.1.6.2 yamt */
67 1.1.1.1.6.2 yamt enum nfsiod_state {
68 1.1.1.1.6.2 yamt NFSIOD_NOT_AVAILABLE = 0,
69 1.1.1.1.6.2 yamt NFSIOD_AVAILABLE = 1,
70 1.1.1.1.6.2 yamt NFSIOD_CREATED_FOR_NFS_ASYNCIO = 2,
71 1.1.1.1.6.2 yamt };
72 1.1.1.1.6.2 yamt
73 1.1.1.1.6.2 yamt /*
74 1.1.1.1.6.2 yamt * Function prototypes.
75 1.1.1.1.6.2 yamt */
76 1.1.1.1.6.2 yamt int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *,
77 1.1.1.1.6.2 yamt u_quad_t);
78 1.1.1.1.6.2 yamt void ncl_doio_directwrite(struct buf *);
79 1.1.1.1.6.2 yamt int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *);
80 1.1.1.1.6.2 yamt int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *);
81 1.1.1.1.6.2 yamt int ncl_vinvalbuf(struct vnode *, int, struct thread *, int);
82 1.1.1.1.6.2 yamt int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *,
83 1.1.1.1.6.2 yamt struct thread *);
84 1.1.1.1.6.2 yamt int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *,
85 1.1.1.1.6.2 yamt int);
86 1.1.1.1.6.2 yamt void ncl_nhinit(void);
87 1.1.1.1.6.2 yamt void ncl_nhuninit(void);
88 1.1.1.1.6.2 yamt void ncl_nodelock(struct nfsnode *);
89 1.1.1.1.6.2 yamt void ncl_nodeunlock(struct nfsnode *);
90 1.1.1.1.6.2 yamt int ncl_getattrcache(struct vnode *, struct vattr *);
91 1.1.1.1.6.2 yamt int ncl_readrpc(struct vnode *, struct uio *, struct ucred *);
92 1.1.1.1.6.2 yamt int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *,
93 1.1.1.1.6.2 yamt int);
94 1.1.1.1.6.2 yamt int ncl_readlinkrpc(struct vnode *, struct uio *, struct ucred *);
95 1.1.1.1.6.2 yamt int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *,
96 1.1.1.1.6.2 yamt struct thread *);
97 1.1.1.1.6.2 yamt int ncl_readdirplusrpc(struct vnode *, struct uio *, struct ucred *,
98 1.1.1.1.6.2 yamt struct thread *);
99 1.1.1.1.6.2 yamt int ncl_writebp(struct buf *, int, struct thread *);
100 1.1.1.1.6.2 yamt int ncl_commit(struct vnode *, u_quad_t, int, struct ucred *, struct thread *);
101 1.1.1.1.6.2 yamt void ncl_clearcommit(struct mount *);
102 1.1.1.1.6.2 yamt int ncl_fsinfo(struct nfsmount *, struct vnode *, struct ucred *,
103 1.1.1.1.6.2 yamt struct thread *);
104 1.1.1.1.6.2 yamt int ncl_init(struct vfsconf *);
105 1.1.1.1.6.2 yamt int ncl_uninit(struct vfsconf *);
106 1.1.1.1.6.2 yamt void ncl_nfsiodnew(void);
107 1.1.1.1.6.2 yamt void ncl_nfsiodnew_tq(__unused void *, int);
108 1.1.1.1.6.2 yamt
109 1.1.1.1.6.2 yamt #endif /* _KERNEL */
110 1.1.1.1.6.2 yamt
111 1.1.1.1.6.2 yamt #endif /* _NFSCLIENT_NFS_H_ */
112