* local value of @sys */
char *afs_sysnamelist[MAXNUMSYSNAMES]; /* For support of a list of sysname */
int afs_sysnamecount = 0;
+int afs_sysnamegen = 0;
struct volume *Initialafs_freeVolList;
int afs_memvolumes = 0;
#if defined(AFS_XBSD_ENV)
static struct vnode *volumeVnode;
#endif
+#if defined(AFS_DISCON_ENV)
+afs_rwlock_t afs_discon_lock;
+extern afs_rwlock_t afs_disconDirtyLock;
+#endif
/*
* Initialization order is important. Must first call afs_CacheInit,
usedihint = 0;
LOCK_INIT(&afs_ftf, "afs_ftf");
- RWLOCK_INIT(&afs_xaxs, "afs_xaxs");
+ AFS_RWLOCK_INIT(&afs_xaxs, "afs_xaxs");
+#ifdef AFS_DISCON_ENV
+ AFS_RWLOCK_INIT(&afs_discon_lock, "afs_discon_lock");
+ AFS_RWLOCK_INIT(&afs_disconDirtyLock, "afs_disconDirtyLock");
+ QInit(&afs_disconDirty);
+ QInit(&afs_disconShadow);
+#endif
osi_dnlc_init();
/*
*/
if (aVolumes < 50)
aVolumes = 50;
- else if (aVolumes > 3000)
- aVolumes = 3000;
+ else if (aVolumes > 32767)
+ aVolumes = 32767;
tv = (struct volume *)afs_osi_Alloc(aVolumes * sizeof(struct volume));
for (i = 0; i < aVolumes - 1; i++)
int
afs_InitCellInfo(char *afile)
{
- ino_t inode;
+ ino_t inode = 0;
int code;
+#if defined(LINUX_USE_FH)
+ struct fid fh;
+ int fh_type;
+ int max_len = sizeof(struct fid);
+ struct dentry *dp;
+#endif
+#ifdef AFS_CACHE_VNODE_PATH
+ return afs_cellname_init(AFS_CACHE_CELLS_INODE, code);
+#elif defined(LINUX_USE_FH)
+ code = gop_lookupname(afile, AFS_UIOSYS, 0, &dp);
+ fh_type = osi_get_fh(dp, &fh, &max_len);
+ return afs_cellname_init(&fh, fh_type, code);
+#else
code = LookupInodeByPath(afile, &inode, NULL);
return afs_cellname_init(inode, code);
+#endif
}
/*
{
int code;
struct osi_file *tfile;
+#if defined(LINUX_USE_FH)
+ int max_len = sizeof(struct fid);
+ struct dentry *dp;
+#endif
AFS_STATCNT(afs_InitVolumeInfo);
#if defined(AFS_XBSD_ENV)
* it in the cache...
*/
code = LookupInodeByPath(afile, &volumeInode, &volumeVnode);
+#elif defined(AFS_CACHE_VNODE_PATH)
+ volumeInode = AFS_CACHE_VOLUME_INODE;
+#elif defined(LINUX_USE_FH)
+ code = gop_lookupname(afile, AFS_UIOSYS, 0, &dp);
+ volumeinfo_fh_type = osi_get_fh(dp, &volumeinfo_fh, &max_len);
#else
code = LookupInodeByPath(afile, &volumeInode, NULL);
#endif
if (code)
return code;
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&volumeinfo_fh, volumeinfo_fh_type);
+#else
tfile = afs_CFileOpen(volumeInode);
+#endif
afs_CFileTruncate(tfile, 0);
afs_CFileClose(tfile);
return 0;
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
afs_InitDualFSCacheOps(filevp);
#endif
- cacheInode = afs_vnodeToInumber(filevp);
- cacheDev.dev = afs_vnodeToDev(filevp);
+#ifndef AFS_CACHE_VNODE_PATH
#ifndef AFS_DARWIN80_ENV
afs_cacheVfsp = filevp->v_vfsp;
#endif
+ cacheInode = afs_vnodeToInumber(filevp);
+#else
+ cacheInode = AFS_CACHE_ITEMS_INODE;
+#endif
+ cacheDev.dev = afs_vnodeToDev(filevp);
#endif /* AFS_LINUX20_ENV */
AFS_RELE(filevp);
#endif /* AFS_LINUX22_ENV */
+#if defined(LINUX_USE_FH)
+ tfile = osi_UFSOpen_fh(&cacheitems_fh, cacheitems_fh_type);
+#else
tfile = osi_UFSOpen(cacheInode);
+#endif
afs_osi_Stat(tfile, &tstat);
cacheInfoModTime = tstat.mtime;
code = afs_osi_Read(tfile, -1, &theader, sizeof(theader));
static struct rx_securityClass *secobj;
AFS_STATCNT(afs_ResourceInit);
- RWLOCK_INIT(&afs_xuser, "afs_xuser");
- RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
- RWLOCK_INIT(&afs_xserver, "afs_xserver");
- RWLOCK_INIT(&afs_xsrvAddr, "afs_xsrvAddr");
- RWLOCK_INIT(&afs_icl_lock, "afs_icl_lock");
- RWLOCK_INIT(&afs_xinterface, "afs_xinterface");
+ AFS_RWLOCK_INIT(&afs_xuser, "afs_xuser");
+ AFS_RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
+ AFS_RWLOCK_INIT(&afs_xserver, "afs_xserver");
+ AFS_RWLOCK_INIT(&afs_xsrvAddr, "afs_xsrvAddr");
+ AFS_RWLOCK_INIT(&afs_icl_lock, "afs_icl_lock");
+ AFS_RWLOCK_INIT(&afs_xinterface, "afs_xinterface");
LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock");
#ifndef AFS_FBSD_ENV
LOCK_INIT(&osi_fsplock, "osi_fsplock");
LOCK_INIT(&osi_flplock, "osi_flplock");
#endif
- RWLOCK_INIT(&afs_xconn, "afs_xconn");
+ AFS_RWLOCK_INIT(&afs_xconn, "afs_xconn");
afs_CellInit();
afs_InitCBQueue(1); /* initialize callback queues */
afs_sysname = afs_sysnamelist[0];
strcpy(afs_sysname, SYS_NAME);
afs_sysnamecount = 1;
+ afs_sysnamegen++;
}
secobj = rxnull_NewServerSecurityObject();
cacheDev.held_vnode = NULL;
}
#endif
+#if !defined(LINUX_USE_FH)
cacheInode = volumeInode = (ino_t) 0;
-
+#endif
cacheInfoModTime = 0;
afs_fsfragsize = 1023;
*/
{
struct server *ts, *nts;
- struct conn *tc, *ntc;
+ struct afs_conn *tc, *ntc;
register struct afs_cbr *tcbrp, *tbrp;
for (i = 0; i < NSERVERS; i++) {
AFS_GUNLOCK();
rx_DestroyConnection(tc->id);
AFS_GLOCK();
- afs_osi_Free(tc, sizeof(struct conn));
+ afs_osi_Free(tc, sizeof(struct afs_conn));
tc = ntc;
}
}
afs_waitForever = afs_waitForeverCount = 0;
afs_FVIndex = -1;
afs_server = (struct rx_service *)0;
- RWLOCK_INIT(&afs_xconn, "afs_xconn");
+ AFS_RWLOCK_INIT(&afs_xconn, "afs_xconn");
memset((char *)&afs_rootFid, 0, sizeof(struct VenusFid));
- RWLOCK_INIT(&afs_xuser, "afs_xuser");
- RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
- RWLOCK_INIT(&afs_xserver, "afs_xserver");
+ AFS_RWLOCK_INIT(&afs_xuser, "afs_xuser");
+ AFS_RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
+ AFS_RWLOCK_INIT(&afs_xserver, "afs_xserver");
LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock");
shutdown_cell();