libafs: Tidy up iovec allocation and trimming
[openafs.git] / src / afs / afs_prototypes.h
index 7801417..7a18f27 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -11,8 +11,9 @@
 #define _AFS_PROTOTYPES_H_
 
 /* afs_analyze.c */
-extern int afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
-                      struct VenusFid *afid, struct vrequest *areq,
+extern int afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
+                       afs_int32 acode, struct VenusFid *afid,
+                       struct vrequest *areq,
                       int op, afs_int32 locktype, struct cell *cellp);
 
 /* afs_axscache.c */
@@ -25,13 +26,6 @@ extern void afs_FreeAllAxs(struct axscache **headp);
 extern void shutdown_xscache(void);
 
 /* afs_buffer.c */
-extern void DInit(int abuffers);
-extern void *DRead(struct dcache * fid, int page);
-extern int DVOffset(void *ap);
-extern void DZap(struct dcache * fid);
-extern void DFlush(void);
-extern void DFlushDCache(struct dcache *);
-extern void *DNew(struct dcache * fid, int page);
 extern void shutdown_bufferpackage(void);
 
 /* afs_call.c */
@@ -128,7 +122,7 @@ extern afs_int32 afs_cellindex;
 extern afs_rwlock_t afs_xcell;
 extern afs_rwlock_t afsdb_client_lock;
 extern afs_rwlock_t afsdb_req_lock;
-extern struct afs_q CellLRU;           
+extern struct afs_q CellLRU;
 
 extern void afs_CellInit(void);
 extern void shutdown_cell(void);
@@ -144,6 +138,7 @@ extern struct cell *afs_GetCellByHandle(void *handle, afs_int32 locktype);
 extern struct cell *afs_GetCellByIndex(afs_int32 cellidx, afs_int32 locktype);
 extern struct cell *afs_GetCellByName(char *acellName, afs_int32 locktype);
 extern struct cell *afs_GetPrimaryCell(afs_int32 locktype);
+extern afs_int32 afs_GetPrimaryCellNum(void);
 extern int afs_IsPrimaryCellNum(afs_int32 cellnum);
 extern int afs_IsPrimaryCell(struct cell *cell);
 extern void *afs_TraverseCells(void *(*cb) (struct cell *, void *),
@@ -175,20 +170,27 @@ extern afs_rwlock_t afs_xinterface;
 extern afs_rwlock_t afs_xconn;
 extern struct afs_conn *afs_Conn(struct VenusFid *afid,
                             struct vrequest *areq,
-                            afs_int32 locktype);
+                            afs_int32 locktype,
+                             struct rx_connection **rxconn);
 extern struct afs_conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
                                 afs_int32 acell, struct unixuser *tu,
                                 int force_if_down, afs_int32 create,
-                                afs_int32 locktype);
+                                afs_int32 locktype,
+                                struct rx_connection **rxconn);
 extern struct afs_conn *afs_ConnByMHosts(struct server *ahosts[],
                                     unsigned short aport, afs_int32 acell,
                                     struct vrequest *areq,
-                                    afs_int32 locktype);
+                                    afs_int32 locktype,
+                                    struct rx_connection **rxconn);
 extern struct afs_conn *afs_ConnByHost(struct server *aserver,
                                   unsigned short aport, afs_int32 acell,
                                   struct vrequest *areq, int aforce,
-                                  afs_int32 locktype);
-extern void afs_PutConn(struct afs_conn *ac, afs_int32 locktype);
+                                  afs_int32 locktype,
+                                  struct rx_connection **rxconn);
+extern void afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
+                        afs_int32 locktype);
+extern void afs_ReleaseConns(struct sa_conn_vector *tcv);
+extern void afs_ReleaseConnsUser(register struct unixuser *au);
 extern void ForceNewConnections(struct srvAddr *sap);
 
 
@@ -278,12 +280,12 @@ extern int afs_WriteDCache(struct dcache *adc, int atime);
 extern int afs_wakeup(struct vcache *avc);
 extern int afs_InitCacheFile(char *afile, ino_t ainode);
 extern int afs_DCacheMissingChunks(struct vcache *avc);
-extern struct dcache *afs_ObtainDCacheForWriting(struct vcache *avc, 
-                                                afs_size_t filePos, 
-                                                afs_size_t len, 
+extern struct dcache *afs_ObtainDCacheForWriting(struct vcache *avc,
+                                                afs_size_t filePos,
+                                                afs_size_t len,
                                                 struct vrequest *areq,
                                                 int noLock);
-extern void afs_PopulateDCache(struct vcache *avc, afs_size_t apos, 
+extern void afs_PopulateDCache(struct vcache *avc, afs_size_t apos,
                               struct vrequest *areq);
 
 /* afs_disconnected.c */
@@ -412,8 +414,13 @@ extern int afs_icl_Event0(struct afs_icl_set *setp,
 extern void afs_icl_AppendRecord(struct afs_icl_log *logp,
                                 afs_int32 op, afs_int32 types, long p1,
                                 long p2, long p3, long p4);
+#if defined(AFS_NBSD_ENV)
+extern int Afscall_icl(long opcode, long p1, long p2, long p3, long p4,
+                      register_t *retval);
+#else
 extern int Afscall_icl(long opcode, long p1, long p2, long p3, long p4,
                       long *retval);
+#endif
 #ifdef AFS_DARWIN100_ENV
 extern int Afscall64_icl(int opcode, user_addr_t p1, user_addr_t p2,
                       user_addr_t p3, user_addr_t p4, int *retval);
@@ -493,7 +500,8 @@ extern int afs_CacheStoreVCache(struct dcache **dcList, struct vcache *avc,
                                unsigned int high, unsigned int moredata,
                                afs_hyper_t *anewDV,
                                  afs_size_t *amaxStoredLength);
-extern int afs_CacheFetchProc(struct afs_conn *tc, struct osi_file *fP,
+extern int afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn,
+                                struct osi_file *fP,
                                afs_size_t abase, struct dcache *adc,
                                struct vcache *avc, afs_int32 size,
                                struct afs_FetchOutput *tsmall);
@@ -511,7 +519,7 @@ extern int afs_MemWriteBlk(struct osi_file *fP, int offset,
                           void *src, int size);
 extern int afs_MemWritevBlk(struct memCacheEntry *mceP, int offset,
                            struct iovec *iov, int nio, int size);
-extern int afs_MemWriteUIO(afs_dcache_id_t *ainode, struct uio *uioP);
+extern int afs_MemWriteUIO(struct vcache *, afs_dcache_id_t *, struct uio *);
 extern int afs_MemCacheTruncate(struct osi_file *fP,
                                int size);
 extern void shutdown_memcache(void);
@@ -549,15 +557,12 @@ extern const afs_ucred_t *afs_osi_proc2cred(afs_proc_t * pr);
 #endif
 
 /* afs_osi_alloc.c */
-#ifndef AFS_FBSD_ENV
+#ifndef AFS_PRIVATE_OSI_ALLOCSPACES
 extern afs_lock_t osi_fsplock;
 extern afs_lock_t osi_flplock;
 #endif
 
 extern void *afs_osi_Alloc_debug(size_t x, char *func, int line);
-#ifndef afs_osi_Alloc_NoSleep
-extern void *afs_osi_Alloc_NoSleep(size_t x);
-#endif
 #ifndef afs_osi_Free
 extern void afs_osi_Free(void *x, size_t asize);
 #endif
@@ -575,12 +580,14 @@ extern void shutdown_osinet(void);
 extern int afs_setpag(afs_ucred_t **credpp);
 #elif defined(AFS_FBSD_ENV)
 extern int afs_setpag(struct thread *td, void *args);
+#elif defined(AFS_NBSD_ENV)
+extern int afs_setpag(afs_proc_t *p, const void *args, register_t *retval);
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 extern int afs_setpag(afs_proc_t *p, void *args, int *retval);
 #else
 extern int afs_setpag(void);
 #endif
-       
+
 extern afs_uint32 genpag(void);
 extern afs_uint32 getpag(void);
 #if defined(AFS_FBSD_ENV)
@@ -596,9 +603,14 @@ extern void afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p);
 extern afs_int32 PagInCred(afs_ucred_t *cred);
 
 /* afs_osi_uio.c */
+#if !defined(AFS_DARWIN80_ENV)
 extern int afsio_copy(struct uio *ainuio, struct uio *aoutuio,
                      struct iovec *aoutvec);
 extern int afsio_trim(struct uio *auio, afs_int32 asize);
+extern void afsio_free(struct uio *auio);
+#endif
+
+extern struct uio* afsio_partialcopy(struct uio *auio, size_t size);
 extern int afsio_skip(struct uio *auio, afs_int32 asize);
 
 /* afs_osi_vm.c */
@@ -618,6 +630,9 @@ extern int afs_linux_storeproc(struct storeOps *, void *, struct dcache *,
                               int *, afs_size_t *);
 #endif
 
+/* ARCH/osi_crypto.c */
+extern int osi_readRandom(void *, afs_size_t);
+
 /* ARCH/osi_misc.c */
 extern void afs_osi_SetTime(osi_timeval_t * atv);
 
@@ -627,11 +642,11 @@ extern void afs_osi_SetTime(osi_timeval_t * atv);
 extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
                          struct dentry **dpp);
 extern int osi_InitCacheInfo(char *aname);
-extern int osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
-extern void setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf,
+extern int osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw);
+extern void setup_uio(struct uio *uiop, struct iovec *iovecp, const char *buf,
                      afs_offs_t pos, int count, uio_flag_t flag,
                      uio_seg_t seg);
-extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop);
+extern int uiomove(char *dp, int length, uio_flag_t rw, struct uio *uiop);
 extern void osi_linux_free_inode_pages(void);
 #endif
 extern void osi_linux_mask(void);
@@ -660,18 +675,23 @@ extern int afs_osi_SleepSig(void *event);
 
 /* ARCH/osi_inode.c */
 #ifdef AFS_SUN5_ENV
-extern int afs_syscall_icreate(dev_t, long, long, long, long, long, 
+extern int afs_syscall_icreate(dev_t, long, long, long, long, long,
                               rval_t *, afs_ucred_t *);
 extern int afs_syscall_iopen(dev_t, int, int, rval_t *, afs_ucred_t *);
-extern int afs_syscall_iincdec(dev_t, int, int, int, rval_t *, 
+extern int afs_syscall_iincdec(dev_t, int, int, int, rval_t *,
                               afs_ucred_t *);
 #elif defined(AFS_SGI65_ENV)
 extern int afs_syscall_icreate(afs_uint32, afs_uint32, afs_uint32, afs_uint32, afs_uint32, afs_uint32, rval_t *);
 extern int afs_syscall_iopen(int, ino_t, int, rval_t *);
 extern int afs_syscall_iincdec(int, int, int, int);
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_NBSD_ENV)
+extern int afs_syscall_icreate(long, long, long, long, long, long, register_t *);
+extern int afs_syscall_iopen(int dev, int inode, int usrmod, register_t *);
+#else
 extern int afs_syscall_icreate(long, long, long, long, long, long, long*);
 extern int afs_syscall_iopen(int dev, int inode, int usrmod, long *retval);
+#endif
 extern int afs_syscall_iincdec(int dev, int inode, int inode_p1, int amount);
 #else
 extern int afs_syscall_icreate(long, long, long, long, long, long);
@@ -710,8 +730,8 @@ extern int usr_setpag(afs_ucred_t **cred, afs_uint32 pagvalue,
 extern int setpag(struct thread *td, struct ucred **cred, afs_uint32 pagvalue,
                  afs_uint32 * newpag, int change_parent);
 
-#   elif defined(AFS_NBSD40_ENV)
-extern int setpag(struct proc *proc, afs_ucred_t *cred, afs_uint32 pagvalue,
+#   elif defined(AFS_NBSD_ENV)
+extern int setpag(afs_proc_t *proc, afs_ucred_t **cred, afs_uint32 pagvalue,
                  afs_uint32 * newpag, int change_parent);
 #   else
 extern int setpag(afs_proc_t *proc, struct ucred **cred, afs_uint32 pagvalue,
@@ -733,8 +753,11 @@ extern void osi_VM_StoreAllSegments(struct vcache *avc);
 extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
                              int sync);
 extern void osi_VM_FlushPages(struct vcache *avc, afs_ucred_t *credp);
-extern void osi_VM_Truncate(struct vcache *avc, int alen,
-                           afs_ucred_t *acred);
+#if !defined(AFS_NBSD_ENV)
+extern void osi_VM_Truncate(struct vcache *avc, int alen, afs_ucred_t *acred);
+#else
+extern void osi_VM_Truncate(struct vcache *avc, voff_t alen, afs_ucred_t *acred);
+#endif
 extern void osi_VM_TryReclaim(struct vcache *avc, int *slept);
 extern void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size);
 extern int osi_VM_Setup(struct vcache *avc, int force);
@@ -801,10 +824,10 @@ extern int afs_syscall64_pioctl(user_addr_t path, unsigned int com,
                                afs_ucred_t *credp);
 #endif
 #ifdef AFS_SUN5_ENV
-extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, 
+extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg,
                              int follow, rval_t *rvp, afs_ucred_t *credp);
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, 
+extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg,
                              int follow, afs_ucred_t *credp);
 #else
 extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg,
@@ -844,6 +867,15 @@ extern void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown);
 extern afs_int32 afs_ServerDown(struct srvAddr *sa);
 extern void afs_CountServers(void);
 extern void afs_CheckServers(int adown, struct cell *acellp);
+extern void afs_LoopServers(int adown, struct cell *acellp, int vlalso,
+                           void (*func1) (struct rx_connection **rxconns,
+                                          int nconns, int nservers,
+                                          struct afs_conn **conns,
+                                          struct srvAddr **addrs),
+                           void (*func2) (struct rx_connection **rxconns,
+                                          int nconns, int nservers,
+                                          struct afs_conn **conns,
+                                          struct srvAddr **addrs));
 extern unsigned int afs_random(void);
 extern int afs_randomMod15(void);
 extern int afs_randomMod127(void);
@@ -902,8 +934,12 @@ extern int copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst);
 #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 #ifdef AFS_DARWIN100_ENV
 extern int afs3_syscall(afs_proc_t *p, void *args, unsigned int *retval);
+#elif defined(AFS_FBSD90_ENV) || defined(AFS_FBSD82_ENV)
+/* afs3_syscall prototype is in sys/sysproto.h */
 #elif defined(AFS_FBSD_ENV)
 extern int afs3_syscall(struct thread *p, void *args);
+#elif defined(AFS_NBSD50_ENV)
+extern int afs3_syscall(afs_proc_t *p, const void *args, register_t *retval);
 #elif defined(AFS_NBSD40_ENV)
 extern int afs3_syscall(struct lwp *p, void *args);
 #else
@@ -915,6 +951,22 @@ extern int afs3_syscall(afs_proc_t *p, void *args, long *retval);
 extern int Afs_syscall(void);
 #endif
 
+/* afs_tokens.c */
+struct ktc_tokenUnion;
+struct ktc_setTokenData;
+
+extern union tokenUnion *afs_FindToken(struct tokenJar *, rx_securityIndex);
+extern void afs_FreeTokens(struct tokenJar **);
+extern union tokenUnion *afs_AddToken(struct tokenJar **, rx_securityIndex);
+extern void afs_DiscardExpiredTokens(struct tokenJar **, afs_int32);
+extern int afs_HasValidTokens(struct tokenJar *, afs_int32);
+extern int afs_HasUsableTokens(struct tokenJar *, afs_int32);
+extern void afs_AddRxkadToken(struct tokenJar **, char *, int,
+                             struct ClearToken *);
+extern int afs_AddTokenFromPioctl(struct tokenJar **, struct ktc_tokenUnion *);
+extern int afs_ExtractTokensForPioctl(struct tokenJar *, time_t,
+                                     struct ktc_setTokenData *);
+
 /* UKERNEL/afs_usrops.c */
 #ifdef UKERNEL
 extern void uafs_Shutdown(void);
@@ -938,6 +990,8 @@ extern struct unixuser *afs_FindUser(afs_int32 auid, afs_int32 acell,
                                     afs_int32 locktype);
 extern struct unixuser *afs_GetUser(afs_int32 auid, afs_int32 acell,
                                    afs_int32 locktype);
+extern void afs_LockUser(struct unixuser *au, afs_int32 locktype,
+                         unsigned int src_indicator);
 extern void afs_NotifyUser(struct unixuser *auser, int event);
 
 #if AFS_GCPAGS
@@ -1030,6 +1084,7 @@ extern struct vcache *afs_LookupVCache(struct VenusFid *afid,
                                       struct vrequest *areq,
                                       afs_int32 * cached, struct vcache *adp,
                                       char *aname);
+extern void afs_FlushAllVCaches(void);
 extern int afs_FlushVCache(struct vcache *avc, int *slept);
 extern struct vcache *afs_GetRootVCache(struct VenusFid *afid,
                                        struct vrequest *areq,
@@ -1123,10 +1178,10 @@ extern int afs_LocalHero(struct vcache *avc,
 
 /* VNOPS/afs_vnop_dirops.c */
 
-extern int afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, 
+extern int afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
                     struct vcache **avcp, afs_ucred_t *acred);
 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
-extern int afs_rmdir(OSI_VC_DECL(adp), char *aname, struct vnode *cdirp, 
+extern int afs_rmdir(OSI_VC_DECL(adp), char *aname, struct vnode *cdirp,
                     afs_ucred_t *acred);
 #else
 extern int afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred);
@@ -1162,10 +1217,10 @@ extern int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
 
 /* VNOPS/afs_vnop_link.c */
 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
-extern int afs_link(OSI_VC_DECL(adp), struct vcache *avc, char *aname, 
+extern int afs_link(OSI_VC_DECL(adp), struct vcache *avc, char *aname,
                    afs_ucred_t *acred);
 #else
-extern int afs_link(struct vcache *avc, OSI_VC_DECL(adp), char *aname, 
+extern int afs_link(struct vcache *avc, OSI_VC_DECL(adp), char *aname,
                    afs_ucred_t *acred);
 #endif
 
@@ -1190,17 +1245,17 @@ extern int afs_DoBulkStat(struct vcache *adp, long dirCookie,
                          struct vrequest *areqp);
 
 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
-extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, 
-                     struct pathname *pnp, int flags, struct vnode *rdir, 
+extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp,
+                     struct pathname *pnp, int flags, struct vnode *rdir,
                      afs_ucred_t *acred);
 #elif defined(UKERNEL)
-extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, 
+extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp,
                      afs_ucred_t *acred, int flags);
 #else
-extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, 
+extern int afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp,
                      afs_ucred_t *acred);
 #endif
-       
+
 /* VNOPS/afs_vnop_open.c */
 #ifdef AFS_SGI64_ENV
 extern int afs_open(bhv_desc_t * bhv, struct vcache **avcp, afs_int32 aflags,
@@ -1212,12 +1267,11 @@ extern int afs_open(struct vcache **avcp, afs_int32 aflags,
 
 
 /* VNOPS/afs_vnop_read.c */
-extern int afs_MemRead(struct vcache *avc, struct uio *auio,
-                      afs_ucred_t *acred, daddr_t albn,
-                      struct buf **abpp, int noLock);
-extern int afs_UFSRead(struct vcache *avc, struct uio *auio,
-                      afs_ucred_t *acred, daddr_t albn,
-                      struct buf **abpp, int noLock);
+extern int afs_read(struct vcache *avc, struct uio *auio,
+                   afs_ucred_t *acred, int noLock);
+
+extern int afs_UFSReadUIO(afs_dcache_id_t *cacheId, struct uio *tuiop);
+
 extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc,
                              afs_ucred_t *acred, struct vrequest *areq);
 
@@ -1225,13 +1279,13 @@ extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc,
 /* VNOPS/afs_vnop_readdir.c */
 extern int afs_rd_stash_i;
 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio, 
+extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio,
                       afs_ucred_t *acred, int *eofp);
 #elif defined(AFS_HPUX100_ENV)
-extern int afs_readdir2(OSI_VC_DECL(avc), struct uio *auio, 
+extern int afs_readdir2(OSI_VC_DECL(avc), struct uio *auio,
                        afs_ucred_t *acred);
 #else
-extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio, 
+extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio,
                       afs_ucred_t *acred);
 #endif
 
@@ -1248,14 +1302,14 @@ extern int afsrename(struct vcache *aodp, char *aname1, struct vcache *andp,
                     char *aname2, afs_ucred_t *acred,
                     struct vrequest *areq);
 #ifdef AFS_SGI_ENV
-extern int afs_rename(OSI_VC_DECL(aodp), char *aname1, struct vcache *andp, 
-                     char *aname2, struct pathname *npnp, 
+extern int afs_rename(OSI_VC_DECL(aodp), char *aname1, struct vcache *andp,
+                     char *aname2, struct pathname *npnp,
                      afs_ucred_t *acred);
 #else
-extern int afs_rename(OSI_VC_DECL(aodp), char *aname1, struct vcache *andp, 
+extern int afs_rename(OSI_VC_DECL(aodp), char *aname1, struct vcache *andp,
                      char *aname2, afs_ucred_t *acred);
 #endif
-       
+
 /* VNOPS/afs_vnop_strategy.c */
 #if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 extern int afs_ustrategy(struct buf *adp, afs_ucred_t *credp);
@@ -1268,51 +1322,52 @@ extern int afs_MemHandleLink(struct vcache *avc,
                             struct vrequest *areq);
 extern int afs_UFSHandleLink(struct vcache *avc,
                             struct vrequest *areq);
-extern int afs_symlink(OSI_VC_DECL(adp), char *aname, 
-                      struct vattr *attrs, char *atargetName, 
+extern int afs_symlink(OSI_VC_DECL(adp), char *aname,
+                      struct vattr *attrs, char *atargetName,
                       afs_ucred_t *acred);
 extern int afs_readlink(OSI_VC_DECL(avc), struct uio *auio,
                        afs_ucred_t *acred);
 
 /* VNOPS/afs_vnop_write.c */
-extern int afs_MemWrite(struct vcache *avc, struct uio *auio,
-                       int aio, afs_ucred_t *acred, int noLock);
+extern int afs_write(struct vcache *avc, struct uio *auio, int aio,
+                    afs_ucred_t *acred, int noLock);
+
+extern int afs_UFSWriteUIO(struct vcache *, afs_dcache_id_t *, struct uio *);
+
 extern int afs_StoreOnLastReference(struct vcache *avc,
                                    struct vrequest *treq);
-extern int afs_UFSWrite(struct vcache *avc, struct uio *auio,
-                       int aio, afs_ucred_t *acred, int noLock);
 extern int afs_DoPartialWrite(struct vcache *avc,
                              struct vrequest *areq);
 extern int afs_closex(struct file *afd);
 
 #ifdef AFS_SGI65_ENV
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, 
+extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
                     lastclose_t lastclose, afs_ucred_t *acred);
 #elif defined(AFS_SGI64_ENV)
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, 
-                    lastclose_t lastclose, off_t offset, 
+extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
+                    lastclose_t lastclose, off_t offset,
                     afs_ucred_t *acred, struct flid *flp);
 #elif defined(AFS_SGI_ENV)
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, 
+extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
                     lastclose_t lastclose, off_t offset,
                     afs_ucred_t *acred);
 #elif defined(AFS_SUN5_ENV)
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, int count, 
+extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags, int count,
                     offset_t offset, afs_ucred_t *acred);
 #else
-extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,  
+extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
                     afs_ucred_t *acred);
 #endif
 
 #if defined(AFS_SGI65_ENV)
-extern int afs_fsync(OSI_VC_DECL(avc), int flags, afs_ucred_t *acred, 
+extern int afs_fsync(OSI_VC_DECL(avc), int flags, afs_ucred_t *acred,
                     off_t start, off_t stop);
 #elif defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV)
 extern int afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred);
 #else
 extern int afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred);
 #endif
-               
+
 
 /* afs_volume.c */
 extern afs_int32 afs_FVIndex;