10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* 230Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 280Sstevel@tonic-gate /* All Rights Reserved */ 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifndef _NFS_RNODE_H 310Sstevel@tonic-gate #define _NFS_RNODE_H 320Sstevel@tonic-gate 330Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 340Sstevel@tonic-gate 350Sstevel@tonic-gate #include <sys/avl.h> 360Sstevel@tonic-gate #include <sys/list.h> 370Sstevel@tonic-gate #include <nfs/nfs.h> 380Sstevel@tonic-gate 390Sstevel@tonic-gate #ifdef __cplusplus 400Sstevel@tonic-gate extern "C" { 410Sstevel@tonic-gate #endif 420Sstevel@tonic-gate 430Sstevel@tonic-gate typedef enum nfs_access_type { 440Sstevel@tonic-gate NFS_ACCESS_UNKNOWN, 450Sstevel@tonic-gate NFS_ACCESS_ALLOWED, 460Sstevel@tonic-gate NFS_ACCESS_DENIED 470Sstevel@tonic-gate } nfs_access_type_t; 480Sstevel@tonic-gate 490Sstevel@tonic-gate typedef struct acache_hash { 500Sstevel@tonic-gate struct acache *next; /* next and prev must be first */ 510Sstevel@tonic-gate struct acache *prev; 520Sstevel@tonic-gate krwlock_t lock; 530Sstevel@tonic-gate } acache_hash_t; 540Sstevel@tonic-gate 550Sstevel@tonic-gate typedef struct acache { 560Sstevel@tonic-gate struct acache *next; /* next and prev must be first */ 570Sstevel@tonic-gate struct acache *prev; 580Sstevel@tonic-gate uint32_t known; 590Sstevel@tonic-gate uint32_t allowed; 600Sstevel@tonic-gate struct rnode *rnode; 610Sstevel@tonic-gate cred_t *cred; 620Sstevel@tonic-gate struct acache *list; 630Sstevel@tonic-gate struct acache_hash *hashq; 640Sstevel@tonic-gate } acache_t; 650Sstevel@tonic-gate 660Sstevel@tonic-gate #define NFS_FHANDLE_LEN 64 670Sstevel@tonic-gate 680Sstevel@tonic-gate typedef struct nfs_fhandle { 690Sstevel@tonic-gate int fh_len; 700Sstevel@tonic-gate char fh_buf[NFS_FHANDLE_LEN]; 710Sstevel@tonic-gate } nfs_fhandle; 720Sstevel@tonic-gate 730Sstevel@tonic-gate typedef struct rddir_cache { 740Sstevel@tonic-gate lloff_t _cookie; /* cookie used to find this cache entry */ 750Sstevel@tonic-gate lloff_t _ncookie; /* cookie used to find the next cache entry */ 760Sstevel@tonic-gate char *entries; /* buffer containing dirent entries */ 770Sstevel@tonic-gate int eof; /* EOF reached after this request */ 780Sstevel@tonic-gate int entlen; /* size of dirent entries in buf */ 790Sstevel@tonic-gate int buflen; /* size of the buffer used to store entries */ 800Sstevel@tonic-gate int flags; /* control flags, see below */ 810Sstevel@tonic-gate kcondvar_t cv; /* cv for blocking */ 820Sstevel@tonic-gate int error; /* error from RPC operation */ 830Sstevel@tonic-gate kmutex_t lock; 840Sstevel@tonic-gate uint_t count; /* reference count */ 850Sstevel@tonic-gate avl_node_t tree; /* AVL tree links */ 860Sstevel@tonic-gate } rddir_cache; 870Sstevel@tonic-gate 880Sstevel@tonic-gate #define nfs_cookie _cookie._p._l 890Sstevel@tonic-gate #define nfs_ncookie _ncookie._p._l 900Sstevel@tonic-gate #define nfs3_cookie _cookie._f 910Sstevel@tonic-gate #define nfs3_ncookie _ncookie._f 920Sstevel@tonic-gate 930Sstevel@tonic-gate #define RDDIR 0x1 /* readdir operation in progress */ 940Sstevel@tonic-gate #define RDDIRWAIT 0x2 /* waiting on readdir in progress */ 950Sstevel@tonic-gate #define RDDIRREQ 0x4 /* a new readdir is required */ 960Sstevel@tonic-gate #define RDDIRCACHED 0x8 /* entry is in the cache */ 970Sstevel@tonic-gate 980Sstevel@tonic-gate #define HAVE_RDDIR_CACHE(rp) (avl_numnodes(&(rp)->r_dir) > 0) 990Sstevel@tonic-gate 1000Sstevel@tonic-gate typedef struct symlink_cache { 1010Sstevel@tonic-gate char *contents; /* contents of the symbolic link */ 1020Sstevel@tonic-gate int len; /* length of the contents */ 1030Sstevel@tonic-gate int size; /* size of the allocated buffer */ 1040Sstevel@tonic-gate } symlink_cache; 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate typedef struct commit { 1070Sstevel@tonic-gate page_t *c_pages; /* list of pages to commit */ 1080Sstevel@tonic-gate offset3 c_commbase; /* base offset to do commit from */ 1090Sstevel@tonic-gate count3 c_commlen; /* len to commit */ 1100Sstevel@tonic-gate kcondvar_t c_cv; /* condvar for waiting for commit */ 1110Sstevel@tonic-gate } commit_t; 1120Sstevel@tonic-gate 1130Sstevel@tonic-gate /* 1140Sstevel@tonic-gate * The various values for the commit states. These are stored in 1150Sstevel@tonic-gate * the p_fsdata byte in the page struct. 1160Sstevel@tonic-gate */ 1170Sstevel@tonic-gate #define C_NOCOMMIT 0 /* no commit is required */ 1180Sstevel@tonic-gate #define C_COMMIT 1 /* a commit is required so do it now */ 1190Sstevel@tonic-gate #define C_DELAYCOMMIT 2 /* a commit is required, but can be delayed */ 1200Sstevel@tonic-gate 1210Sstevel@tonic-gate /* 1220Sstevel@tonic-gate * The lock manager holds state making it possible for the client 1230Sstevel@tonic-gate * and server to be out of sync. For example, if the response from 1240Sstevel@tonic-gate * the server granting a lock request is lost, the server will think 1250Sstevel@tonic-gate * the lock is granted and the client will think the lock is lost. 1260Sstevel@tonic-gate * To deal with this, a list of processes for which the client is 1270Sstevel@tonic-gate * not sure if the server holds a lock is attached to the rnode. 1280Sstevel@tonic-gate * When such a process closes the rnode, an unlock request is sent 1290Sstevel@tonic-gate * to the server to unlock the entire file. 1300Sstevel@tonic-gate * 1310Sstevel@tonic-gate * The list is kept as a singularly linked NULL terminated list. 1320Sstevel@tonic-gate * Because it is only added to under extreme error conditions, the 1330Sstevel@tonic-gate * list shouldn't get very big. DEBUG kernels print a console warning 1340Sstevel@tonic-gate * when the number of entries on a list go beyond nfs_lmpl_high_water 1350Sstevel@tonic-gate * an arbitrary number defined in nfs_add_locking_id() 1360Sstevel@tonic-gate */ 1370Sstevel@tonic-gate #define RLMPL_PID 1 1380Sstevel@tonic-gate #define RLMPL_OWNER 2 1390Sstevel@tonic-gate typedef struct lock_manager_pid_list { 1400Sstevel@tonic-gate int lmpl_type; 1410Sstevel@tonic-gate pid_t lmpl_pid; 1420Sstevel@tonic-gate union { 1430Sstevel@tonic-gate pid_t _pid; 1440Sstevel@tonic-gate struct { 1450Sstevel@tonic-gate int len; 1460Sstevel@tonic-gate char *owner; 1470Sstevel@tonic-gate } _own; 1480Sstevel@tonic-gate } un; 1490Sstevel@tonic-gate struct lock_manager_pid_list *lmpl_next; 1500Sstevel@tonic-gate } lmpl_t; 1510Sstevel@tonic-gate 1520Sstevel@tonic-gate #define lmpl_opid un._pid 1530Sstevel@tonic-gate #define lmpl_own_len un._own.len 1540Sstevel@tonic-gate #define lmpl_owner un._own.owner 1550Sstevel@tonic-gate 1560Sstevel@tonic-gate /* 1570Sstevel@tonic-gate * A homegrown reader/writer lock implementation. It addresses 1580Sstevel@tonic-gate * two requirements not addressed by the system primitives. They 1590Sstevel@tonic-gate * are that the `enter" operation is optionally interruptible and 1600Sstevel@tonic-gate * that that they can be re`enter'ed by writers without deadlock. 1610Sstevel@tonic-gate */ 1620Sstevel@tonic-gate typedef struct nfs_rwlock { 1630Sstevel@tonic-gate int count; 1640Sstevel@tonic-gate int waiters; 1650Sstevel@tonic-gate kthread_t *owner; 1660Sstevel@tonic-gate kmutex_t lock; 1670Sstevel@tonic-gate kcondvar_t cv; 1680Sstevel@tonic-gate } nfs_rwlock_t; 1690Sstevel@tonic-gate 1700Sstevel@tonic-gate /* 1710Sstevel@tonic-gate * The format of the hash bucket used to lookup rnodes from a file handle. 1720Sstevel@tonic-gate */ 1730Sstevel@tonic-gate typedef struct rhashq { 1740Sstevel@tonic-gate struct rnode *r_hashf; 1750Sstevel@tonic-gate struct rnode *r_hashb; 1760Sstevel@tonic-gate krwlock_t r_lock; 1770Sstevel@tonic-gate } rhashq_t; 1780Sstevel@tonic-gate 1790Sstevel@tonic-gate /* 1800Sstevel@tonic-gate * Remote file information structure. 1810Sstevel@tonic-gate * 1820Sstevel@tonic-gate * The rnode is the "inode" for remote files. It contains all the 1830Sstevel@tonic-gate * information necessary to handle remote file on the client side. 1840Sstevel@tonic-gate * 1850Sstevel@tonic-gate * Note on file sizes: we keep two file sizes in the rnode: the size 1860Sstevel@tonic-gate * according to the client (r_size) and the size according to the server 1870Sstevel@tonic-gate * (r_attr.va_size). They can differ because we modify r_size during a 1880Sstevel@tonic-gate * write system call (nfs_rdwr), before the write request goes over the 1890Sstevel@tonic-gate * wire (before the file is actually modified on the server). If an OTW 1900Sstevel@tonic-gate * request occurs before the cached data is written to the server the file 1910Sstevel@tonic-gate * size returned from the server (r_attr.va_size) may not match r_size. 1920Sstevel@tonic-gate * r_size is the one we use, in general. r_attr.va_size is only used to 1930Sstevel@tonic-gate * determine whether or not our cached data is valid. 1940Sstevel@tonic-gate * 1950Sstevel@tonic-gate * Each rnode has 3 locks associated with it (not including the rnode 1960Sstevel@tonic-gate * hash table and free list locks): 1970Sstevel@tonic-gate * 1980Sstevel@tonic-gate * r_rwlock: Serializes nfs_write and nfs_setattr requests 1990Sstevel@tonic-gate * and allows nfs_read requests to proceed in parallel. 2000Sstevel@tonic-gate * Serializes reads/updates to directories. 2010Sstevel@tonic-gate * 2020Sstevel@tonic-gate * r_lkserlock: Serializes lock requests with map, write, and 2030Sstevel@tonic-gate * readahead operations. 2040Sstevel@tonic-gate * 2050Sstevel@tonic-gate * r_statelock: Protects all fields in the rnode except for 2060Sstevel@tonic-gate * those listed below. This lock is intented 2070Sstevel@tonic-gate * to be held for relatively short periods of 2080Sstevel@tonic-gate * time (not accross entire putpage operations, 2090Sstevel@tonic-gate * for example). 2100Sstevel@tonic-gate * 2110Sstevel@tonic-gate * The following members are protected by the mutex rpfreelist_lock: 2120Sstevel@tonic-gate * r_freef 2130Sstevel@tonic-gate * r_freeb 2140Sstevel@tonic-gate * 2150Sstevel@tonic-gate * The following members are protected by the hash bucket rwlock: 2160Sstevel@tonic-gate * r_hashf 2170Sstevel@tonic-gate * r_hashb 2180Sstevel@tonic-gate * 2190Sstevel@tonic-gate * Note: r_modaddr is only accessed when the r_statelock mutex is held. 2200Sstevel@tonic-gate * Its value is also controlled via r_rwlock. It is assumed that 2210Sstevel@tonic-gate * there will be only 1 writer active at a time, so it safe to 2220Sstevel@tonic-gate * set r_modaddr and release r_statelock as long as the r_rwlock 2230Sstevel@tonic-gate * writer lock is held. 2240Sstevel@tonic-gate * 2250Sstevel@tonic-gate * 64-bit offsets: the code formerly assumed that atomic reads of 2260Sstevel@tonic-gate * r_size were safe and reliable; on 32-bit architectures, this is 2270Sstevel@tonic-gate * not true since an intervening bus cycle from another processor 2280Sstevel@tonic-gate * could update half of the size field. The r_statelock must now 2290Sstevel@tonic-gate * be held whenever any kind of access of r_size is made. 2300Sstevel@tonic-gate * 2310Sstevel@tonic-gate * Lock ordering: 2320Sstevel@tonic-gate * r_rwlock > r_lkserlock > r_statelock 2330Sstevel@tonic-gate */ 2340Sstevel@tonic-gate struct exportinfo; /* defined in nfs/export.h */ 2350Sstevel@tonic-gate struct servinfo; /* defined in nfs/nfs_clnt.h */ 2360Sstevel@tonic-gate struct failinfo; /* defined in nfs/nfs_clnt.h */ 2370Sstevel@tonic-gate struct mntinfo; /* defined in nfs/nfs_clnt.h */ 2380Sstevel@tonic-gate 2390Sstevel@tonic-gate #ifdef _KERNEL 2400Sstevel@tonic-gate 2410Sstevel@tonic-gate typedef struct rnode { 2420Sstevel@tonic-gate /* the hash fields must be first to match the rhashq_t */ 2430Sstevel@tonic-gate struct rnode *r_hashf; /* hash queue forward pointer */ 2440Sstevel@tonic-gate struct rnode *r_hashb; /* hash queue back pointer */ 2450Sstevel@tonic-gate struct rnode *r_freef; /* free list forward pointer */ 2460Sstevel@tonic-gate struct rnode *r_freeb; /* free list back pointer */ 2470Sstevel@tonic-gate rhashq_t *r_hashq; /* pointer to the hash bucket */ 2480Sstevel@tonic-gate vnode_t *r_vnode; /* vnode for remote file */ 2490Sstevel@tonic-gate nfs_rwlock_t r_rwlock; /* serializes write/setattr requests */ 2500Sstevel@tonic-gate nfs_rwlock_t r_lkserlock; /* serialize lock with other ops */ 2510Sstevel@tonic-gate kmutex_t r_statelock; /* protects (most of) rnode contents */ 2520Sstevel@tonic-gate nfs_fhandle r_fh; /* file handle */ 2530Sstevel@tonic-gate struct servinfo *r_server; /* current server */ 2540Sstevel@tonic-gate char *r_path; /* path to this rnode */ 2550Sstevel@tonic-gate u_offset_t r_nextr; /* next byte read offset (read-ahead) */ 2560Sstevel@tonic-gate cred_t *r_cred; /* current credentials */ 2570Sstevel@tonic-gate cred_t *r_unlcred; /* unlinked credentials */ 2580Sstevel@tonic-gate char *r_unlname; /* unlinked file name */ 2590Sstevel@tonic-gate vnode_t *r_unldvp; /* parent dir of unlinked file */ 2600Sstevel@tonic-gate len_t r_size; /* client's view of file size */ 2610Sstevel@tonic-gate struct vattr r_attr; /* cached vnode attributes */ 2620Sstevel@tonic-gate hrtime_t r_attrtime; /* time attributes become invalid */ 2630Sstevel@tonic-gate hrtime_t r_mtime; /* client time file last modified */ 2640Sstevel@tonic-gate long r_mapcnt; /* count of mmapped pages */ 2650Sstevel@tonic-gate uint_t r_count; /* # of refs not reflect in v_count */ 2660Sstevel@tonic-gate uint_t r_awcount; /* # of outstanding async write */ 2670Sstevel@tonic-gate uint_t r_gcount; /* getattrs waiting to flush pages */ 2680Sstevel@tonic-gate ushort_t r_flags; /* flags, see below */ 2690Sstevel@tonic-gate short r_error; /* async write error */ 2700Sstevel@tonic-gate kcondvar_t r_cv; /* condvar for blocked threads */ 2710Sstevel@tonic-gate int (*r_putapage) /* address of putapage routine */ 2720Sstevel@tonic-gate (vnode_t *, page_t *, u_offset_t *, size_t *, int, cred_t *); 2730Sstevel@tonic-gate avl_tree_t r_dir; /* cache of readdir responses */ 2740Sstevel@tonic-gate rddir_cache *r_direof; /* pointer to the EOF entry */ 2750Sstevel@tonic-gate symlink_cache r_symlink; /* cached readlink response */ 2760Sstevel@tonic-gate writeverf3 r_verf; /* version 3 write verifier */ 2770Sstevel@tonic-gate u_offset_t r_modaddr; /* address for page in writerp */ 2780Sstevel@tonic-gate commit_t r_commit; /* commit information */ 2790Sstevel@tonic-gate u_offset_t r_truncaddr; /* base for truncate operation */ 2800Sstevel@tonic-gate vsecattr_t *r_secattr; /* cached security attributes (acls) */ 2810Sstevel@tonic-gate cookieverf3 r_cookieverf; /* version 3 readdir cookie verifier */ 2820Sstevel@tonic-gate lmpl_t *r_lmpl; /* pids that may be holding locks */ 2830Sstevel@tonic-gate nfs3_pathconf_info *r_pathconf; /* cached pathconf information */ 2840Sstevel@tonic-gate acache_t *r_acache; /* list of access cache entries */ 2850Sstevel@tonic-gate kthread_t *r_serial; /* id of purging thread */ 2860Sstevel@tonic-gate list_t r_indelmap; /* list of delmap callers */ 2870Sstevel@tonic-gate } rnode_t; 2880Sstevel@tonic-gate #endif /* _KERNEL */ 2890Sstevel@tonic-gate 2900Sstevel@tonic-gate /* 2910Sstevel@tonic-gate * Flags 2920Sstevel@tonic-gate */ 2930Sstevel@tonic-gate #define RREADDIRPLUS 0x1 /* issue a READDIRPLUS instead of READDIR */ 2940Sstevel@tonic-gate #define RDIRTY 0x2 /* dirty pages from write operation */ 2950Sstevel@tonic-gate #define RSTALE 0x4 /* file handle is stale */ 2960Sstevel@tonic-gate #define RMODINPROGRESS 0x8 /* page modification happening */ 2970Sstevel@tonic-gate #define RTRUNCATE 0x10 /* truncating, don't commit */ 2980Sstevel@tonic-gate #define RHAVEVERF 0x20 /* have a write verifier to compare against */ 2990Sstevel@tonic-gate #define RCOMMIT 0x40 /* commit in progress */ 3000Sstevel@tonic-gate #define RCOMMITWAIT 0x80 /* someone is waiting to do a commit */ 3010Sstevel@tonic-gate #define RHASHED 0x100 /* rnode is in hash queues */ 3020Sstevel@tonic-gate #define ROUTOFSPACE 0x200 /* an out of space error has happened */ 3030Sstevel@tonic-gate #define RDIRECTIO 0x400 /* bypass the buffer cache */ 3040Sstevel@tonic-gate #define RLOOKUP 0x800 /* a lookup has been performed */ 3050Sstevel@tonic-gate #define RWRITEATTR 0x1000 /* attributes came from WRITE */ 3060Sstevel@tonic-gate #define RINDNLCPURGE 0x2000 /* in the process of purging DNLC references */ 3070Sstevel@tonic-gate #define RDELMAPLIST 0x4000 /* delmap callers tracking for as callback */ 3080Sstevel@tonic-gate 3090Sstevel@tonic-gate /* 3100Sstevel@tonic-gate * Convert between vnode and rnode 3110Sstevel@tonic-gate */ 3120Sstevel@tonic-gate #define RTOV(rp) ((rp)->r_vnode) 3130Sstevel@tonic-gate #define VTOR(vp) ((rnode_t *)((vp)->v_data)) 3140Sstevel@tonic-gate 3150Sstevel@tonic-gate #define VTOFH(vp) (RTOFH(VTOR(vp))) 3160Sstevel@tonic-gate #define RTOFH(rp) ((fhandle_t *)(&(rp)->r_fh.fh_buf)) 3170Sstevel@tonic-gate #define VTOFH3(vp) (RTOFH3(VTOR(vp))) 3180Sstevel@tonic-gate #define RTOFH3(rp) ((nfs_fh3 *)(&(rp)->r_fh)) 3190Sstevel@tonic-gate 3200Sstevel@tonic-gate #ifdef _KERNEL 3210Sstevel@tonic-gate extern int nfs_async_readahead(vnode_t *, u_offset_t, caddr_t, 3220Sstevel@tonic-gate struct seg *, cred_t *, 3230Sstevel@tonic-gate void (*)(vnode_t *, u_offset_t, 3240Sstevel@tonic-gate caddr_t, struct seg *, cred_t *)); 3250Sstevel@tonic-gate extern int nfs_async_putapage(vnode_t *, page_t *, u_offset_t, size_t, 3260Sstevel@tonic-gate int, cred_t *, int (*)(vnode_t *, page_t *, 3270Sstevel@tonic-gate u_offset_t, size_t, int, cred_t *)); 3280Sstevel@tonic-gate extern int nfs_async_pageio(vnode_t *, page_t *, u_offset_t, size_t, 3290Sstevel@tonic-gate int, cred_t *, int (*)(vnode_t *, page_t *, 3300Sstevel@tonic-gate u_offset_t, size_t, int, cred_t *)); 3310Sstevel@tonic-gate extern void nfs_async_readdir(vnode_t *, rddir_cache *, 3320Sstevel@tonic-gate cred_t *, int (*)(vnode_t *, 3330Sstevel@tonic-gate rddir_cache *, cred_t *)); 3340Sstevel@tonic-gate extern void nfs_async_commit(vnode_t *, page_t *, offset3, count3, 3350Sstevel@tonic-gate cred_t *, void (*)(vnode_t *, page_t *, 3360Sstevel@tonic-gate offset3, count3, cred_t *)); 3370Sstevel@tonic-gate extern void nfs_async_inactive(vnode_t *, cred_t *, void (*)(vnode_t *, 3380Sstevel@tonic-gate cred_t *)); 3390Sstevel@tonic-gate extern int writerp(rnode_t *, caddr_t, int, struct uio *, int); 3400Sstevel@tonic-gate extern int nfs_putpages(vnode_t *, u_offset_t, size_t, int, cred_t *); 3410Sstevel@tonic-gate extern void nfs_invalidate_pages(vnode_t *, u_offset_t, cred_t *); 3420Sstevel@tonic-gate extern int rfs2call(struct mntinfo *, rpcproc_t, xdrproc_t, caddr_t, 3430Sstevel@tonic-gate xdrproc_t, caddr_t, cred_t *, int *, enum nfsstat *, 3440Sstevel@tonic-gate int, struct failinfo *); 3450Sstevel@tonic-gate extern int rfs3call(struct mntinfo *, rpcproc_t, xdrproc_t, caddr_t, 3460Sstevel@tonic-gate xdrproc_t, caddr_t, cred_t *, int *, nfsstat3 *, 3470Sstevel@tonic-gate int, struct failinfo *); 3480Sstevel@tonic-gate extern void nfs_setswaplike(vnode_t *, vattr_t *); 3490Sstevel@tonic-gate extern vnode_t *makenfsnode(fhandle_t *, struct nfsfattr *, struct vfs *, 3500Sstevel@tonic-gate hrtime_t, cred_t *, char *, char *); 3510Sstevel@tonic-gate extern vnode_t *makenfs3node_va(nfs_fh3 *, vattr_t *, struct vfs *, hrtime_t, 3520Sstevel@tonic-gate cred_t *, char *, char *); 3530Sstevel@tonic-gate extern vnode_t *makenfs3node(nfs_fh3 *, fattr3 *, struct vfs *, hrtime_t, 3540Sstevel@tonic-gate cred_t *, char *, char *); 3550Sstevel@tonic-gate extern void rp_addfree(rnode_t *, cred_t *); 3560Sstevel@tonic-gate extern void rp_rmhash(rnode_t *); 3570Sstevel@tonic-gate extern int check_rtable(struct vfs *); 3580Sstevel@tonic-gate extern void destroy_rtable(struct vfs *, cred_t *); 3590Sstevel@tonic-gate extern void rflush(struct vfs *, cred_t *); 3600Sstevel@tonic-gate extern nfs_access_type_t nfs_access_check(rnode_t *, uint32_t, cred_t *); 3610Sstevel@tonic-gate extern void nfs_access_cache(rnode_t *rp, uint32_t, uint32_t, cred_t *); 3620Sstevel@tonic-gate extern int nfs_access_purge_rp(rnode_t *); 3630Sstevel@tonic-gate extern int nfs_putapage(vnode_t *, page_t *, u_offset_t *, size_t *, 3640Sstevel@tonic-gate int, cred_t *); 3650Sstevel@tonic-gate extern int nfs3_putapage(vnode_t *, page_t *, u_offset_t *, size_t *, 3660Sstevel@tonic-gate int, cred_t *); 3670Sstevel@tonic-gate extern void nfs_printfhandle(nfs_fhandle *); 3680Sstevel@tonic-gate extern void nfs_write_error(vnode_t *, int, cred_t *); 3690Sstevel@tonic-gate extern rddir_cache *rddir_cache_alloc(int); 3700Sstevel@tonic-gate extern void rddir_cache_hold(rddir_cache *); 3710Sstevel@tonic-gate extern void rddir_cache_rele(rddir_cache *); 3720Sstevel@tonic-gate #ifdef DEBUG 3730Sstevel@tonic-gate extern char *rddir_cache_buf_alloc(size_t, int); 3740Sstevel@tonic-gate extern void rddir_cache_buf_free(void *, size_t); 3750Sstevel@tonic-gate #endif 3760Sstevel@tonic-gate extern int nfs_rw_enter_sig(nfs_rwlock_t *, krw_t, int); 3770Sstevel@tonic-gate extern int nfs_rw_tryenter(nfs_rwlock_t *, krw_t); 3780Sstevel@tonic-gate extern void nfs_rw_exit(nfs_rwlock_t *); 3790Sstevel@tonic-gate extern int nfs_rw_lock_held(nfs_rwlock_t *, krw_t); 3800Sstevel@tonic-gate extern void nfs_rw_init(nfs_rwlock_t *, char *, krw_type_t, void *); 3810Sstevel@tonic-gate extern void nfs_rw_destroy(nfs_rwlock_t *); 3820Sstevel@tonic-gate extern int nfs_directio(vnode_t *, int, cred_t *); 3830Sstevel@tonic-gate extern int nfs3_rddir_compar(const void *, const void *); 3840Sstevel@tonic-gate extern int nfs_rddir_compar(const void *, const void *); 385*766Scarlsonj extern struct zone *nfs_zone(void); 386*766Scarlsonj extern zoneid_t nfs_zoneid(void); 3870Sstevel@tonic-gate 3880Sstevel@tonic-gate #endif 3890Sstevel@tonic-gate 3900Sstevel@tonic-gate #ifdef __cplusplus 3910Sstevel@tonic-gate } 3920Sstevel@tonic-gate #endif 3930Sstevel@tonic-gate 3940Sstevel@tonic-gate #endif /* _NFS_RNODE_H */ 395