/*
* 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
#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 */
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 */
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);
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 *),
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);
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 */
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);
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);
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);
#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
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)
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 */
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);
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);
/* 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);
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,
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);
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,
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);
#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
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);
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
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,
/* 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);
/* 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
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,
/* 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);
/* 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
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);
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;