/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
/*
* Silly rename structure that hangs off the nfsnode until the name
- * can be removed by nfs_inactive()
+ * can be removed by nfs_vnop_inactive()
*/
-struct sillyrename {
- struct ucred *s_cred;
- vnode_t s_dvp;
- long s_namlen;
- char s_name[20];
+struct nfs_sillyrename {
+ kauth_cred_t nsr_cred;
+ struct nfsnode *nsr_dnp;
+ int nsr_namlen;
+ char nsr_name[20];
};
/*
*/
struct nfsbuf {
LIST_ENTRY(nfsbuf) nb_hash; /* hash chain */
- LIST_ENTRY(nfsbuf) nb_vnbufs; /* vnode's nfsbuf chain */
+ LIST_ENTRY(nfsbuf) nb_vnbufs; /* nfsnode's nfsbuf chain */
TAILQ_ENTRY(nfsbuf) nb_free; /* free list position if not active. */
volatile long nb_flags; /* NB_* flags. */
volatile long nb_lflags; /* NBL_* flags. */
long nb_bufsize; /* buffer size */
daddr64_t nb_lblkno; /* logical block number. */
uint64_t nb_verf; /* V3 write verifier */
+ int nb_commitlevel; /* lowest write commit level */
time_t nb_timestamp; /* buffer timestamp */
int nb_error; /* errno value. */
u_int32_t nb_valid; /* valid pages in buf */
int nb_validend; /* offset of end of valid region. */
int nb_dirtyoff; /* offset in buffer of dirty region. */
int nb_dirtyend; /* offset of end of dirty region. */
+ int nb_offio; /* offset in buffer of I/O region. */
+ int nb_endio; /* offset of end of I/O region. */
+ int nb_rpcs; /* Count of RPCs remaining for this buffer. */
caddr_t nb_data; /* mapped buffer */
- vnode_t nb_vp; /* device vnode */
- proc_t nb_proc; /* associated proc; NULL if kernel. */
- struct ucred * nb_rcred; /* read credentials reference */
- struct ucred * nb_wcred; /* write credentials reference */
+ nfsnode_t nb_np; /* nfsnode buffer belongs to */
+ kauth_cred_t nb_rcred; /* read credentials reference */
+ kauth_cred_t nb_wcred; /* write credentials reference */
void * nb_pagelist; /* upl */
};
#define NFS_MAXBSIZE (32 * PAGE_SIZE) /* valid/dirty page masks limit buffer size */
+#define NFS_A_LOT_OF_NEEDCOMMITS 256 /* max# uncommitted buffers for a node */
+#define NFS_A_LOT_OF_DELAYED_WRITES MAX(nfsbufcnt/8,512) /* max# "delwri" buffers in system */
+
/*
- * These flags are kept in b_lflags...
+ * These flags are kept in b_lflags...
* nfs_buf_mutex must be held before examining/updating
*/
#define NBL_BUSY 0x00000001 /* I/O in progress. */
* very similar to the B_* flags for struct buf.
* nfs_buf_mutex is not needed to examine/update these.
*/
-#define NB_NEEDCOMMIT 0x00000002 /* Append-write in progress. */
+#define NB_STALEWVERF 0x00000001 /* write verifier changed on us */
+#define NB_NEEDCOMMIT 0x00000002 /* buffer needs to be committed */
#define NB_ASYNC 0x00000004 /* Start I/O, do not wait. */
-#define NB_CACHE 0x00000020 /* Bread found us in the cache. */
-#define NB_STABLE 0x00000040 /* write FILESYNC not UNSTABLE. */
-#define NB_DELWRI 0x00000080 /* Delay I/O until buffer reused. */
+#define NB_CACHE 0x00000020 /* buffer data found in the cache */
+#define NB_STABLE 0x00000040 /* write FILESYNC not UNSTABLE */
+#define NB_DELWRI 0x00000080 /* delayed write: dirty range needs to be written */
#define NB_DONE 0x00000200 /* I/O completed. */
#define NB_EINTR 0x00000400 /* I/O was interrupted */
#define NB_ERROR 0x00000800 /* I/O error occurred. */
-#define NB_WASDIRTY 0x00001000 /* page was found dirty in the VM cache */
#define NB_INVAL 0x00002000 /* Does not contain valid info. */
+#define NB_NCRDAHEAD 0x00004000 /* "nocache readahead" data */
#define NB_NOCACHE 0x00008000 /* Do not cache block after use. */
+#define NB_WRITE 0x00000000 /* Write buffer (pseudo flag). */
#define NB_READ 0x00100000 /* Read buffer. */
+#define NB_MULTASYNCRPC 0x00200000 /* multiple async RPCs issued for buffer */
#define NB_PAGELIST 0x00400000 /* Buffer describes pagelist I/O. */
-#define NB_WRITE 0x00000000 /* Write buffer (pseudo flag). */
#define NB_WRITEINPROG 0x01000000 /* Write in progress. */
#define NB_META 0x40000000 /* buffer contains meta-data. */
-#define NB_IOD 0x80000000 /* buffer being handled by nfsiod. */
/* Flags for operation type in nfs_buf_get() */
#define NBLK_READ 0x00000001 /* buffer for read */
#define NFSNOLIST ((struct nfsbuf *)0xdeadbeef)
-extern lck_mtx_t *nfs_buf_mutex;
-extern int nfsbufcnt, nfsbufmin, nfsbufmax, nfsbufmetacnt, nfsbufmetamax;
-extern int nfsbuffreecnt, nfsbuffreemetacnt, nfsbufdelwricnt, nfsneedbuffer;
-extern int nfs_nbdwrite;
-extern struct nfsbuffreehead nfsbuffree, nfsbufdelwri;
-extern time_t nfsbuffreeuptimestamp;
+__private_extern__ lck_mtx_t *nfs_buf_mutex;
+__private_extern__ int nfsbufcnt, nfsbufmin, nfsbufmax, nfsbufmetacnt, nfsbufmetamax;
+__private_extern__ int nfsbuffreecnt, nfsbuffreemetacnt, nfsbufdelwricnt, nfsneedbuffer;
+__private_extern__ int nfs_nbdwrite;
+__private_extern__ struct nfsbuffreehead nfsbuffree, nfsbufdelwri;
-#define NFSBUFCNTCHK(locked) \
+#ifdef NFSBUFDEBUG
+#define NFSBUFCNTCHK() \
do { \
- if (!locked) lck_mtx_lock(nfs_buf_mutex); \
if ( (nfsbufcnt < 0) || \
(nfsbufcnt > nfsbufmax) || \
(nfsbufmetacnt < 0) || \
panic("nfsbuf count error: max %d meta %d cnt %d meta %d free %d meta %d delwr %d bdw %d\n", \
nfsbufmax, nfsbufmetamax, nfsbufcnt, nfsbufmetacnt, nfsbuffreecnt, nfsbuffreemetacnt, \
nfsbufdelwricnt, nfs_nbdwrite); \
- if (!locked) lck_mtx_unlock(nfs_buf_mutex); \
+ } while (0)
+#else
+#define NFSBUFCNTCHK()
+#endif
+
+/*
+ * NFS vnode attribute structure
+ */
+#define NFSTIME_ACCESS 0 /* time of last access */
+#define NFSTIME_MODIFY 1 /* time of last modification */
+#define NFSTIME_CHANGE 2 /* time file changed */
+#define NFSTIME_CREATE 3 /* time file created */
+#define NFSTIME_BACKUP 4 /* time of last backup */
+#define NFSTIME_COUNT 5
+
+#define NFS_COMPARE_MTIME(TVP, NVAP, CMP) \
+ (((TVP)->tv_sec == (NVAP)->nva_timesec[NFSTIME_MODIFY]) ? \
+ ((TVP)->tv_nsec CMP (NVAP)->nva_timensec[NFSTIME_MODIFY]) : \
+ ((TVP)->tv_sec CMP (NVAP)->nva_timesec[NFSTIME_MODIFY]))
+#define NFS_COPY_TIME(TVP, NVAP, WHICH) \
+ do { \
+ (TVP)->tv_sec = (NVAP)->nva_timesec[NFSTIME_##WHICH]; \
+ (TVP)->tv_nsec = (NVAP)->nva_timensec[NFSTIME_##WHICH]; \
} while (0)
struct nfs_vattr {
enum vtype nva_type; /* vnode type (for create) */
- u_short nva_mode; /* files access mode and type */
- dev_t nva_rdev; /* device the special file represents */
+ uint32_t nva_mode; /* files access mode (and type) */
uid_t nva_uid; /* owner user id */
gid_t nva_gid; /* owner group id */
- uint32_t nva_fsid; /* file system id (dev for now) */
- uint64_t nva_nlink; /* number of references to file */
+ nfs_specdata nva_rawdev; /* device the special file represents */
+ uint32_t nva_flags; /* file flags */
+ uint32_t nva_maxlink; /* maximum # of links (v4) */
+ uint64_t nva_nlink; /* number of references to file */
uint64_t nva_fileid; /* file id */
+ nfs_fsid nva_fsid; /* file system id */
uint64_t nva_size; /* file size in bytes */
uint64_t nva_bytes; /* bytes of disk space held by file */
- uint32_t nva_blocksize; /* blocksize preferred for i/o */
- struct timespec nva_atime; /* time of last access */
- struct timespec nva_mtime; /* time of last modification */
- struct timespec nva_ctime; /* time file changed */
+ uint64_t nva_change; /* change attribute */
+ int64_t nva_timesec[NFSTIME_COUNT];
+ int32_t nva_timensec[NFSTIME_COUNT];
+ uint32_t nva_bitmap[NFS_ATTR_BITMAP_LEN]; /* attributes that are valid */
};
+#define NFS_FFLAG_ARCHIVED 0x0001
+#define NFS_FFLAG_HIDDEN 0x0002
+#define NFS_FFLAG_NAMED_ATTR 0x0004 /* file has named attributes */
+
+/*
+ * macros for detecting node changes
+ *
+ * These macros help us determine if a file has been changed on the server and
+ * thus whether or not we need to invalidate any cached data.
+ *
+ * For NFSv2/v3, the modification time is used.
+ * For NFSv4, the change attribute is used.
+ */
+#define NFS_CHANGED(VERS, NP, NVAP) \
+ (((VERS) >= NFS_VER4) ? \
+ ((NP)->n_change != (NVAP)->nva_change) : \
+ NFS_COMPARE_MTIME(&(NP)->n_mtime, (NVAP), !=))
+#define NFS_CHANGED_NC(VERS, NP, NVAP) \
+ (((VERS) >= NFS_VER4) ? \
+ ((NP)->n_ncchange != (NVAP)->nva_change) : \
+ NFS_COMPARE_MTIME(&(NP)->n_ncmtime, (NVAP), !=))
+#define NFS_CHANGED_UPDATE(VERS, NP, NVAP) \
+ do { \
+ if ((VERS) >= NFS_VER4) \
+ (NP)->n_change = (NVAP)->nva_change; \
+ else \
+ NFS_COPY_TIME(&(NP)->n_mtime, (NVAP), MODIFY); \
+ } while (0)
+#define NFS_CHANGED_UPDATE_NC(VERS, NP, NVAP) \
+ do { \
+ if ((VERS) >= NFS_VER4) \
+ (NP)->n_ncchange = (NVAP)->nva_change; \
+ else \
+ NFS_COPY_TIME(&(NP)->n_ncmtime, (NVAP), MODIFY); \
+ } while (0)
+
/*
- * 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.
+ * The nfsnode is the NFS equivalent of an inode.
+ * There is a unique nfsnode for each NFS vnode.
* An nfsnode is 'named' by its file handle. (nget/nfs_node.c)
- * If this structure exceeds 256 bytes (it is currently 256 using 4.4BSD-Lite
- * type definitions), file handles of > 32 bytes should probably be split out
- * into a separate MALLOC()'d data structure. (Reduce the size of nfsnode.n_fh
- * by changing the definition in nfsproto.h of NFS_SMALLFH.)
* NB: Hopefully the current order of the fields is such that everything will
* be well aligned and, therefore, tightly packed.
*/
+
+#define NFS_ACCESS_CACHE_SIZE 3
+
struct nfsnode {
+ lck_rw_t n_lock; /* nfs node lock */
+ void *n_lockowner; /* nfs node lock owner (exclusive) */
+ lck_rw_t n_datalock; /* nfs node data lock */
+ void *n_datalockowner;/* nfs node data lock owner (exclusive) */
LIST_ENTRY(nfsnode) n_hash; /* Hash chain */
u_quad_t n_size; /* Current size of file */
+ u_quad_t n_newsize; /* new size of file (pending update) */
+ u_int64_t n_xid; /* last xid to loadattr */
struct nfs_vattr n_vattr; /* Vnode attribute cache */
time_t n_attrstamp; /* Attr. cache timestamp */
- u_int32_t n_mode; /* ACCESS mode cache */
- uid_t n_modeuid; /* credentials having mode */
- time_t n_modestamp; /* mode cache timestamp */
- struct timespec n_mtime; /* Prev modify time. */
- struct timespec n_ncmtime; /* namecache modify time. */
- u_char *n_fhp; /* NFS File Handle */
+ u_int8_t n_mode[NFS_ACCESS_CACHE_SIZE+1]; /* ACCESS mode cache */
+ uid_t n_modeuid[NFS_ACCESS_CACHE_SIZE]; /* credentials having mode */
+ time_t n_modestamp[NFS_ACCESS_CACHE_SIZE]; /* mode cache timestamp */
union {
- vnode_t n_vp; /* associated vnode */
- mount_t n_mp; /* associated mount (NINIT) */
- } n_un0;
- struct lockf *n_lockf; /* Locking record of file */
+ struct {
+ struct timespec n3_mtime; /* Prev modify time. */
+ struct timespec n3_ncmtime; /* namecache modify time. */
+ } v3;
+ struct {
+ uint64_t n4_change; /* prev change attribute */
+ uint64_t n4_ncchange; /* namecache change attribute */
+ } v4;
+ } n_un4;
+ vnode_t n_parent; /* this node's parent */
+ u_char *n_fhp; /* NFS File Handle */
+ vnode_t n_vnode; /* associated vnode */
+ mount_t n_mount; /* associated mount (NHINIT) */
int n_error; /* Save write error value */
union {
struct timespec nf_atim; /* Special file times */
nfsuint64 nd_cookieverf; /* Cookie verifier (dir only) */
} n_un1;
union {
- struct timespec nf_mtim;
+ struct timespec nf_mtim; /* Special file times */
+ daddr64_t nf_lastread; /* last block# read from (for readahead) */
off_t nd_direof; /* Dir. EOF offset cache */
} n_un2;
union {
- struct sillyrename *nf_silly; /* Ptr to silly rename struct */
+ struct nfs_sillyrename *nf_silly;/* Ptr to silly rename struct */
LIST_HEAD(, nfsdmap) nd_cook; /* cookies */
} n_un3;
- short n_fhsize; /* size in bytes, of fh */
- short n_flag; /* Flag for locking.. */
+ u_short n_fhsize; /* size in bytes, of fh */
+ u_short n_flag; /* node flags */
+ u_short n_hflag; /* node hash flags */
+ u_short n_bflag; /* node buffer flags */
u_char n_fh[NFS_SMALLFH];/* Small File Handle */
- u_int64_t n_xid; /* last xid to loadattr */
struct nfsbuflists n_cleanblkhd; /* clean blocklist head */
struct nfsbuflists n_dirtyblkhd; /* dirty blocklist head */
+ int n_wrbusy; /* # threads in write/fsync */
int n_needcommitcnt;/* # bufs that need committing */
int n_bufiterflags; /* buf iterator flags */
};
+#define NFS_NODE_LOCK_SHARED 1
+#define NFS_NODE_LOCK_EXCLUSIVE 2
+#define NFS_NODE_LOCK_FORCE 3
+
#define nfstimespeccmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \
} \
} while (0)
-#define n_vnode n_un0.n_vp
-#define n_mount n_un0.n_mp
-#define n_atim n_un1.nf_atim
-#define n_mtim n_un2.nf_mtim
-#define n_sillyrename n_un3.nf_silly
-#define n_cookieverf n_un1.nd_cookieverf
-#define n_direofoffset n_un2.nd_direof
-#define n_cookies n_un3.nd_cook
+#define n_atim n_un1.nf_atim
+#define n_mtim n_un2.nf_mtim
+#define n_lastread n_un2.nf_lastread
+#define n_sillyrename n_un3.nf_silly
+#define n_cookieverf n_un1.nd_cookieverf
+#define n_direofoffset n_un2.nd_direof
+#define n_cookies n_un3.nd_cook
+#define n_mtime n_un4.v3.n3_mtime
+#define n_ncmtime n_un4.v3.n3_ncmtime
+#define n_change n_un4.v4.n4_change
+#define n_ncchange n_un4.v4.n4_ncchange
/*
* Flags for n_flag
*/
-#define NFLUSHWANT 0x0001 /* Want wakeup from a flush in prog. */
-#define NFLUSHINPROG 0x0002 /* Avoid multiple calls to vinvalbuf() */
+#define NUPDATESIZE 0x0001 /* size of file needs updating */
#define NMODIFIED 0x0004 /* Might have a modified buffer in bio */
#define NWRITEERR 0x0008 /* Flag write errors so close will know */
#define NNEEDINVALIDATE 0x0010 /* need to call vinvalbuf() */
-#define NNOCACHE 0x0020 /* all bufs are uncached */
-#define NWRBUSY 0x0040 /* node in write/fsync */
#define NACC 0x0100 /* Special file accessed */
#define NUPD 0x0200 /* Special file updated */
#define NCHG 0x0400 /* Special file times changed */
-#define NHASHED 0x1000 /* someone wants to lock */
-#define NINIT 0x2000 /* node is being initialized */
-#define NWINIT 0x4000 /* someone waiting for init to complete */
+#define NNEGNCENTRIES 0x0800 /* directory has negative name cache entries */
+
+/*
+ * Flags for n_hflag
+ * Note: protected by nfs_node_hash_mutex
+ */
+#define NHHASHED 0x0001 /* node is in hash table */
+#define NHINIT 0x0002 /* node is being initialized */
+#define NHLOCKED 0x0004 /* node is locked (initting or deleting) */
+#define NHLOCKWANT 0x0008 /* someone wants to lock */
+/*
+ * Flags for n_bflag
+ * Note: protected by nfs_buf_mutex
+ */
+#define NBFLUSHINPROG 0x0001 /* Avoid multiple calls to nfs_flush() */
+#define NBFLUSHWANT 0x0002 /* waiting for nfs_flush() to complete */
+#define NBINVALINPROG 0x0004 /* Avoid multiple calls to nfs_vinvalbuf() */
+#define NBINVALWANT 0x0008 /* waiting for nfs_vinvalbuf() to complete */
+
+/* attr/mode timestamp macros */
#define NATTRVALID(np) ((np)->n_attrstamp != ~0)
#define NATTRINVALIDATE(np) ((np)->n_attrstamp = ~0)
-#define NMODEVALID(np) ((np)->n_modestamp != ~0)
-#define NMODEINVALIDATE(np) ((np)->n_modestamp = ~0)
-
-#define NVALIDBUFS(np) (!LIST_EMPTY(&(np)->n_dirtyblkhd) || \
- !LIST_EMPTY(&(np)->n_cleanblkhd))
+#define NMODEVALID(np, slot) (((slot) >= 0) && ((slot) < 3) && ((np)->n_modestamp[(slot)] != ~0))
+#define NMODEINVALIDATE(np) \
+ do { \
+ (np)->n_modestamp[0] = ~0; \
+ (np)->n_modestamp[1] = ~0; \
+ (np)->n_modestamp[2] = ~0; \
+ (np)->n_mode[3] = 0; \
+ } while (0)
/*
* NFS-specific flags for nfs_vinvalbuf/nfs_flush
/*
* Convert between nfsnode pointers and vnode pointers
*/
-#define VTONFS(vp) ((struct nfsnode *)vnode_fsnode(vp))
+#define VTONFS(vp) ((nfsnode_t)vnode_fsnode(vp))
#define NFSTOV(np) ((np)->n_vnode)
/* nfsnode hash table mutex */
-extern lck_mtx_t *nfs_node_hash_mutex;
+__private_extern__ lck_mtx_t *nfs_node_hash_mutex;
/*
* nfsiod structures
*/
-extern proc_t nfs_iodwant[NFS_MAXASYNCDAEMON];
-extern struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON];
-extern lck_grp_t *nfs_iod_lck_grp;
-extern lck_grp_attr_t *nfs_iod_lck_grp_attr;
-extern lck_attr_t *nfs_iod_lck_attr;
-extern lck_mtx_t *nfs_iod_mutex;
+struct nfsiod {
+ TAILQ_ENTRY(nfsiod) niod_link; /* List of nfsiods */
+ struct nfsmount * niod_nmp; /* mount point for this nfsiod */
+};
+TAILQ_HEAD(nfsiodlist, nfsiod);
+TAILQ_HEAD(nfsiodmountlist, nfsmount);
+__private_extern__ struct nfsiodlist nfsiodfree, nfsiodwork;
+__private_extern__ struct nfsiodmountlist nfsiodmounts;
+__private_extern__ lck_mtx_t *nfsiod_mutex;
#if defined(KERNEL)
extern vnop_t **fifo_nfsv2nodeop_p;
extern vnop_t **nfsv2_vnodeop_p;
extern vnop_t **spec_nfsv2nodeop_p;
+extern vnop_t **fifo_nfsv4nodeop_p;
+extern vnop_t **nfsv4_vnodeop_p;
+extern vnop_t **spec_nfsv4nodeop_p;
/*
* Prototypes for NFS vnode operations
*/
-int nfs_write(struct vnop_write_args *);
-#define nfs_revoke nop_revoke
-#define nfs_seek ((int (*)(struct vnop_seek_args *))nullop) //XXXdead?
-int nfs_inactive(struct vnop_inactive_args *);
-int nfs_reclaim(struct vnop_reclaim_args *);
-
+int nfs_vnop_write(struct vnop_write_args *);
+#define nfs_vnop_revoke nop_revoke
+int nfs_vnop_inactive(struct vnop_inactive_args *);
+int nfs_vnop_reclaim(struct vnop_reclaim_args *);
+
+int nfs_lock(nfsnode_t, int);
+void nfs_unlock(nfsnode_t);
+int nfs_lock2(nfsnode_t, nfsnode_t, int);
+void nfs_unlock2(nfsnode_t, nfsnode_t);
+int nfs_lock4(nfsnode_t, nfsnode_t, nfsnode_t, nfsnode_t, int);
+void nfs_unlock4(nfsnode_t, nfsnode_t, nfsnode_t, nfsnode_t);
+void nfs_data_lock(nfsnode_t, int);
+void nfs_data_lock2(nfsnode_t, int, int);
+void nfs_data_unlock(nfsnode_t);
+void nfs_data_unlock2(nfsnode_t, int);
+void nfs_data_update_size(nfsnode_t, int);
/* other stuff */
-int nfs_removeit(struct sillyrename *);
-int nfs_nget(mount_t,vnode_t,struct componentname *,u_char *,int,struct nfs_vattr *,u_int64_t *,int,struct nfsnode **);
-nfsuint64 *nfs_getcookie(struct nfsnode *, off_t, int);
-void nfs_invaldir(vnode_t);
+int nfs_removeit(struct nfs_sillyrename *);
+int nfs_nget(mount_t,nfsnode_t,struct componentname *,u_char *,int,struct nfs_vattr *,u_int64_t *,int,nfsnode_t*);
+nfsuint64 *nfs_getcookie(nfsnode_t, off_t, int);
+void nfs_invaldir(nfsnode_t);
/* nfsbuf functions */
void nfs_nbinit(void);
+void nfs_buf_timer(void *, void *);
void nfs_buf_remfree(struct nfsbuf *);
-boolean_t nfs_buf_is_incore(vnode_t, daddr64_t);
-struct nfsbuf * nfs_buf_incore(vnode_t, daddr64_t);
-int nfs_buf_get(vnode_t, daddr64_t, int, proc_t, int, struct nfsbuf **);
+boolean_t nfs_buf_is_incore(nfsnode_t, daddr64_t);
+struct nfsbuf * nfs_buf_incore(nfsnode_t, daddr64_t);
+int nfs_buf_get(nfsnode_t, daddr64_t, int, thread_t, int, struct nfsbuf **);
int nfs_buf_upl_setup(struct nfsbuf *bp);
void nfs_buf_upl_check(struct nfsbuf *bp);
+void nfs_buf_normalize_valid_range(nfsnode_t, struct nfsbuf *);
+int nfs_buf_map(struct nfsbuf *);
void nfs_buf_release(struct nfsbuf *, int);
int nfs_buf_iowait(struct nfsbuf *);
void nfs_buf_iodone(struct nfsbuf *);
-void nfs_buf_write_delayed(struct nfsbuf *, proc_t);
-void nfs_buf_check_write_verifier(struct nfsnode *, struct nfsbuf *);
+void nfs_buf_write_delayed(struct nfsbuf *);
+void nfs_buf_check_write_verifier(nfsnode_t, struct nfsbuf *);
void nfs_buf_freeup(int);
void nfs_buf_refget(struct nfsbuf *bp);
void nfs_buf_refrele(struct nfsbuf *bp);
void nfs_buf_drop(struct nfsbuf *);
errno_t nfs_buf_acquire(struct nfsbuf *, int, int, int);
-int nfs_buf_iterprepare(struct nfsnode *, struct nfsbuflists *, int);
-void nfs_buf_itercomplete(struct nfsnode *, struct nfsbuflists *, int);
+int nfs_buf_iterprepare(nfsnode_t, struct nfsbuflists *, int);
+void nfs_buf_itercomplete(nfsnode_t, struct nfsbuflists *, int);
+
+int nfs_bioread(nfsnode_t, struct uio *, int, int *, vfs_context_t);
+int nfs_buf_readdir(struct nfsbuf *, vfs_context_t);
+int nfs_buf_read(struct nfsbuf *);
+void nfs_buf_read_finish(struct nfsbuf *);
+int nfs_buf_read_rpc(struct nfsbuf *, thread_t, kauth_cred_t);
+void nfs_buf_read_rpc_finish(struct nfsreq *);
+int nfs_buf_write(struct nfsbuf *);
+void nfs_buf_write_finish(struct nfsbuf *, thread_t, kauth_cred_t);
+int nfs_buf_write_rpc(struct nfsbuf *, int, thread_t, kauth_cred_t);
+void nfs_buf_write_rpc_finish(struct nfsreq *);
+int nfs_buf_write_dirty_pages(struct nfsbuf *, thread_t, kauth_cred_t);
+
+int nfs_flushcommits(nfsnode_t, int);
+int nfs_flush(nfsnode_t, int, thread_t, int);
+
+int nfsiod_start(void);
+void nfs_asyncio_finish(struct nfsreq *);
+void nfs_asyncio_resend(struct nfsreq *);
#endif /* KERNEL */