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