* Copyright (c) 1989 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Rick Macklem at The University of Guelph.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* From: @(#)nfsnode.h 7.12 (Berkeley) 4/16/91
* $Id: nfsnode.h,v 1.5 1993/11/25 01:36:59 wollman Exp $
* The nfsnode is the nfs equivalent to ufs's inode. Any similarity
* is purely coincidental.
* There is a unique nfsnode allocated for each active file,
* each current directory, each mounted-on file, text file, and the root.
* An nfsnode is 'named' by its file handle. (nget/nfs_node.c)
struct nfsnode
*n_chain
[2]; /* must be first */
nfsv2fh_t n_fh
; /* NFS File Handle */
long n_flag
; /* Flag for locking.. */
struct vnode
*n_vnode
; /* vnode associated with this nfsnode */
time_t n_attrstamp
; /* Time stamp (sec) for attributes */
struct vattr n_vattr
; /* Vnode attribute cache */
struct sillyrename
*n_sillyrename
; /* Ptr to silly rename struct */
u_long n_size
; /* Current size of file */
struct lockf
*n_lockf
; /* Locking record of file */
time_t n_mtime
; /* Prev modify time to maintain data cache consistency*/
time_t n_ctime
; /* Prev create time for name cache consistency*/
int n_error
; /* Save write error value */
pid_t n_lockholder
; /* holder of nfsnode lock */
pid_t n_lockwaiter
; /* most recent waiter for nfsnode lock */
u_long n_direofoffset
; /* Dir. EOF offset cache */
#define n_forw n_chain[0]
#define n_back n_chain[1]
* Convert between nfsnode pointers and vnode pointers
#define VTONFS(vp) ((struct nfsnode *)(vp)->v_data)
#define NFSTOV(np) ((struct vnode *)(np)->n_vnode)
#define NLOCKED 0x1 /* Lock the node for other local accesses */
#define NWANT 0x2 /* Want above lock */
#define NMODIFIED 0x4 /* Might have a modified buffer in bio */
#define NWRITEERR 0x8 /* Flag write errors so close will know */
* Prototypes for NFS vnode operations
#define nfs_ioctl ((int (*) __P(( \
struct proc *p))) enoioctl)
#define nfs_select ((int (*) __P(( \
struct proc *p))) seltrue)
#define nfs_seek ((int (*) __P(( \
struct ucred *cred))) nullop)
void nfs_nput
__P((struct vnode
*));
extern int nfs_dogetattr(struct vnode
*, struct vattr
*, struct ucred
*, int,
extern int nfsrv_fhtovp(fhandle_t
*, int, struct vnode
**, struct ucred
*);
extern int nfs_loadattrcache(struct vnode
**, struct mbuf
**, caddr_t
*,
extern int nfs_getattrcache(struct vnode
*, struct vattr
*);
extern int nfs_namei(struct nameidata
*, fhandle_t
*, int, struct mbuf
**,
caddr_t
*, struct proc
*);
extern int nfsrv_access(struct vnode
*, int, struct ucred
*, struct proc
*);
extern union nhead
*nfs_hash(nfsv2fh_t
*);
extern int nfs_nget(struct mount
*, nfsv2fh_t
*, struct nfsnode
**);
struct nfsreq
; struct nfsmount
;
extern int nfs_reply(struct nfsmount
*, struct nfsreq
*);
extern void nfs_timer(caddr_t
);
extern void nfs_updatetimer(struct nfsmount
*);
extern void nfs_backofftimer(struct nfsmount
*);
extern int nfs_connect(struct nfsmount
*);
extern int nfs_reconnect(struct nfsreq
*, struct nfsmount
*);
extern void nfs_disconnect(struct nfsmount
*);
extern int nfs_sigintr(struct proc
*);
extern void nfs_msg(struct proc
*, const char *, const char *);
extern void nfs_solock(int *);
extern void nfs_sounlock(int *);
extern int nfs_bioread(struct vnode
*, struct uio
*, int, struct ucred
*);
extern int nfs_write(struct vnode
*, struct uio
*, int, struct ucred
*);