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