rnode4.h revision 6962f5b8ab9112ea1e951c076b3eb4583ef37612
1131N/A/*
1131N/A * CDDL HEADER START
1131N/A *
1131N/A * The contents of this file are subject to the terms of the
1131N/A * Common Development and Distribution License (the "License").
1131N/A * You may not use this file except in compliance with the License.
1131N/A *
1131N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1131N/A * or http://www.opensolaris.org/os/licensing.
1131N/A * See the License for the specific language governing permissions
1131N/A * and limitations under the License.
1131N/A *
1131N/A * When distributing Covered Code, include this CDDL HEADER in each
1131N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1131N/A * If applicable, add the following below this CDDL HEADER, with the
1131N/A * fields enclosed by brackets "[]" replaced with your own identifying
1131N/A * information: Portions Copyright [yyyy] [name of copyright owner]
1131N/A *
1131N/A * CDDL HEADER END
1131N/A */
1131N/A/*
1131N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
1131N/A * Use is subject to license terms.
1131N/A */
1131N/A
1131N/A/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
1389N/A/* All Rights Reserved */
1131N/A
1131N/A#ifndef _NFS_RNODE4_H
1131N/A#define _NFS_RNODE4_H
1418N/A
1828N/A#ifdef __cplusplus
1389N/Aextern "C" {
1389N/A#endif
1389N/A
1884N/A#include <nfs/rnode.h> /* for symlink_cache, nfs_rwlock_t, etc. */
1389N/A#include <nfs/nfs4.h>
1389N/A#include <nfs/nfs4_clnt.h>
1828N/A#include <sys/thread.h>
1828N/A#include <sys/sysmacros.h> /* for offsetof */
1828N/A
1828N/Atypedef enum nfs4_stub_type {
1828N/A NFS4_STUB_NONE,
1828N/A NFS4_STUB_MIRRORMOUNT
1828N/A} nfs4_stub_type_t;
1828N/A
1828N/Atypedef enum nfs4_access_type {
1131N/A NFS4_ACCESS_UNKNOWN,
1131N/A NFS4_ACCESS_ALLOWED,
1131N/A NFS4_ACCESS_DENIED
1131N/A} nfs4_access_type_t;
1828N/A
1828N/A/*
1828N/A * Access cache
1828N/A */
1828N/Atypedef struct acache4_hash {
1131N/A struct acache4 *next;
1131N/A struct acache4 *prev;
1131N/A krwlock_t lock;
1131N/A} acache4_hash_t;
1828N/A
1828N/Atypedef struct acache4 {
1828N/A struct acache4 *next; /* next and prev must be first */
1131N/A struct acache4 *prev;
1131N/A uint32_t known;
1131N/A uint32_t allowed;
1389N/A struct rnode4 *rnode;
1389N/A cred_t *cred;
1389N/A struct acache4 *list;
1828N/A struct acache4_hash *hashq;
1828N/A} acache4_t;
1828N/A
1828N/A/*
1828N/A * Note on the different buffer sizes in rddir4_cache:
1828N/A * There seems to be some discrepancy between the intended and actual
1828N/A * use of entlen and buflen, which does not correspond to the comment below.
1828N/A * entlen - nfsv2/3 used as both alloc'd size of entries buffer and
1828N/A * as the actual size of the entries (XXX is this correct?).
1828N/A * nfsv4 will use it only as the alloc'd size.
1828N/A * buflen - used for calculations of readahead.
1828N/A * actlen - added for nfsv4 to serve as the size of the useful
1828N/A * portion of the entries buffer. That is because in
1828N/A * nfsv4, the otw entries are converted to system entries,
1828N/A * and may not be the same size - thus buffer may not be full.
1828N/A */
1828N/Atypedef struct rddir4_cache {
1828N/A lloff_t _cookie; /* cookie used to find this cache entry */
1828N/A lloff_t _ncookie; /* cookie used to find the next cache entry */
1828N/A char *entries; /* buffer containing dirent entries */
1828N/A int eof; /* EOF reached after this request */
1828N/A int entlen; /* size of dirent entries in buf */
1828N/A int buflen; /* size of the buffer used to store entries */
1828N/A int actlen; /* size of the actual entries (nfsv4 only) */
1828N/A int flags; /* control flags, see below */
1828N/A kcondvar_t cv; /* cv for blocking */
1828N/A int error; /* error from RPC operation */
1828N/A void *data; /* private data */
1828N/A} rddir4_cache;
1828N/A
1828N/A#define nfs4_cookie _cookie._f
1828N/A#define nfs4_ncookie _ncookie._f
1828N/A
1828N/A/*
1828N/A * Shadow vnode, v4 only.
1828N/A *
1828N/A * A file's shadow vnode list is protected by its hash bucket lock,
1828N/A * r_hashq->r_lock.
1828N/A *
1828N/A * sv_r_vnode is protected by the appropriate vnode locks.
1828N/A *
1828N/A * sv_dfh, sv_name, sv_dfileid, and sv_dfileid_valid are protected
1828N/A * by rp->r_svlock.
1828N/A */
1828N/A
1828N/Atypedef struct insq_link {
1828N/A void *forw;
1828N/A void *back;
1828N/A} insq_link_t;
1828N/A
1828N/Atypedef struct svnode {
1389N/A insq_link_t sv_link; /* must be first for insque */
1828N/A vnode_t *sv_r_vnode; /* vnode for this shadow */
1828N/A nfs4_fname_t *sv_name; /* component name */
1828N/A nfs4_sharedfh_t *sv_dfh; /* directory file handle */
1828N/A} svnode_t;
1828N/A
1828N/A#define sv_forw sv_link.forw
1828N/A#define sv_back sv_link.back
1828N/Aextern svnode_t *vtosv(vnode_t *);
1828N/A#define VTOSV(vp) vtosv(vp)
1828N/A#define SVTOV(svp) (((svp)->sv_r_vnode))
1828N/A#define IS_SHADOW(vp, rp) ((vp) != (rp)->r_vnode)
1828N/A
1828N/A/*
1828N/A * The format of the hash bucket used to lookup rnodes from a file handle.
1828N/A */
1828N/Atypedef struct r4hashq {
1828N/A struct rnode4 *r_hashf;
1828N/A struct rnode4 *r_hashb;
1828N/A krwlock_t r_lock;
1828N/A} r4hashq_t;
1828N/A
1828N/A/*
1828N/A * Remote file information structure.
1828N/A *
1828N/A * The rnode is the "inode" for remote files. It contains all the
1828N/A * information necessary to handle remote file on the client side.
1828N/A *
1828N/A * Note on file sizes: we keep two file sizes in the rnode: the size
1828N/A * according to the client (r_size) and the size according to the server
1828N/A * (r_attr.va_size). They can differ because we modify r_size during a
1828N/A * write system call (nfs_rdwr), before the write request goes over the
1828N/A * wire (before the file is actually modified on the server). If an OTW
1828N/A * request occurs before the cached data is written to the server the file
1828N/A * size returned from the server (r_attr.va_size) may not match r_size.
1828N/A * r_size is the one we use, in general. r_attr.va_size is only used to
1828N/A * determine whether or not our cached data is valid.
1828N/A *
1828N/A * Each rnode has 5 locks associated with it (not including the rnode
1828N/A * hash table and free list locks):
1828N/A *
1828N/A * r_rwlock: Serializes nfs_write and nfs_setattr requests
1828N/A * and allows nfs_read requests to proceed in parallel.
1828N/A * Serializes reads/updates to directories.
1828N/A *
1828N/A * r_lkserlock: Serializes lock requests with map, write, and
1828N/A * readahead operations.
1828N/A *
1828N/A * r_statelock: Protects all fields in the rnode except for
1828N/A * those listed below. This lock is intented
1828N/A * to be held for relatively short periods of
1828N/A * time (not accross entire putpage operations,
1828N/A * for example).
1828N/A *
1828N/A * r_statev4_lock: Protects the created_v4 flag, the lock_owners list,
1828N/A * and all the delegation fields except r_deleg_list.
1389N/A *
1828N/A * r_os_lock: Protects r_open_streams.
1389N/A *
1389N/A *
1828N/A * The following members are protected by the mutex rp4freelist_lock:
1389N/A * r_freef
1389N/A * r_freeb
1389N/A *
1389N/A * The following members are protected by the hash bucket rwlock:
1389N/A * r_hashf
1389N/A * r_hashb
1389N/A *
1389N/A * r_fh is read-only except when an rnode is created (or recycled from the
1389N/A * free list).
1389N/A *
1389N/A * The following members are protected by nfs4_server_t::s_lock:
1828N/A * r_deleg_list
1389N/A *
1389N/A * Note: r_modaddr is only accessed when the r_statelock mutex is held.
1828N/A * Its value is also controlled via r_rwlock. It is assumed that
1828N/A * there will be only 1 writer active at a time, so it safe to
1389N/A * set r_modaddr and release r_statelock as long as the r_rwlock
1828N/A * writer lock is held.
1828N/A *
1389N/A * r_inmap informs nfs4_read()/write() that there is a call to nfs4_map()
1828N/A * in progress. nfs4_read()/write() check r_inmap to decide whether
1828N/A * to perform directio on the file or not. r_inmap is atomically
1389N/A * incremented in nfs4_map() before the address space routines are
1828N/A * called and atomically decremented just before nfs4_map() exits.
1828N/A * r_inmap is not protected by any lock.
1389N/A *
1828N/A * r_mapcnt tells that the rnode has mapped pages. r_inmap can be 0
1389N/A * while the rnode has mapped pages.
1389N/A *
1828N/A * 64-bit offsets: the code formerly assumed that atomic reads of
1828N/A * r_size were safe and reliable; on 32-bit architectures, this is
1389N/A * not true since an intervening bus cycle from another processor
1389N/A * could update half of the size field. The r_statelock must now
1389N/A * be held whenever any kind of access of r_size is made.
1389N/A *
1389N/A * Lock ordering:
1389N/A * r_rwlock > r_lkserlock > r_os_lock > r_statelock > r_statev4_lock
1389N/A * vnode_t::v_lock > r_os_lock
1389N/A */
1389N/Astruct exportinfo; /* defined in nfs/export.h */
1389N/Astruct servinfo4; /* defined in nfs/nfs4_clnt.h */
1389N/Astruct failinfo; /* defined in nfs/nfs_clnt.h */
1389N/Astruct mntinfo4; /* defined in nfs/nfs4_clnt.h */
1389N/A
1828N/Atypedef struct rnode4 {
1828N/A /* the hash fields must be first to match the rhashq_t */
1828N/A struct rnode4 *r_hashf; /* hash queue forward pointer */
1828N/A struct rnode4 *r_hashb; /* hash queue back pointer */
1389N/A struct rnode4 *r_freef; /* free list forward pointer */
1389N/A struct rnode4 *r_freeb; /* free list back pointer */
1828N/A r4hashq_t *r_hashq; /* pointer to the hash bucket */
1389N/A
1828N/A svnode_t r_svnode; /* "master" shadow vnode for file */
1389N/A kmutex_t r_svlock; /* serializes access to svnode list */
1828N/A nfs_rwlock_t r_rwlock; /* serializes write/setattr requests */
1418N/A nfs_rwlock_t r_lkserlock; /* serialize lock with other ops */
1418N/A kmutex_t r_statelock; /* protects (most of) rnode contents */
1418N/A nfs4_sharedfh_t *r_fh; /* file handle */
1828N/A struct servinfo4
1828N/A *r_server; /* current server */
1828N/A u_offset_t r_nextr; /* next byte read offset (read-ahead) */
1884N/A uint_t r_flags; /* flags, see below */
1884N/A short r_error; /* async write error */
1389N/A cred_t *r_unlcred; /* unlinked credentials */
1389N/A char *r_unlname; /* unlinked file name */
1884N/A vnode_t *r_unldvp; /* parent dir of unlinked file */
1389N/A vnode_t *r_xattr_dir; /* cached xattr dir vnode */
1389N/A len_t r_size; /* client's view of file size */
1389N/A vattr_t r_attr; /* cached vnode attributes */
1389N/A hrtime_t r_time_attr_saved; /* time attributes were cached */
1828N/A hrtime_t r_time_attr_inval; /* time attributes become invalid */
1389N/A hrtime_t r_time_cache_inval; /* time caches become invalid */
1389N/A time_t r_delay_wait; /* future time for DELAY handling */
1828N/A int r_delay_interval; /* Number of Secs of last DELAY */
1389N/A time_t r_last_recov; /* time of last recovery operation */
1828N/A nfs4_recov_t r_recov_act; /* action from last recovery op */
1389N/A long r_mapcnt; /* count of mmapped pages */
1828N/A uint_t r_count; /* # of refs not reflect in v_count */
1828N/A uint_t r_awcount; /* # of outstanding async write */
1828N/A uint_t r_gcount; /* getattrs waiting to flush pages */
1828N/A kcondvar_t r_cv; /* condvar for blocked threads */
1389N/A int (*r_putapage) /* address of putapage routine */
1828N/A (vnode_t *, page_t *, u_offset_t *, size_t *, int, cred_t *);
1389N/A void *r_dir; /* cache of readdir responses */
1389N/A rddir4_cache *r_direof; /* pointer to the EOF entry */
1828N/A symlink_cache r_symlink; /* cached readlink response */
1828N/A verifier4 r_writeverf; /* file data write verifier */
1828N/A u_offset_t r_modaddr; /* address for page in writerp */
1828N/A commit_t r_commit; /* commit information */
1828N/A u_offset_t r_truncaddr; /* base for truncate operation */
1828N/A vsecattr_t *r_secattr; /* cached security attributes (acls) */
1828N/A verifier4 r_cookieverf4; /* version 4 readdir cookie verifier */
1828N/A nfs4_pathconf_info_t r_pathconf; /* cached pathconf info */
1828N/A acache4_t *r_acache; /* list of access cache entries */
1828N/A list_t r_open_streams; /* open streams list */
1828N/A kmutex_t r_os_lock; /* protects r_open_streams */
1828N/A nfs4_lock_owner_t
1828N/A r_lo_head; /* lock owners list head */
1828N/A int created_v4; /* 1 if file has been created in v4 */
1828N/A kmutex_t r_statev4_lock; /* protects created_v4, state4ptr */
1828N/A
1828N/A list_node_t r_deleg_link; /* linkage into list of */
1828N/A /* delegated rnodes for this server */
1828N/A open_delegation_type4
1828N/A r_deleg_type; /* type of delegation granted */
1828N/A stateid4 r_deleg_stateid;
1828N/A /* delegation state id */
1389N/A nfs_space_limit4
1389N/A r_deleg_limit; /* file limits returned from */
1389N/A /* server on delegated open */
1389N/A nfsace4 r_deleg_perms; /* file permissions returned from */
1389N/A /* server on delegated open */
1828N/A fattr4_change r_deleg_change; /* current deleg change attr */
1828N/A fattr4_change r_deleg_change_grant;
1828N/A /* change @ write deleg grant */
1828N/A cred_t *r_deleg_cred; /* credential in force when the */
1828N/A /* delegation was granted */
1828N/A open_delegation_type4
1828N/A r_deleg_needs_recovery;
1828N/A /* delegation needs recovery */
1828N/A /* This contains the delegation type */
1828N/A /* for use with CLAIM_PREVIOUS. */
1828N/A /* OPEN_DELEGATE_NONE means recovery */
1828N/A /* is not needed. */
1828N/A unsigned r_deleg_needs_recall:1;
1828N/A /* delegation has been recalled by */
1828N/A /* the server during open with */
1828N/A /* CLAIM_PREVIOUS */
1828N/A unsigned r_deleg_return_pending:1;
1828N/A /* delegreturn is pending, don't use */
1828N/A /* the delegation stateid, set in */
1828N/A /* nfs4_dlistadd */
1828N/A unsigned r_deleg_return_inprog:1;
1828N/A /* delegreturn is in progress, may */
1828N/A /* only be set by nfs4delegreturn. */
1828N/A nfs_rwlock_t r_deleg_recall_lock;
1828N/A /* lock for synchronizing delegreturn */
1828N/A /* with in other operations, acquired */
1828N/A /* in read mode by nfs4_start_fop, */
1828N/A /* acquired in write mode in */
1828N/A /* nfs4delegreturn */
1828N/A fattr4_change r_change; /* GETATTR4 change attr; client */
1389N/A /* should always request change */
1389N/A /* when c/mtime requested to keep */
1389N/A /* change and c/mtime in sync */
1389N/A fattr4_fileid r_mntd_fid; /* mounted on fileid attr */
1389N/A kthread_t *r_serial; /* attrcache validation thread */
1828N/A kthread_t *r_pgflush; /* thread flushing page cache */
1828N/A list_t r_indelmap; /* list of delmap callers */
1828N/A fattr4_fsid r_srv_fsid; /* fsid of srv fs containing object */
1828N/A /* when rnode created; compare with */
1389N/A /* sv_fsid (servinfo4_t) to see why */
1828N/A /* stub type was set */
1828N/A nfs4_stub_type_t r_stub_type;
1828N/A /* e.g. mirror-mount */
1828N/A uint_t r_inmap; /* to serialize read/write and mmap */
1828N/A} rnode4_t;
1828N/A
1828N/A#define r_vnode r_svnode.sv_r_vnode
1828N/A
1828N/A/*
1828N/A * Flags
1389N/A */
1828N/A#define R4READDIRWATTR 0x1 /* Use READDIR with attributes */
1828N/A#define R4DIRTY 0x2 /* dirty pages from write operation */
1389N/A#define R4STALE 0x4 /* stale, don't even attempt to write */
1389N/A#define R4MODINPROGRESS 0x8 /* page modification happening */
1389N/A#define R4TRUNCATE 0x10 /* truncating, don't commit */
1389N/A#define R4HAVEVERF 0x20 /* have a write verifier to compare against */
1828N/A#define R4COMMIT 0x40 /* commit in progress */
1389N/A#define R4COMMITWAIT 0x80 /* someone is waiting to do a commit */
1828N/A#define R4HASHED 0x100 /* rnode is in hash queues */
1828N/A#define R4OUTOFSPACE 0x200 /* an out of space error has happened */
1828N/A#define R4LODANGLERS 0x400 /* rnode has dangling lock_owners to cleanup */
1828N/A#define R4WRITEMODIFIED 0x800 /* file data has been modified by write */
1828N/A#define R4DIRECTIO 0x1000 /* bypass the buffer cache */
1828N/A#define R4RECOVERR 0x2000 /* couldn't recover */
1828N/A#define R4RECEXPFH 0x4000 /* recovering expired filehandle */
1828N/A#define R4RECOVERRP 0x8000 /* R4RECOVERR pending, but not set (yet) */
1828N/A#define R4ISXATTR 0x20000 /* rnode is a named attribute */
1828N/A#define R4DELMAPLIST 0x40000 /* delmap callers tracked for as callback */
1828N/A#define R4PGFLUSH 0x80000 /* page flush thread active */
1828N/A#define R4INCACHEPURGE 0x100000 /* purging caches due to file size change */
1828N/A#define R4LOOKUP 0x200000 /* a lookup has been done in the directory */
1828N/A/*
1828N/A * Convert between vnode and rnode
1828N/A */
1389N/A#define RTOV4(rp) ((rp)->r_vnode)
1828N/A#define VTOR4(vp) ((rnode4_t *)((vp)->v_data))
1828N/A
1828N/A#define RP_ISSTUB(rp) (((rp)->r_stub_type != NFS4_STUB_NONE))
1828N/A#define RP_ISSTUB_MIRRORMOUNT(rp) ((rp)->r_stub_type == NFS4_STUB_MIRRORMOUNT)
1389N/A
1131N/A/*
* Open file instances.
*/
typedef struct nfs4_opinst {
struct nfs4_opinst *re_next; /* next in list */
vnode_t *re_vp; /* held reference */
uint32_t re_numosp; /* number of valid open streams */
nfs4_open_stream_t **re_osp; /* held reference */
} nfs4_opinst_t;
#ifdef _KERNEL
extern long nrnode;
/* Used for r_delay_interval */
#define NFS4_INITIAL_DELAY_INTERVAL 1
#define NFS4_MAX_DELAY_INTERVAL 20
/* Used for check_rtable4 */
#define NFSV4_RTABLE4_OK 0
#define NFSV4_RTABLE4_NOT_FREE_LIST 1
#define NFSV4_RTABLE4_DIRTY_PAGES 2
#define NFSV4_RTABLE4_POS_R_COUNT 3
extern rnode4_t *r4find(r4hashq_t *, nfs4_sharedfh_t *, struct vfs *);
extern rnode4_t *r4find_unlocked(nfs4_sharedfh_t *, struct vfs *);
extern void r4flush(struct vfs *, cred_t *);
extern void destroy_rtable4(struct vfs *, cred_t *);
extern int check_rtable4(struct vfs *);
extern void rp4_addfree(rnode4_t *, cred_t *);
extern void rp4_addhash(rnode4_t *);
extern void rp4_rmhash(rnode4_t *);
extern void rp4_rmhash_locked(rnode4_t *);
extern int rtable4hash(nfs4_sharedfh_t *);
extern vnode_t *makenfs4node(nfs4_sharedfh_t *, nfs4_ga_res_t *, struct vfs *,
hrtime_t, cred_t *, vnode_t *, nfs4_fname_t *);
extern vnode_t *makenfs4node_by_fh(nfs4_sharedfh_t *, nfs4_sharedfh_t *,
nfs4_fname_t **, nfs4_ga_res_t *, mntinfo4_t *, cred_t *, hrtime_t);
extern nfs4_opinst_t *r4mkopenlist(struct mntinfo4 *);
extern void r4releopenlist(nfs4_opinst_t *);
/* Access cache calls */
extern nfs4_access_type_t nfs4_access_check(rnode4_t *, uint32_t, cred_t *);
extern void nfs4_access_cache(rnode4_t *rp, uint32_t, uint32_t, cred_t *);
extern int nfs4_access_purge_rp(rnode4_t *);
extern int nfs4_free_data_reclaim(rnode4_t *);
extern void nfs4_rnode_invalidate(struct vfs *);
extern time_t r2lease_time(rnode4_t *);
extern int nfs4_directio(vnode_t *, int, cred_t *);
/* shadow vnode functions */
extern void sv_activate(vnode_t **, vnode_t *, nfs4_fname_t **, int);
extern vnode_t *sv_find(vnode_t *, vnode_t *, nfs4_fname_t **);
extern void sv_update_path(vnode_t *, char *, char *);
extern void sv_inactive(vnode_t *);
extern void sv_exchange(vnode_t **);
extern void sv_uninit(svnode_t *);
extern void nfs4_clear_open_streams(rnode4_t *);
/*
* Mark cached attributes as timed out
*
* The caller must not be holding the rnode r_statelock mutex.
*/
#define PURGE_ATTRCACHE4_LOCKED(rp) \
rp->r_time_attr_inval = gethrtime(); \
rp->r_time_attr_saved = rp->r_time_attr_inval; \
rp->r_pathconf.pc4_xattr_valid = 0; \
rp->r_pathconf.pc4_cache_valid = 0;
#define PURGE_ATTRCACHE4(vp) { \
rnode4_t *rp = VTOR4(vp); \
mutex_enter(&rp->r_statelock); \
PURGE_ATTRCACHE4_LOCKED(rp); \
mutex_exit(&rp->r_statelock); \
}
extern void nfs4_async_readdir(vnode_t *, rddir4_cache *,
cred_t *, int (*)(vnode_t *, rddir4_cache *, cred_t *));
extern char *rnode4info(rnode4_t *rp);
extern int writerp4(rnode4_t *, caddr_t, int, struct uio *, int);
extern void nfs4_set_nonvattrs(rnode4_t *, struct nfs4attr_to_vattr *);
extern void nfs4delegabandon(rnode4_t *);
extern stateid4 nfs4_get_w_stateid(cred_t *, rnode4_t *, pid_t, mntinfo4_t *,
nfs_opnum4, nfs4_stateid_types_t *);
extern stateid4 nfs4_get_stateid(cred_t *, rnode4_t *, pid_t, mntinfo4_t *,
nfs_opnum4, nfs4_stateid_types_t *, bool_t);
extern nfsstat4 nfs4_find_or_create_lock_owner(pid_t, rnode4_t *, cred_t *,
nfs4_open_owner_t **, nfs4_open_stream_t **,
nfs4_lock_owner_t **);
extern cred_t *nfs4_get_otw_cred_by_osp(rnode4_t *, cred_t *,
nfs4_open_stream_t **, bool_t *, bool_t *);
/*
* Defines for the flag argument of nfs4delegreturn
*/
#define NFS4_DR_FORCE 0x1 /* discard even if start_op fails */
#define NFS4_DR_PUSH 0x2 /* push modified data back to the server */
#define NFS4_DR_DISCARD 0x4 /* discard the delegation w/o delegreturn */
#define NFS4_DR_DID_OP 0x8 /* calling function did nfs4_start_op */
#define NFS4_DR_RECALL 0x10 /* delegreturn done in response to CB_RECALL */
#define NFS4_DR_REOPEN 0x20 /* perform file reopens, if applicable */
extern int nfs4delegreturn(rnode4_t *, int);
extern void nfs4_delegreturn_all(nfs4_server_t *);
extern void nfs4delegreturn_cleanup(rnode4_t *, nfs4_server_t *);
extern void nfs4_delegation_accept(rnode4_t *, open_claim_type4, OPEN4res *,
nfs4_ga_res_t *, cred_t *);
extern void nfs4_dlistclean(void);
extern void nfs4_deleg_discard(mntinfo4_t *, nfs4_server_t *);
extern void rddir4_cache_create(rnode4_t *);
extern void rddir4_cache_purge(rnode4_t *);
extern void rddir4_cache_destroy(rnode4_t *);
extern rddir4_cache *rddir4_cache_lookup(rnode4_t *, offset_t, int);
extern void rddir4_cache_rele(rnode4_t *, rddir4_cache *);
extern void r4_stub_mirrormount(rnode4_t *);
extern void r4_stub_none(rnode4_t *);
#ifdef DEBUG
extern char *rddir4_cache_buf_alloc(size_t, int);
extern void rddir4_cache_buf_free(void *, size_t);
#endif
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _NFS_RNODE4_H */