afs: Never use GetNewDSlot after init
[openafs.git] / src / afs / afs_prototypes.h
index 2f37d5a..0c0f445 100644 (file)
@@ -30,7 +30,6 @@ extern void shutdown_bufferpackage(void);
 
 /* afs_call.c */
 extern int afs_cold_shutdown;
-extern afs_int32 afs_setTime;
 extern char afs_rootVolumeName[64];
 extern void afs_shutdown(void);
 extern void afs_FlushCBs(void);
@@ -175,17 +174,19 @@ extern struct afs_conn *afs_Conn(struct VenusFid *afid,
 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, afs_int32 replicated,
                                 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 replicated,
                                     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,
+                                  afs_int32 replicated,
                                   struct rx_connection **rxconn);
 extern void afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
                         afs_int32 locktype);
@@ -220,7 +221,7 @@ extern int afs_CheckRootVolume(void);
 extern void afs_BRelease(struct brequest *ab);
 extern int afs_BBusy(void);
 extern int afs_BioDaemon(afs_int32 nbiods);
-#ifdef AFS_DARWIN80_ENV
+#ifdef AFS_NEW_BKG
 extern int afs_BackgroundDaemon(struct afs_uspc_param *uspc, void *param1, void *param2);
 #else
 extern void afs_BackgroundDaemon(void);
@@ -251,8 +252,7 @@ extern void afs_FlushDCache(struct dcache *adc);
 extern void shutdown_dcache(void);
 extern void afs_CacheTruncateDaemon(void);
 extern afs_int32 afs_fsfragsize;
-extern struct dcache *afs_MemGetDSlot(afs_int32 aslot,
-                                     struct dcache *tmpdc);
+extern struct dcache *afs_MemGetDSlot(afs_int32 aslot, int indexvalid, int datavalid);
 extern struct dcache *afs_GetDCache(struct vcache *avc,
                                    afs_size_t abyte,
                                    struct vrequest *areq,
@@ -274,8 +274,7 @@ extern void afs_TryToSmush(struct vcache *avc,
 extern void updateV2DC(int lockVc, struct vcache *v, struct dcache *d,
                       int src);
 extern void afs_WriteThroughDSlots(void);
-extern struct dcache *afs_UFSGetDSlot(afs_int32 aslot,
-                                     struct dcache *tmpdc);
+extern struct dcache *afs_UFSGetDSlot(afs_int32 aslot, int indexvalid, int datavalid);
 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);
@@ -467,7 +466,7 @@ extern void afs_osi_SleepW(char *addr,
                           struct afs_lock *alock);
 extern void afs_osi_SleepS(char *addr,
                           struct afs_lock *alock);
-#ifndef AFS_NOBOZO_LOCK
+#ifdef AFS_BOZONLOCK_ENV
 extern void afs_BozonLock(struct afs_bozoLock *alock, struct vcache *avc);
 extern void afs_BozonUnlock(struct afs_bozoLock *alock, struct vcache *avc);
 extern void afs_BozonInit(struct afs_bozoLock *alock, struct vcache *avc);
@@ -504,7 +503,8 @@ 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);
+                               struct afs_FetchOutput *tsmall)
+                               AFS_NONNULL((5));
 
 /* afs_memcache.c */
 extern int afs_InitMemCache(int blkCount, int blkSize, int flags);
@@ -550,6 +550,7 @@ extern void afs_osi_RxkRegister(void);
 extern void afs_osi_Invisible(void);
 extern void shutdown_osi(void);
 extern void shutdown_osinet(void);
+extern void shutdown_osisleep(void);
 extern int afs_osi_suser(void *credp);
 extern void afs_osi_TraverseProcTable(void);
 #if defined(KERNEL) && !defined(UKERNEL)
@@ -603,9 +604,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 */
@@ -759,6 +765,7 @@ extern int osi_VM_Setup(struct vcache *avc, int force);
 
 #ifdef AFS_SUN5_ENV
 extern int osi_VM_GetDownD(struct vcache *avc, struct dcache *adc);
+extern int osi_VM_MultiPageConflict(struct vcache *avc, struct dcache *adc);
 extern void osi_VM_PreTruncate(struct vcache *avc, int alen,
                               afs_ucred_t *acred);
 #endif
@@ -849,35 +856,30 @@ extern afs_rwlock_t afs_icl_lock;
 extern struct srvAddr *afs_srvAddrs[NSERVERS];
 extern struct server *afs_servers[NSERVERS];
 extern int afs_totalServers;
-extern struct server *afs_setTimeHost;
 extern struct server *afs_FindServer(afs_int32 aserver, afs_uint16 aport,
                                     afsUUID * uuidp, afs_int32 locktype);
 extern struct server *afs_GetServer(afs_uint32 * aserver, afs_int32 nservers,
                                    afs_int32 acell, u_short aport,
                                    afs_int32 locktype, afsUUID * uuidp,
-                                   afs_int32 addr_uniquifier);
+                                   afs_int32 addr_uniquifier,
+                                   struct volume *tv);
 extern void afs_GetCapabilities(struct server *ts);
 extern void ForceAllNewConnections(void);
 extern void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown);
-extern afs_int32 afs_ServerDown(struct srvAddr *sa);
+extern afs_int32 afs_ServerDown(struct srvAddr *sa, int code,
+                                struct rx_connection *rxconn);
 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));
+                           void (*func1) (int nconns, struct rx_connection **rxconns,
+                                          struct afs_conn **conns),
+                           void (*func2) (int nconns, struct rx_connection **rxconns,
+                                          struct afs_conn **conns));
 extern unsigned int afs_random(void);
 extern int afs_randomMod15(void);
 extern int afs_randomMod127(void);
 extern void afs_SortOneServer(struct server *asp);
 extern void afs_SortServers(struct server *aservers[], int count);
-extern void afs_FlushServer(struct server *srvp);
-extern void afs_RemoveSrvAddr(struct srvAddr *sap);
 extern void afs_ActivateServer(struct srvAddr *sap);
 #ifdef AFS_USERSPACE_IP_ADDR
 extern void afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
@@ -929,8 +931,9 @@ 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_FBSD90_ENV) || defined(AFS_FBSD82_ENV)) && (__FreeBSD_version < 900044)
+/* afs3_syscall prototype is in sys/sysproto.h
+   Yes, they put it in, then took it out again (renamed with a sys_ prefix) */
 #elif defined(AFS_FBSD_ENV)
 extern int afs3_syscall(struct thread *p, void *args);
 #elif defined(AFS_NBSD50_ENV)
@@ -1004,12 +1007,13 @@ extern void afs_MarkUserExpired(afs_int32 pag);
 
 /* afs_util.c */
 extern afs_int32 afs_strtoi_r(const char *str, char **endptr, afs_uint32 *ret);
-extern afs_int32 afs_calc_inum (afs_int32 volume, afs_int32 vnode);
+extern afs_int32 afs_calc_inum(afs_int32 cell, afs_int32 volume,
+                               afs_int32 vnode);
 #ifndef afs_cv2string
 extern char *afs_cv2string(char *ttp, afs_uint32 aval);
 #endif
 #ifndef afs_strcasecmp
-extern int afs_strcasecmp(char *s1, char *s2);
+extern int afs_strcasecmp(const char *s1, const char *s2);
 #endif
 #ifndef afs_strcat
 extern char *afs_strcat(char *s1, char *s2);
@@ -1025,7 +1029,8 @@ extern char *afs_strrchr(char *s, int c);
 #endif
 extern char *afs_strdup(char *s);
 extern void print_internet_address(char *preamble, struct srvAddr *sa,
-                                  char *postamble, int flag);
+                                  char *postamble, int flag, int code,
+                                  struct rx_connection *rxconn);
 extern afs_int32 afs_data_pointer_to_int32(const void *p);
 
 extern void afs_CheckLocks(void);
@@ -1069,6 +1074,9 @@ extern void afs_FlushReclaimedVcaches(void);
 void afs_vcacheInit(int astatSize);
 extern struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 * retry,
                                     afs_int32 flag);
+extern void afs_BadFetchStatus(struct afs_conn *tc);
+extern int afs_CheckFetchStatus(struct afs_conn *tc,
+                                struct AFSFetchStatus *status);
 extern afs_int32 afs_FetchStatus(struct vcache *avc, struct VenusFid *afid,
                                 struct vrequest *areq,
                                 struct AFSFetchStatus *Outsp);
@@ -1112,7 +1120,7 @@ extern int afs_RemoteLookup(struct VenusFid *afid,
                            struct AFSCallBack *CallBackp,
                            struct server **serverp,
                            struct AFSVolSync *tsyncp);
-extern void afs_ResetVCache(struct vcache *, afs_ucred_t *);
+extern void afs_ResetVCache(struct vcache *, afs_ucred_t *, afs_int32 skipdnlc);
 extern afs_int32 afs_NFSFindVCache(struct vcache **avcp,
                                   struct VenusFid *afid);
 extern void afs_vcacheInit(int astatSize);
@@ -1184,15 +1192,13 @@ extern int afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred);
 
 struct fid;
 /* VNOPS/afs_vnop_fid.c */
-#if !defined(AFS_ATHENA_ENV)
 #ifdef AFS_AIX41_ENV
 int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp);
-#elif defined(AFS_SUN54_ENV)
+#elif defined(AFS_SUN5_ENV)
 int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp);
 #else
 int afs_fid(OSI_VC_DECL(avc), struct fid **fidpp);
 #endif                          /* AFS_AIX41_ENV */
-#endif
 
 /* VNOPS/afs_vnop_flock.c */
 extern afs_int32 lastWarnTime;
@@ -1357,7 +1363,7 @@ extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
 #if defined(AFS_SGI65_ENV)
 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)
+#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_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);
@@ -1374,16 +1380,16 @@ extern struct volume *afs_FindVolume(struct VenusFid *afid,
                                     afs_int32 locktype);
 extern struct volume *afs_freeVolList;
 extern afs_int32 fvTable[NFENTRIES];
-extern void InstallVolumeEntry(struct volume *av, struct vldbentry *ve,
-                              int acell);
-extern void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve,
-                               int acell);
-extern void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
-                               int acell, struct cell *tcell,
-                               struct vrequest *areq);
+extern void LockAndInstallVolumeEntry(struct volume *av, struct vldbentry *ve,
+                                     int acell);
+extern void LockAndInstallNVolumeEntry(struct volume *av, struct nvldbentry *ve,
+                                      int acell);
+extern void LockAndInstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
+                                      int acell, struct cell *tcell,
+                                      struct vrequest *areq);
 extern void afs_ResetVolumeInfo(struct volume *tv);
 extern struct volume *afs_MemGetVolSlot(void);
-extern void afs_ResetVolumes(struct server *srvp);
+extern void afs_ResetVolumes(struct server *srvp, struct volume *tv);
 extern struct volume *afs_GetVolume(struct VenusFid *afid,
                                    struct vrequest *areq,
                                    afs_int32 locktype);