2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * afs_init.c - initialize AFS client.
16 #include <afsconfig.h>
17 #include "../afs/param.h"
21 #include "../afs/stds.h"
22 #include "../afs/sysincludes.h" /* Standard vendor system headers */
23 #include "../afs/afsincludes.h" /* Afs-based standard headers */
24 #include "../afs/afs_stats.h" /* afs statistics */
27 /* Imported variables */
28 extern afs_int32 afs_waitForever;
29 extern short afs_waitForeverCount;
30 extern afs_int32 afs_FVIndex;
31 extern struct server *afs_setTimeHost;
32 extern struct server *afs_servers[NSERVERS];
33 extern struct unixuser *afs_users[NUSERS];
34 extern struct volume *afs_freeVolList;
35 extern struct volume *afs_volumes[NVOLS];
36 extern afs_int32 afs_volCounter;
38 extern afs_rwlock_t afs_xaxs;
39 extern afs_rwlock_t afs_xvolume;
40 extern afs_rwlock_t afs_xuser;
41 extern afs_rwlock_t afs_xserver;
43 extern afs_lock_t osi_fsplock;
45 extern afs_lock_t osi_flplock;
46 extern afs_int32 fvTable[NFENTRIES];
49 extern afs_rwlock_t afs_xcell;
50 extern struct afs_q CellLRU;
51 extern afs_int32 afs_cellindex;
52 extern afs_int32 afs_nextCellNum;
55 extern afs_rwlock_t afs_xconn;
56 extern afs_rwlock_t afs_xinterface;
59 extern struct rx_service *afs_server;
63 extern afs_int32 afs_mariner;
64 extern afs_int32 afs_marinerHost;
67 extern ino_t volumeInode;
70 extern afs_uint32 pag_epoch;
73 extern afs_rwlock_t afs_xdcache;
74 extern int cacheDiskType;
75 extern afs_int32 afs_fsfragsize;
76 extern ino_t cacheInode;
77 extern struct osi_file *afs_cacheInodep;
78 extern afs_int32 afs_freeDCList; /*Free list for disk cache entries*/
82 extern afs_rwlock_t afs_xvcache;
83 extern afs_rwlock_t afs_xvcb;
85 /* VNOPS/afs_vnop_read.c */
86 extern afs_int32 maxIHint;
87 extern afs_int32 nihints; /* # of above actually in-use */
88 extern afs_int32 usedihint;
91 extern afs_int32 afs_setTime;
93 /* Imported functions. */
94 extern struct rx_securityClass *rxnull_NewServerSecurityObject();
95 extern int RXAFSCB_ExecuteRequest();
96 extern int RXSTATS_ExecuteRequest();
100 extern afs_lock_t afs_ftf;
102 /* Exported variables */
103 struct osi_dev cacheDev; /*Cache device*/
104 afs_int32 cacheInfoModTime; /*Last time cache info modified*/
105 #if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
106 struct mount *afs_cacheVfsp=0;
107 #elif defined(AFS_LINUX20_ENV)
108 struct super_block *afs_cacheSBp = 0;
110 struct vfs *afs_cacheVfsp=0;
112 afs_rwlock_t afs_puttofileLock; /* not used */
113 char *afs_sysname = 0; /* So that superuser may change the
114 * local value of @sys */
115 char *afs_sysnamelist[MAXNUMSYSNAMES]; /* For support of a list of sysname */
116 int afs_sysnamecount = 0;
117 struct volume *Initialafs_freeVolList;
118 int afs_memvolumes = 0;
120 /* Local variables */
124 * Initialization order is important. Must first call afs_CacheInit,
125 * then cache file and volume file initialization routines. Next, the
126 * individual cache entry initialization routines are called.
136 * astatSize : The number of stat cache (vnode) entries to
138 * afiles : The number of disk files to allocate to the cache
139 * ablocks : The max number of 1 Kbyte blocks that all of
140 * the files in the cache may occupy.
141 * aDentries : Number of dcache entries to allocate.
142 * aVolumes : Number of volume cache entries to allocate.
143 * achunk : Power of 2 to make the chunks.
144 * aflags : Flags passed in.
145 * inodes : max inodes to pin down in inode[]
146 * users : what should size of per-user access cache be?
149 * This routine should only be called at initialization time, since
150 * it reclaims no resources and doesn't sufficiently synchronize
151 * with other processes.
154 struct cm_initparams cm_initParams;
155 static int afs_cacheinit_flag = 0;
157 afs_CacheInit(astatSize, afiles, ablocks, aDentries, aVolumes, achunk, aflags,
160 afs_int32 astatSize, ablocks;
161 afs_int32 achunk, aflags, ninodes, nusers;
164 extern int afs_memvolumes;
165 register afs_int32 i, preallocs;
166 register struct volume *tv;
169 AFS_STATCNT(afs_CacheInit);
171 * Jot down the epoch time, namely when this incarnation of the
172 * Cache Manager started.
174 afs_stats_cmperf.epoch = pag_epoch = osi_Time();
176 afs_stats_cmperf.sysName_ID = SYS_NAME_ID;
178 afs_stats_cmperf.sysName_ID = SYS_NAME_ID_UNDEFINED;
179 #endif /* SYS_NAME_ID */
181 printf("Starting AFS cache scan...");
182 if (afs_cacheinit_flag)
184 afs_cacheinit_flag = 1;
185 cacheInfoModTime = 0;
190 LOCK_INIT(&afs_ftf, "afs_ftf");
191 RWLOCK_INIT(&afs_xaxs, "afs_xaxs");
195 #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)
197 * We want to also reserve space for the gnode struct which is associated
198 * with each vnode (vcache) one; we want to use the pinned pool for them
199 * since they're referenced at interrupt level.
201 if (afs_stats_cmperf.SmallBlocksAlloced + astatSize < 3600)
202 preallocs = astatSize;
204 preallocs = 3600 - afs_stats_cmperf.SmallBlocksAlloced;
205 if (preallocs <= 0) preallocs = 10;
207 osi_AllocMoreSSpace(preallocs);
210 * create volume list structure
212 if ( aVolumes < 50 ) aVolumes = 50;
213 if (aVolumes > 3000) aVolumes = 3000;
215 tv = (struct volume *) afs_osi_Alloc(aVolumes * sizeof(struct volume));
216 for (i=0;i<aVolumes-1;i++)
217 tv[i].next = &tv[i+1];
218 tv[aVolumes-1].next = (struct volume *) 0;
219 afs_freeVolList = Initialafs_freeVolList = tv;
220 afs_memvolumes = aVolumes;
222 afs_cacheFiles = afiles;
223 afs_cacheStats = astatSize;
224 afs_vcacheInit(astatSize);
225 afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags);
226 #ifdef AFS_64BIT_CLIENT
227 #ifdef AFS_VM_RDWR_ENV
228 afs_vmMappingEnd = AFS_CHUNKBASE(0x7fffffff);
229 #endif /* AFS_VM_RDWR_ENV */
230 #endif /* AFS_64BIT_CLIENT */
232 #if defined(AFS_AIX_ENV)
234 static void afs_procsize_init(void);
240 /* Save the initialization parameters for later pioctl queries. */
241 cm_initParams.cmi_version = CMI_VERSION;
242 cm_initParams.cmi_nChunkFiles = afiles;
243 cm_initParams.cmi_nStatCaches = astatSize;
244 cm_initParams.cmi_nDataCaches = aDentries;
245 cm_initParams.cmi_nVolumeCaches = aVolumes;
246 cm_initParams.cmi_firstChunkSize = AFS_FIRSTCSIZE;
247 cm_initParams.cmi_otherChunkSize = AFS_OTHERCSIZE;
248 cm_initParams.cmi_cacheSize = ablocks;
249 cm_initParams.cmi_setTime = afs_setTime;
250 cm_initParams.cmi_memCache = (aflags & AFSCALL_INIT_MEMCACHE) ? 1 : 0;
258 * afs_ComputeCacheParams
261 * Set some cache parameters.
268 afs_ComputeCacheParms()
270 { /*afs_ComputeCacheParms*/
272 register afs_int32 i;
273 afs_int32 afs_maxCacheDirty;
276 * Don't allow more than 2/3 of the files in the cache to be dirty.
278 afs_maxCacheDirty = (2*afs_cacheFiles) / 3;
281 * Also, don't allow more than 2/3 of the total space get filled
282 * with dirty chunks. Compute the total number of chunks required
283 * to fill the cache, make sure we don't set out limit above 2/3 of
284 * that. If the cache size is greater than 1G, avoid overflow at
285 * the expense of precision on the chunk size.
287 if (afs_cacheBlocks & 0xffe00000) {
288 i = afs_cacheBlocks / (AFS_FIRSTCSIZE >> 10);
291 i = (afs_cacheBlocks << 10) / AFS_FIRSTCSIZE;
294 if (afs_maxCacheDirty > i)
295 afs_maxCacheDirty = i;
296 if (afs_maxCacheDirty < 1)
297 afs_maxCacheDirty = 1;
298 afs_stats_cmperf.cacheMaxDirtyChunks = afs_maxCacheDirty;
299 } /*afs_ComputeCacheParms*/
306 * Set up the volume info storage file.
309 * afile : the file to be declared to be the volume info storage
310 * file for AFS. It must be already truncated to 0 length.
313 * This function is called only during initialization.
315 * WARNING: Data will be written to this file over time by AFS.
318 afs_InitVolumeInfo(afile)
319 register char *afile;
321 { /*afs_InitVolumeInfo*/
324 struct osi_file *tfile;
325 struct vnode *filevp;
328 AFS_STATCNT(afs_InitVolumeInfo);
329 #ifdef AFS_LINUX22_ENV
332 code = gop_lookupname(afile, AFS_UIOSYS, 0, (struct vnode **) 0, &dp);
333 if (code) return ENOENT;
334 fce.inode = volumeInode = dp->d_inode->i_ino;
338 code = gop_lookupname(afile, AFS_UIOSYS, 0, (struct vnode **) 0, &filevp);
339 if (code) return ENOENT;
340 fce.inode = volumeInode = afs_vnodeToInumber(filevp);
344 AFS_RELE((struct vnode *)filevp);
346 #endif /* AFS_LINUX22_ENV */
347 tfile = afs_CFileOpen(fce.inode);
348 afs_CFileTruncate(tfile, 0);
349 afs_CFileClose(tfile);
352 } /*afs_InitVolumeInfo*/
358 * Set up the given file as the AFS cache info file.
361 * afile : Name of the file assumed to be the cache info file
362 * for the Cache Manager; it will be used as such.
363 * Side Effects: This sets afs_fragsize, which is used in the cache usage
364 * calculations such as in afs_adjustsize()
367 * This function is called only during initialization. The given
368 * file should NOT be truncated to 0 lenght; its contents descrebe
369 * what data is really in the cache.
371 * WARNING: data will be written to this file over time by AFS.
373 * NOTE: Starting to use separate osi_InitCacheInfo() routines to clean up
377 afs_InitCacheInfo(afile)
378 register char *afile;
380 { /*afs_InitCacheInfo*/
382 register afs_int32 code;
383 struct osi_stat tstat;
384 register struct osi_file *tfile;
385 struct afs_fheader theader;
386 struct vnode *filevp;
389 AFS_STATCNT(afs_InitCacheInfo);
390 if(cacheDiskType != AFS_FCACHE_TYPE_UFS)
391 osi_Panic("afs_InitCacheInfo --- called for non-ufs cache!");
392 #ifdef AFS_LINUX22_ENV
393 code = osi_InitCacheInfo(afile);
394 if (code) return code;
396 code = gop_lookupname(afile, AFS_UIOSYS, 0, (struct vnode **) 0, &filevp);
397 if (code || !filevp) return ENOENT;
399 #if defined(AFS_SUN56_ENV)
402 #if defined(AFS_HPUX102_ENV)
405 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) ||defined(AFS_HPUX100_ENV)
408 #if defined(AFS_DUX40_ENV)
413 #endif /* SUN5 SGI */
414 #endif /* HP 10.20 */
417 #if defined(AFS_SGI_ENV)
419 VFS_STATVFS(filevp->v_vfsp, &st, (struct vnode *)0, code);
422 if (!VFS_STATFS(filevp->v_vfsp, &st, (struct vnode *)0))
423 #endif /* AFS_SGI65_ENV */
424 #else /* AFS_SGI_ENV */
425 #if defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV)
426 if (!VFS_STATVFS(filevp->v_vfsp, &st))
430 VFS_STATFS(filevp->v_vfsp, code);
432 st = filevp->v_vfsp->m_stat;
434 #else /* AFS_OSF_ENV */
436 if (!VFS_STATFS(filevp->v_vfsp, &st, &afs_osi_cred))
438 #ifdef AFS_LINUX20_ENV
443 VFS_STATFS(filevp->v_vfsp, &st);
447 #if defined(AFS_DARWIN_ENV)
448 if (!VFS_STATFS(filevp->v_mount, &st, current_proc()))
450 #if defined(AFS_FBSD_ENV)
451 if (!VFS_STATFS(filevp->v_mount, &st, curproc))
453 if (!VFS_STATFS(filevp->v_vfsp, &st))
454 #endif /* AFS_FBSD_ENV */
455 #endif /* AFS_DARWIN_ENV */
456 #endif /* AFS_LINUX20_ENV */
459 #endif /* SUN5 HP10 */
461 #if defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV)
462 afs_fsfragsize = st.f_frsize - 1;
464 afs_fsfragsize = st.f_bsize - 1;
467 #ifdef AFS_LINUX20_ENV
468 cacheInode = filevp->i_ino;
469 afs_cacheSBp = filevp->i_sb;
471 #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
472 afs_InitDualFSCacheOps(filevp);
474 cacheInode = afs_vnodeToInumber(filevp);
475 cacheDev.dev = afs_vnodeToDev(filevp);
476 afs_cacheVfsp = filevp->v_vfsp;
477 #endif /* AFS_LINUX20_ENV */
478 AFS_RELE((struct vnode *)filevp);
479 #endif /* AFS_LINUX22_ENV */
480 tfile = osi_UFSOpen(cacheInode);
481 afs_osi_Stat(tfile, &tstat);
482 cacheInfoModTime = tstat.mtime;
483 code = afs_osi_Read(tfile, -1, &theader, sizeof(theader));
485 if (code == sizeof(theader)) {
486 /* read the header correctly */
487 if (theader.magic == AFS_FHMAGIC &&
488 theader.firstCSize == AFS_FIRSTCSIZE &&
489 theader.otherCSize == AFS_OTHERCSIZE &&
490 theader.version == AFS_CI_VERSION
495 /* write out a good file label */
496 theader.magic = AFS_FHMAGIC;
497 theader.firstCSize = AFS_FIRSTCSIZE;
498 theader.otherCSize = AFS_OTHERCSIZE;
499 theader.version = AFS_CI_VERSION;
500 afs_osi_Write(tfile, 0, &theader, sizeof(theader));
502 * Truncate the rest of the file, since it may be arbitrarily
505 osi_UFSTruncate(tfile, sizeof(struct afs_fheader));
507 /* Leave the file open now, since reopening the file makes public pool
508 * vnode systems (like OSF/Alpha) much harder to handle, That's because
509 * they can do a vnode recycle operation any time we open a file, which
510 * we'd do on any afs_GetDSlot call, etc.
512 afs_cacheInodep = (struct osi_file *)tfile;
515 } /*afs_InitCacheInfo*/
517 int afs_resourceinit_flag = 0;
518 afs_ResourceInit(preallocs)
521 register afs_int32 i;
522 static struct rx_securityClass *secobj;
524 AFS_STATCNT(afs_ResourceInit);
525 RWLOCK_INIT(&afs_xuser, "afs_xuser");
526 RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
527 RWLOCK_INIT(&afs_xcell, "afs_xcell");
528 RWLOCK_INIT(&afs_xserver, "afs_xserver");
529 RWLOCK_INIT(&afs_xinterface, "afs_xinterface");
530 LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock");
531 #ifndef AFS_AIX32_ENV
532 LOCK_INIT(&osi_fsplock, "osi_fsplock");
534 LOCK_INIT(&osi_flplock, "osi_flplock");
535 RWLOCK_INIT(&afs_xconn, "afs_xconn");
537 afs_InitCBQueue(1); /* initialize callback queues */
539 if (afs_resourceinit_flag == 0) {
540 afs_resourceinit_flag = 1;
541 for (i=0;i<NFENTRIES;i++)
543 for(i=0;i<MAXNUMSYSNAMES;i++)
544 afs_sysnamelist[i] = afs_osi_Alloc(MAXSYSNAME);
545 afs_sysname = afs_sysnamelist[0];
546 strcpy(afs_sysname, SYS_NAME);
547 afs_sysnamecount = 1;
549 #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)
550 { extern afs_int32 afs_preallocs;
552 if ((preallocs > 256) && (preallocs < 3600))
553 afs_preallocs = preallocs;
554 osi_AllocMoreSSpace(afs_preallocs);
555 osi_AllocMoreMSpace(100);
560 secobj = rxnull_NewServerSecurityObject();
562 rx_NewService(0, 1, "afs", &secobj, 1, RXAFSCB_ExecuteRequest);
564 rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", &secobj, 1,
565 RXSTATS_ExecuteRequest);
567 afs_osi_Wakeup(&afs_server); /* wakeup anyone waiting for it */
570 } /*afs_ResourceInit*/
572 #if defined(AFS_AIX_ENV)
575 * AIX dynamic sizeof(struct proc)
577 * AIX keeps its proc structures in an array. The size of struct proc
578 * varies from release to release of the OS. In order to maintain
579 * binary compatibility with releases later than what we build on, we
580 * need to determine the size of struct proc at run time.
582 * We need this in order to walk the proc[] array to do PAG garbage
585 * We also need this in order to support 'klog -setpag', since the
586 * kernel code needs to locate the proc structure for the parent process
587 * of the current process.
589 * To compute sizeof(struct proc), we need the addresses of two proc
590 * structures and their corresponding pids. Given the pids, we can use
591 * the PROCMASK() macro to compute their corresponding indices in the
592 * proc[] array. By dividing the distance between the pointers by the
593 * number of proc structures, we can compute the size of a single proc
596 * We know the base address of the proc table from v.vb_proc:
598 * <sys/sysconfig.h> declares sysconfig() and SYS_GETPARMS;
599 * (we don't use this, but I note it here for completeness)
601 * <sys/var.h> declares struct var and external variable v;
605 * v.ve_proc &proc[x] (current highwater mark for
606 * proc[] array usage)
608 * The first proc pointer is v.vb_proc, which is the proc structure for
609 * process 0. Process 0's pointer to its first child is the other proc
610 * pointer. If process 0 has no children, we simply give up and do not
611 * support features that require knowing the size of struct proc.
615 afs_procsize_init(void)
617 struct proc *p0; /* pointer to process 0 */
618 struct proc *pN; /* pointer to process 0's first child */
623 p0 = (struct proc *)v.vb_proc;
625 afs_gcpags = AFS_GCPAGS_EPROC0;
631 afs_gcpags = AFS_GCPAGS_EPROCN;
635 if (pN->p_pid == p0->p_pid) {
636 afs_gcpags = AFS_GCPAGS_EEQPID;
640 pN_index = PROCMASK(pN->p_pid);
641 pN_offset = ((char *)pN - (char *)p0);
642 procsize = pN_offset / pN_index;
645 * check that the computation was exact
648 if (pN_index * procsize != pN_offset) {
649 afs_gcpags = AFS_GCPAGS_EINEXACT;
654 * check that the proc table size is a multiple of procsize.
657 if ((((char *)v.ve_proc - (char *)v.vb_proc) % procsize) != 0) {
658 afs_gcpags = AFS_GCPAGS_EPROCEND;
664 afs_gcpags_procsize = procsize;
673 * Clean up and shut down the AFS cache.
679 * Nothing interesting.
685 register struct afs_cbr *tsp, *nsp;
686 extern int afs_cold_shutdown;
687 extern int pagCounter;
690 AFS_STATCNT(shutdown_cache);
691 afs_WriteThroughDSlots();
692 if (afs_cold_shutdown) {
693 afs_cacheinit_flag = 0;
698 afs_cacheFiles = afs_cacheBlocks = 0;
699 pag_epoch = maxIHint = nihints = usedihint = 0;
701 cacheInode = volumeInode = (ino_t)0;
704 cacheInfoModTime = 0;
706 afs_fsfragsize = 1023;
707 memset((char *)&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf));
708 memset((char *)&cacheDev, 0, sizeof(struct osi_dev));
714 void shutdown_vnodeops()
716 extern int afs_cold_shutdown;
717 #ifndef AFS_LINUX20_ENV
718 extern int afs_rd_stash_i;
721 extern int lastWarnTime;
723 #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
724 struct buf *afs_bread_freebp = 0;
728 AFS_STATCNT(shutdown_vnodeops);
729 if (afs_cold_shutdown) {
730 #ifndef AFS_SUN5_ENV /* XXX */
733 #ifndef AFS_LINUX20_ENV
736 #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
737 afs_bread_freebp = 0;
748 register struct srvAddr *sa;
749 extern int afs_cold_shutdown;
751 AFS_STATCNT(shutdown_AFS);
752 if (afs_cold_shutdown) {
753 afs_resourceinit_flag = 0;
755 * Free Cells table allocations
759 register struct afs_q *cq, *tq;
760 for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
761 tc = QTOC(cq); tq = QNext(cq);
763 afs_osi_Free(tc->cellName, strlen(tc->cellName)+1);
764 afs_osi_Free(tc, sizeof(struct cell));
768 * Free Volumes table allocations
772 for (i = 0; i < NVOLS; i++) {
773 for (tv = afs_volumes[i]; tv; tv = tv->next) {
775 afs_osi_Free(tv->name, strlen(tv->name)+1);
784 * Free FreeVolList allocations
786 afs_osi_Free(Initialafs_freeVolList, afs_memvolumes * sizeof(struct volume));
787 afs_freeVolList = Initialafs_freeVolList = 0;
789 /* XXX HACK fort MEM systems XXX
791 * For -memcache cache managers when we run out of free in memory volumes
792 * we simply malloc more; we won't be able to free those additional volumes.
798 * Free Users table allocation
801 struct unixuser *tu, *ntu;
802 for (i=0; i < NUSERS; i++) {
803 for (tu=afs_users[i]; tu; tu = ntu) {
806 afs_osi_Free(tu->stp, tu->stLen);
808 EXP_RELE(tu->exporter);
809 afs_osi_Free(tu, sizeof(struct unixuser));
816 * Free Servers table allocation
819 struct server *ts, *nts;
820 struct conn *tc, *ntc;
821 register struct afs_cbr *tcbrp, *tbrp;
822 struct afs_cbr **lcbrpp;
824 for (i=0; i < NSERVERS; i++) {
825 for (ts = afs_servers[i]; ts; ts = nts) {
827 for (sa = ts->addr; sa; sa = sa->next_sa) {
830 * Free all server's connection structs
836 rx_DestroyConnection(tc->id);
838 afs_osi_Free(tc, sizeof(struct conn));
843 for (tcbrp = ts->cbrs; tcbrp; tcbrp = tbrp) {
845 * Free all server's callback structs
850 afs_osi_Free(ts, sizeof(struct server));
855 for (i=0; i<NFENTRIES; i++)
857 /* Reinitialize local globals to defaults */
858 for(i=0; i<MAXNUMSYSNAMES; i++)
859 afs_osi_Free(afs_sysnamelist[i], MAXSYSNAME);
861 afs_sysnamecount = 0;
864 afs_setTimeHost = (struct server *)0;
866 afs_waitForever = afs_waitForeverCount = 0;
868 afs_nextCellNum = 0x100;
870 afs_server = (struct rx_service *)0;
871 RWLOCK_INIT(&afs_xconn, "afs_xconn");
872 memset((char *)&afs_rootFid, 0, sizeof(struct VenusFid));
873 RWLOCK_INIT(&afs_xuser, "afs_xuser");
874 RWLOCK_INIT(&afs_xvolume, "afs_xvolume");
875 RWLOCK_INIT(&afs_xcell, "afs_xcell");
876 RWLOCK_INIT(&afs_xserver, "afs_xserver");
877 LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock");