From: Sam Hartman Date: Fri, 19 Jan 2001 20:57:19 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r139, X-Git-Tag: debian/1.0.2-1~22 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=dfc4b1cde21427fd1ebad597070567781ad66d65;p=packages%2Fo%2Fopenafs.git This commit was generated by cvs2svn to compensate for changes in r139, which included commits to RCS files with non-trunk default branches. --- diff --git a/src/WINNT/afsapplib/al_wizard.h b/src/WINNT/afsapplib/al_wizard.h index 51ef7c5c3..615b027a6 100644 --- a/src/WINNT/afsapplib/al_wizard.h +++ b/src/WINNT/afsapplib/al_wizard.h @@ -10,6 +10,8 @@ #ifndef AL_WIZARD_H #define AL_WIZARD_H +#include +#include #include #include diff --git a/src/WINNT/afsclass/afsclassfn.cpp b/src/WINNT/afsclass/afsclassfn.cpp index 6d3569199..736c922f3 100644 --- a/src/WINNT/afsclass/afsclassfn.cpp +++ b/src/WINNT/afsclass/afsclassfn.cpp @@ -1952,7 +1952,7 @@ BOOL AfsClass_RenameFileset (LPIDENT lpiFileset, LPTSTR pszNewName, ULONG *pStat #define iswhite(_ch) ((_ch)==TEXT(' ') || (_ch)==TEXT('\t')) -LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, SERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus) +LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, AFSSERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus) { BOOL rc = TRUE; ULONG status; diff --git a/src/WINNT/afsclass/afsclassfn.h b/src/WINNT/afsclass/afsclassfn.h index fc0743d22..8cf44ddaf 100644 --- a/src/WINNT/afsclass/afsclassfn.h +++ b/src/WINNT/afsclass/afsclassfn.h @@ -137,7 +137,7 @@ BOOL AfsClass_GetRandomKey (LPIDENT lpi, LPENCRYPTIONKEY pKey, ULONG * */ -LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, SERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus = NULL); +LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, AFSSERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus = NULL); BOOL AfsClass_DeleteService (LPIDENT lpiService, ULONG *pStatus = NULL); BOOL AfsClass_StartService (LPIDENT lpiStart, BOOL fTemporary, ULONG *pStatus = NULL); diff --git a/src/WINNT/afsclass/worker.h b/src/WINNT/afsclass/worker.h index 4dab13726..ac61cc582 100644 --- a/src/WINNT/afsclass/worker.h +++ b/src/WINNT/afsclass/worker.h @@ -470,7 +470,7 @@ typedef union // WORKERPACKET struct { PVOID hServer; // [in] token from BosServerOpen() LPTSTR pszService; // [in] name of new service - SERVICETYPE type; // [in] service type (stCRON, stFS, etc) + AFSSERVICETYPE type; // [in] service type (stCRON, stFS, etc) LPTSTR pszCommand; // [in] full command-line to execute LPTSTR pszTimeCron; // [in] date/time (CRON only) LPTSTR pszNotifier; // [in] command executed on exit diff --git a/src/WINNT/afssvrmgr/svc_create.h b/src/WINNT/afssvrmgr/svc_create.h index 2eb27fd43..0446b4ce8 100644 --- a/src/WINNT/afssvrmgr/svc_create.h +++ b/src/WINNT/afssvrmgr/svc_create.h @@ -24,7 +24,7 @@ typedef struct TCHAR szParams[ cchNAME ]; TCHAR szNotifier[ cchNAME ]; TCHAR szLogFile[ cchNAME ]; - SERVICETYPE type; + AFSSERVICETYPE type; BOOL fRunNow; SYSTEMTIME stIfCron; } SVC_CREATE_PARAMS, *LPSVC_CREATE_PARAMS; diff --git a/src/WINNT/eventlog/lang/de_DE/event.mc b/src/WINNT/eventlog/lang/de_DE/event.mc index a9df878e0..86bc23765 100644 --- a/src/WINNT/eventlog/lang/de_DE/event.mc +++ b/src/WINNT/eventlog/lang/de_DE/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/en_US/event.mc b/src/WINNT/eventlog/lang/en_US/event.mc index 0349e6a06..33e3e3b6d 100644 --- a/src/WINNT/eventlog/lang/en_US/event.mc +++ b/src/WINNT/eventlog/lang/en_US/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/es_ES/event.mc b/src/WINNT/eventlog/lang/es_ES/event.mc index 95b26a0f9..fe46e4d14 100644 --- a/src/WINNT/eventlog/lang/es_ES/event.mc +++ b/src/WINNT/eventlog/lang/es_ES/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/ja_JP/event.mc b/src/WINNT/eventlog/lang/ja_JP/event.mc index 4ca040e2c..17659b37d 100644 --- a/src/WINNT/eventlog/lang/ja_JP/event.mc +++ b/src/WINNT/eventlog/lang/ja_JP/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/ko_KR/event.mc b/src/WINNT/eventlog/lang/ko_KR/event.mc index 9061c9f5d..23dcd6f7b 100644 --- a/src/WINNT/eventlog/lang/ko_KR/event.mc +++ b/src/WINNT/eventlog/lang/ko_KR/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/pt_BR/event.mc b/src/WINNT/eventlog/lang/pt_BR/event.mc index dd7f10d4c..50747577b 100644 --- a/src/WINNT/eventlog/lang/pt_BR/event.mc +++ b/src/WINNT/eventlog/lang/pt_BR/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/zh_CN/event.mc b/src/WINNT/eventlog/lang/zh_CN/event.mc index e1d2979c9..575da8fec 100644 --- a/src/WINNT/eventlog/lang/zh_CN/event.mc +++ b/src/WINNT/eventlog/lang/zh_CN/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/WINNT/eventlog/lang/zh_TW/event.mc b/src/WINNT/eventlog/lang/zh_TW/event.mc index 4a145a485..08f59035f 100644 --- a/src/WINNT/eventlog/lang/zh_TW/event.mc +++ b/src/WINNT/eventlog/lang/zh_TW/event.mc @@ -1,10 +1,9 @@ -; 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 - +;/* 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 ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c index 404639a90..f076d7e0b 100644 --- a/src/afs/LINUX/osi_alloc.c +++ b/src/afs/LINUX/osi_alloc.c @@ -199,14 +199,15 @@ static int linux_alloc_init() { /* initiate our pool of osi_linux_mem structs */ al_mem_pool = afs_atomlist_create(sizeof(struct osi_linux_mem), - sizeof(long)*1024, vmalloc, local_free); + sizeof(long)*1024, (void *)vmalloc, + local_free); if (!al_mem_pool) { printf("afs_osi_Alloc: Error in initialization(atomlist_create)\n"); return 0; } /* initialize the hash table to hold references to alloc'ed chunks */ - lh_mem_htab = afs_lhash_create(hash_equal, vmalloc, local_free); + lh_mem_htab = afs_lhash_create(hash_equal, (void *)vmalloc, local_free); if (!lh_mem_htab) { printf("afs_osi_Alloc: Error in initialization(lhash_create)\n"); return 0; diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index b20538fe6..d89069381 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -129,19 +129,19 @@ asmlinkage int afs_xsetgroups(int gidsetsize, gid_t *grouplist) #ifdef AFS_SPARC64_LINUX20_ENV asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist) { - gid_t gl[NGROUPS]; - int ret, i; - mm_segment_t old_fs = get_fs (); - - if ((unsigned) gidsetsize > NGROUPS) - return -EINVAL; - for (i = 0; i < gidsetsize; i++, grouplist++) - if (__get_user (gl[i], grouplist)) - return -EFAULT; - set_fs (KERNEL_DS); - ret = afs_xsetgroups(gidsetsize, gl); - set_fs (old_fs); - return ret; + gid_t gl[NGROUPS]; + int ret, i; + mm_segment_t old_fs = get_fs (); + + if ((unsigned) gidsetsize > NGROUPS) + return -EINVAL; + for (i = 0; i < gidsetsize; i++, grouplist++) + if (__get_user (gl[i], grouplist)) + return -EFAULT; + set_fs (KERNEL_DS); + ret = afs_xsetgroups(gidsetsize, gl); + set_fs (old_fs); + return ret; } #endif diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index 17f113996..9acd27a8c 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -17,6 +17,7 @@ #if defined(AFS_GLOBAL_SUNLOCK) static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); #endif + void afs_osi_Wakeup(char *event); void afs_osi_Sleep(char *event); diff --git a/src/afs/LINUX/osi_vfs.h b/src/afs/LINUX/osi_vfs.h index 74f7515b7..77b7bcff9 100644 --- a/src/afs/LINUX/osi_vfs.h +++ b/src/afs/LINUX/osi_vfs.h @@ -25,7 +25,9 @@ typedef struct vnode { struct list_head i_hash; struct list_head i_list; struct list_head i_dentry; - +#if defined(AFS_LINUX24_ENV) + struct list_head i_dirty_buffers; +#endif unsigned long i_ino; unsigned int i_count; kdev_t i_dev; @@ -76,6 +78,8 @@ typedef struct vnode { #if defined(AFS_LINUX24_ENV) struct pipe_inode_info *i_pipe; struct block_device *i_bdev; + unsigned long i_dnotify_mask; + struct dnotify_struct *i_dnotify; #endif unsigned long i_state; diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 3e9faa1e1..d1939581a 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -210,7 +210,11 @@ static LIST_HEAD(dummy_inode_list); * pages to disk. So it needs an inode syncing function to update metadata when it * has synced some pages of a file to disk. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) +void afs_write_inode(struct inode *ip, int unused) +#else void afs_write_inode(struct inode *ip) +#endif { /* and put it back on our dummy list. */ list_del(&ip->i_list); diff --git a/src/afs/SOLARIS/osi_inode.c b/src/afs/SOLARIS/osi_inode.c index 306b282fa..42bdc89dc 100644 --- a/src/afs/SOLARIS/osi_inode.c +++ b/src/afs/SOLARIS/osi_inode.c @@ -42,6 +42,8 @@ getinode(vfsp, dev, inode, ipp, credp,perror) if (!vfsp #if !defined(AFS_SUN58_ENV) && !(vfsp = vfs_devsearch(dev)) +#else + && !(vfsp = vfs_dev2vfsp(dev)) #endif ) { return (ENODEV); diff --git a/src/afs/SOLARIS/osi_prototypes.h b/src/afs/SOLARIS/osi_prototypes.h index edfadb2a2..6219269c0 100644 --- a/src/afs/SOLARIS/osi_prototypes.h +++ b/src/afs/SOLARIS/osi_prototypes.h @@ -17,7 +17,12 @@ int afs_putapage(struct vnode *vp, struct page *pages, #else u_int *offp, #endif - u_int *lenp, int flags, struct AFS_UCRED *credp); +#if defined(AFS_SUN58_ENV) + size_t *lenp, +#else + u_int *lenp, +#endif + int flags, struct AFS_UCRED *credp); diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 8c8c43a2b..e55d2694c 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -379,7 +379,11 @@ retry: * As of 4/98, that shouldn't be possible, but we'll be defensive here * in case someone tries to relax all the serialization of read and write * operations with harmless things like stat. */ +#if defined(AFS_SUN58_ENV) + page = page_create_va(vp, toffset, PAGESIZE, PG_WAIT|PG_EXCL, seg, addr); +#else page = page_create_va(vp, toffset, PAGESIZE, PG_WAIT|PG_EXCL, seg->s_as, addr); +#endif #else page = page_create(vp, toffset, PAGESIZE, PG_WAIT); #endif @@ -537,7 +541,12 @@ int afs_putpage(vp, off, len, flags, cred) struct vcache *avc; struct page *pages; afs_int32 code = 0; - afs_int32 tlen, endPos, NPages=0; +#if defined(AFS_SUN58_ENV) + size_t tlen; +#else + afs_int32 tlen; +#endif + afs_int32 endPos, NPages=0; #if defined(AFS_SUN56_ENV) u_offset_t toff = off; #else @@ -615,7 +624,12 @@ int afs_putapage(struct vnode *vp, struct page *pages, #else u_int *offp, #endif - u_int *lenp, int flags, struct AFS_UCRED *credp) +#if defined(AFS_SUN58_ENV) + size_t *lenp, +#else + u_int *lenp, +#endif + int flags, struct AFS_UCRED *credp) { struct buf *tbuf; struct vcache *avc = (struct vcache *)vp; diff --git a/src/afs/UKERNEL/osi_vfsops.c b/src/afs/UKERNEL/osi_vfsops.c index c32c4940b..e146b2c8e 100644 --- a/src/afs/UKERNEL/osi_vfsops.c +++ b/src/afs/UKERNEL/osi_vfsops.c @@ -49,7 +49,7 @@ afs_mount(afsp, path, data) afs_globalVFS = afsp; afsp->vfs_bsize = 8192; afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid.val[1] = AFS_VFSFSID; + afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID; return 0; } @@ -113,7 +113,7 @@ afs_statfs(afsp, abp) abp->f_type = 0; abp->f_bsize = afsp->vfs_bsize; abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - abp->f_fsid.val[1] = AFS_VFSFSID; + abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID; return 0; } diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index 0ae402a88..34675191d 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -188,6 +188,13 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred) afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, avc->m.Length); +#if defined(AFS_SUN5_ENV) + if (flags & ATTR_HINT) { + code = afs_CopyOutAttrs(avc, attrs); + return code; + } +#endif + #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&avc->pvnLock, avc); #endif diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c index 16bc447e7..0e984f0c7 100644 --- a/src/afs/afs_conn.c +++ b/src/afs/afs_conn.c @@ -220,15 +220,15 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, if (cryptall) { level=rxkad_crypt; - isec=3; - } - else { + } else { level=rxkad_clear; - isec=2; } - /* kerberos tickets on channel 2 */ - csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey, - /* kvno */ tu->ct.AuthHandle, tu->stLen, tu->stp); + isec=2; + /* kerberos tickets on channel 2 */ + csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey, + /* kvno */ + tu->ct.AuthHandle, + tu->stLen, tu->stp); } if (isec == 0) csec = rxnull_NewClientSecurityObject(); diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index e2ddf743b..84a3b35ba 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -702,7 +702,7 @@ NB: Has to be unsigned, since shifts on signed quantities may preserve clients. This is probably OK, but I don't want to see too much of it. */ -#define ranstage(x) (x)= (afs_uint32) (3141592621*((afs_uint32)x)+1) +#define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1) extern afs_int32 rxi_getaddr(); unsigned int afs_random() diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 385374ce2..699f5919b 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -923,7 +923,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, sema_init(&ip->i_zombie, 1); init_waitqueue_head(&ip->i_wait); spin_lock_init(&ip->i_data.i_shared_lock); - INIT_LIST_HEAD(&ip->i_data.pages); + INIT_LIST_HEAD(&ip->i_data.clean_pages); + INIT_LIST_HEAD(&ip->i_data.dirty_pages); + INIT_LIST_HEAD(&ip->i_data.locked_pages); + INIT_LIST_HEAD(&ip->i_dirty_buffers); ip->i_data.host = (void*) ip; ip->i_mapping = &ip->i_data; #else diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index c3356b516..c05cd5356 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -40,6 +40,9 @@ static ParseHostLine(); static ParseCellLine(); +static afsconf_OpenInternal(); +static afsconf_CloseInternal(); +static afsconf_Reopen(); static struct afsconf_servPair serviceTable [] = { "afs", 7000, @@ -195,7 +198,7 @@ register struct afsconf_dir *adir; { #ifdef AFS_NT40_ENV return _utime(tbuffer, NULL); #else - gettimeofday(&tvp[0], (char *) 0); + gettimeofday(&tvp[0], NULL); tvp[1] = tvp[0]; return utimes(tbuffer, tvp); #endif /* AFS_NT40_ENV */ diff --git a/src/comerr/et_lex.lex_nt.c b/src/comerr/et_lex.lex_nt.c index a765768f7..dc53cac59 100644 --- a/src/comerr/et_lex.lex_nt.c +++ b/src/comerr/et_lex.lex_nt.c @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1 2000/11/04 04:23:01 hartmans Exp $ + * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1.1.2 2001/01/19 20:54:19 hartmans Exp $ */ #define FLEX_SCANNER diff --git a/src/config/Makefile.sgi_65 b/src/config/Makefile.sgi_65 index b60412dfa..07d163f14 100644 --- a/src/config/Makefile.sgi_65 +++ b/src/config/Makefile.sgi_65 @@ -33,9 +33,9 @@ SHLIB_CFLAGS= AR=ar AS=as CP=cp -MT_CC=cc +MT_CC=/usr/bin/cc INSTALL=${SRCDIR}bin/install -LD=ld +LD=/usr/bin/ld LEX=lex MV=mv RANLIB=/bin/true diff --git a/src/config/Makefile.sun4x_56 b/src/config/Makefile.sun4x_56 index 3b2d006cb..f048a0efd 100644 --- a/src/config/Makefile.sun4x_56 +++ b/src/config/Makefile.sun4x_56 @@ -22,7 +22,7 @@ DBG=-g # # libraries XLIBS=-lsocket -lnsl -lintl -ldl -TXLIBS=-lcurses +TXLIBS=-L/usr/ccs/lib -lcurses MTLIBS=-lpthread -lsocket XLIBELFA=-lelf XLIBKVM=-lkvm diff --git a/src/config/Makefile.version-NOCML b/src/config/Makefile.version-NOCML index fbd16647f..9edc0ddf0 100644 --- a/src/config/Makefile.version-NOCML +++ b/src/config/Makefile.version-NOCML @@ -8,8 +8,8 @@ AFS_component_version_number.o: AFS_component_version_number.c AFS_component_version_number.c: - echo 'char cml_version_number[]="@(#)CML not accessible: No version Information";' >AFS_component_version_number.c; - echo 'char* AFSVersion = "afs??"; ' >>AFS_component_version_number.c; + echo 'char cml_version_number[]="@(#) OpenAFS devel built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c; + echo 'char* AFSVersion = "openafs devel"; ' >>AFS_component_version_number.c; noversion: install diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 32504e411..7f5ed76f9 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -120,6 +120,10 @@ #define SYS_NAME_ID_sparc64_linux2 1800 #define SYS_NAME_ID_sparc64_linux22 1801 +#define SYS_NAME_ID_s390_linux2 1900 +#define SYS_NAME_ID_s390_linux22 1901 +#define SYS_NAME_ID_s390_linux24 1902 + /* * Placeholder to keep system-wide standard flags since this file is included by all diff --git a/src/config/venus.h b/src/config/venus.h index b95cb3836..1b019a157 100644 --- a/src/config/venus.h +++ b/src/config/venus.h @@ -174,5 +174,7 @@ struct cm_initparams { #define VIOC_AFS_FLUSHMOUNT _VICEIOCTL(52) /* Flush mount symlink data */ #define VIOC_RXSTAT_PROC _VICEIOCTL(53) /* Control process RX stats */ #define VIOC_RXSTAT_PEER _VICEIOCTL(54) /* Control peer RX stats */ +#define VIOC_GETRXKCRYPT _VICEIOCTL(55) /* Set rxkad enc flag */ +#define VIOC_SETRXKCRYPT _VICEIOCTL(56) /* Set rxkad enc flag */ #endif /* AFS_VENUS_H */ diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h index 554b41423..99ec3cde2 100644 --- a/src/des/andrew-conf.h +++ b/src/des/andrew-conf.h @@ -50,7 +50,11 @@ #ifdef AFS_SPARC64_LINUX20_ENV #include "conf-sparc64-linux.h" #else +#ifdef AFS_S390_LINUX20_ENV +#include "conf-s390-linux.h" +#else #include "conf-i386-linux.h" +#endif /* AFS_S390_LINUX20_ENV */ #endif /* AFS_SPARC64_LINUX20_ENV */ #endif /* AFS_SPARC_LINUX20_ENV */ #endif diff --git a/src/ftpd43+/ftpd.c b/src/ftpd43+/ftpd.c index a67c2729a..24e752c5a 100644 --- a/src/ftpd43+/ftpd.c +++ b/src/ftpd43+/ftpd.c @@ -61,6 +61,7 @@ static char sccsid[] = "@(#)ftpd.c 5.27.1.1 (Berkeley) 3/2/89"; #include #include #include +#include #include #if defined(AIX) #include diff --git a/src/ftpd43+/getusershell.c b/src/ftpd43+/getusershell.c index 0f6f75616..6409dbf9d 100644 --- a/src/ftpd43+/getusershell.c +++ b/src/ftpd43+/getusershell.c @@ -35,7 +35,7 @@ static char *okshells[] = static char **shells, *strings; static char **curshell = NULL; -extern char **initshells(); +static char **initshells(); /* * Get a list of shells from SHELLS, if it exists. @@ -65,12 +65,6 @@ endusershell() curshell = NULL; } -setusershell() -{ - - curshell = initshells(); -} - static char ** initshells() { @@ -118,3 +112,15 @@ initshells() (void)fclose(fp); return (shells); } + +setusershell() +{ + + curshell = initshells(); +} + + + + + + diff --git a/src/ftpd43+/glob.c b/src/ftpd43+/glob.c index fa79f1c04..9367a7c19 100644 --- a/src/ftpd43+/glob.c +++ b/src/ftpd43+/glob.c @@ -93,6 +93,8 @@ char **copyblk(register char **); static char *strend(register char *); int gethdir(char *); +static addpath(); +static rscan(); #ifdef notdef static addpath(char); diff --git a/src/inetd/inetd.c b/src/inetd/inetd.c index df6420cad..abe25fe83 100644 --- a/src/inetd/inetd.c +++ b/src/inetd/inetd.c @@ -1029,7 +1029,7 @@ machtime() fprintf(stderr, "Unable to get time of day\n"); return (0L); } - return (htonl((afs_int32)tv.tv_sec + 2208988800)); + return (htonl((afs_int32)tv.tv_sec + 2208988800U)); } /* ARGSUSED */ diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index 7e62c1243..46c6300f1 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -169,7 +169,7 @@ int DumpUser ( if ((!ka_KeyIsZero((char *) &tentry.key, sizeof(tentry.key))) && (showkey)) { printf (" key (%d):", tentry.key_version); - ka_PrintBytes (&tentry.key, sizeof(tentry.key)); + ka_PrintBytes ((char *)&tentry.key, sizeof(tentry.key)); } else { if (tentry.keyCheckSum == 0) @@ -704,7 +704,7 @@ int StringToKey ( printf ("Converting %s in realm '%s' yields key='", as->parms[0].items->data, realm); - ka_PrintBytes (&key, sizeof(key)); + ka_PrintBytes ((char *)&key, sizeof(key)); printf ("'.\n"); return 0; @@ -745,9 +745,10 @@ int SetPassword ( ka_StringToKey (as->parms[1].items->data, realm, &key); } else if (as->parms[2].items) { - if (ka_ReadBytes (as->parms[2].items->data, &key, sizeof(key)) != 8) { + if (ka_ReadBytes (as->parms[2].items->data, (char *)&key, sizeof(key)) + != 8) { printf ("Key must be 8 bytes: '%s' was too long\n", - as->parms[2].items->data); + as->parms[2].items->data); return KABADCMD; } } @@ -890,10 +891,10 @@ static afs_int32 ListTicket ( } if (verbose) { printf ("SessionKey: "); - ka_PrintBytes (&token.sessionKey, sizeof(token.sessionKey)); + ka_PrintBytes ((char *)&token.sessionKey, sizeof(token.sessionKey)); printf ("\nTicket (kvno = %d, len = %d): ", token.kvno, token.ticketLen); - ka_PrintBytes (token.ticket, token.ticketLen); + ka_PrintBytes ((char *)token.ticket, token.ticketLen); printf ("\n"); } return 0; @@ -982,7 +983,7 @@ static GetPassword ( ubik_ClientDestroy(lpbkConn); if (code) goto abort; printf ("Key: "); - ka_PrintBytes (&key, sizeof(key)); + ka_PrintBytes ((char *)&key, sizeof(key)); printf ("\n"); return code; } @@ -999,7 +1000,7 @@ int GetRandomKey ( else { int i; printf ("Key: "); - ka_PrintBytes (&key, sizeof(key)); + ka_PrintBytes ((char *)&key, sizeof(key)); printf (" ("); for (i=0; iname,"help")) return; @@ -1187,7 +1188,7 @@ void MyAfterProc( conn = 0; } - return; + return 0; } int init = 0, noauth; diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index 40aaf86a8..562fba91b 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -142,7 +142,8 @@ static afs_int32 get_time (timeP, tt, admin) &key, 0, 0); if (code == 0) { des_init_random_number_generator (&key); - ka_ConvertBytes (buf, sizeof(buf), &key, sizeof(key)); + ka_ConvertBytes (buf, sizeof(buf), (char *)&key, + sizeof(key)); es_Report ("New Admin key is %s\n", buf); } else { es_Report ("in get_time: set_password failed because: %d\n", code); @@ -159,7 +160,8 @@ static afs_int32 get_time (timeP, tt, admin) des_fixup_key_parity (&key); code = set_password (tt, KA_TGS_NAME, lrealm, &key, 0, 0); if (code == 0) { - ka_ConvertBytes (buf, sizeof(buf), &key, sizeof(key)); + ka_ConvertBytes (buf, sizeof(buf), (char *)&key, + sizeof(key)); es_Report ("New TGS key is %s\n", buf); } else { es_Report ("in get_time: set_password failed because: %s\n", error_message (code)); @@ -720,7 +722,7 @@ impose_reuse_limits ( password, tentry ) if (!bcmp(password, &(tentry->key), sizeof(EncryptionKey))) return KAREUSED; - code = ka_KeyCheckSum (password, &newsum); + code = ka_KeyCheckSum ((char *)password, &newsum); if (code) return code; @@ -759,7 +761,7 @@ set_password (tt, name, instance, password, kvno, caller) /* do nothing, no limits */ ; } else { - code = ka_KeyCheckSum (&(tentry.key), &newsum); + code = ka_KeyCheckSum ((char *)&(tentry.key), &newsum); if (code) return code; for (i=npwSums-1; i ; i--) @@ -1551,7 +1553,7 @@ afs_int32 kamGetEntry (call, aname, ainstance, aversion, aentry) (callerIsAdmin && enc_level == rxkad_crypt)) bcopy (&tentry.key, &aentry->key, sizeof(struct ktc_encryptionKey)); else bzero (&aentry->key, sizeof(aentry->key)); - code = ka_KeyCheckSum (&tentry.key, &aentry->keyCheckSum); + code = ka_KeyCheckSum ((char *)&tentry.key, &aentry->keyCheckSum); if (!tentry.pwsums[0] && npwSums > 1 && !tentry.pwsums[1]) { aentry->reserved3 = 0x12340000; } else { diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index fc20a1243..0d470a8c3 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -414,7 +414,7 @@ afs_int32 UDP_GetTicket (ksoc, pkt, kvno, authDomain, ticket, ticketLen, auth, a COUNT_REQ (UGetTicket); if (code = InitAuthServ(&tt, LOCKREAD, this_op)) goto fail; - code = ka_LookupKvno (0, KA_TGS_NAME, + code = ka_LookupKvno (tt, KA_TGS_NAME, ((strlen(authDomain) > 0) ? authDomain : lrealm), kvno, &tgskey); if (code) goto abort; @@ -568,7 +568,7 @@ static err_packet (ksoc, pkt, code, reason) } ans.len = 2 + strlen(pkt->name) + strlen(pkt->inst) + strlen(pkt->realm) + - 3/* nulls */ + sizeof(afs_int32) + strlen (buf) + 1; + 3/* nulls */ + (2 * sizeof(afs_int32)) + strlen (buf) + 1; if (ans.len > sizeof(ans.data)) { printf ("Answer packet too long\n"); return; @@ -827,7 +827,13 @@ afs_int32 init_krb_udp () taddr.sin_family = AF_INET; /* added for NCR port */ if ( !sp ) { - /* if kerberos-4 is not available, try "kerberos" */ + /* if kerberos-4 is not available, try "kerberos-iv" */ + krb4name = "kerberos-iv"; + sp = getservbyname(krb4name, "udp"); + } + if ( !sp ) + { + /* if kerberos-iv is not available, try "kerberos" */ krb4name = "kerberos"; sp = getservbyname(krb4name, "udp"); } diff --git a/src/kauth/rebuild.c b/src/kauth/rebuild.c index bf0614632..bc7438324 100644 --- a/src/kauth/rebuild.c +++ b/src/kauth/rebuild.c @@ -176,7 +176,7 @@ PrintEntry(index, entry) printf(" Key Version = %d\n", entry->key_version); printf(" Key = "); - ka_PrintBytes (&entry->key, sizeof(entry->key)); + ka_PrintBytes ((char *)&entry->key, sizeof(entry->key)); printf("\n"); /* What about asServer structs and such and misc_ath_bytes */ @@ -229,7 +229,8 @@ RebuildEntry(entryp) fprintf(out, "create -name %s", EntryName(entryp)); - ka_ConvertBytes (key, sizeof(key), &entryp->key, sizeof(entryp->key)); + ka_ConvertBytes (key, sizeof(key), (char *)&entryp->key, + sizeof(entryp->key)); fprintf(out, " -initial_password foo\n", key); strcpy(flags,""); diff --git a/src/libafs/MakefileProto.SOLARIS b/src/libafs/MakefileProto.SOLARIS index 666f5ef8f..d6592bcac 100644 --- a/src/libafs/MakefileProto.SOLARIS +++ b/src/libafs/MakefileProto.SOLARIS @@ -28,9 +28,10 @@ AFS_OS_NONFSOBJS = \ # System specific build commands and flags DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -LD = /usr/ccs/bin/ld -LORDER = /usr/ccs/bin/lorder -CC = /opt/SUNWspro/bin/cc +#These are redundant +#LD = /usr/ccs/bin/ld +#LORDER = /usr/ccs/bin/lorder +#CC = /opt/SUNWspro/bin/cc KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \ -DSYSV -dn ${ARCH_DEFS} @@ -106,7 +107,7 @@ ${COMPDIRS}: LIBAFS = libafs.o LIBAFSNONFS = libafs.nonfs.o - + DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS} DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS} diff --git a/src/libafsrpc/Makefile b/src/libafsrpc/Makefile index 5186cdbcd..057adaa96 100644 --- a/src/libafsrpc/Makefile +++ b/src/libafsrpc/Makefile @@ -109,9 +109,9 @@ LIBOBJS = \ system install: if [ -f "../des/Makefile" ] ; then \ - make install.lib ; \ + $(MAKE) install.lib ; \ else \ - make libstub ; \ + $(MAKE) libstub ; \ fi install.lib: ${DESTDIR}lib/libafsrpc.a @@ -238,7 +238,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c # # $ what /opt/langtools/bin/pxdb32 # /opt/langtools/bin/pxdb32: -# HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.2 $ +# HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.3 $ # # The problem occurs when -g and -O are both used when compiling des.c. # The simplest way to work around the problem is to leave out either -g or -O. diff --git a/src/libuafs/MakefileProto.SOLARIS b/src/libuafs/MakefileProto.SOLARIS index 9e36a266d..43875f359 100644 --- a/src/libuafs/MakefileProto.SOLARIS +++ b/src/libuafs/MakefileProto.SOLARIS @@ -13,7 +13,8 @@ include $(DESTDIR)../obj/config/Makefile.${SYS_NAME} MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 # System specific build commands and flags -CC = /opt/SUNWspro/bin/cc +# Redundant +# CC = /opt/SUNWspro/bin/cc DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG} OPTF=-O @@ -73,9 +74,9 @@ $(LIBUAFS): $(UAFSOBJ) $(LIBAFSWEB): $(AFSWEBOBJ) ${DES}/libdes.a -rm -f $(LIBAFSWEB) - ld -G -M../mapfile -o $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS) + ${LD} -G -M../mapfile -o $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS) $(LIBAFSWEBKRB): $(AFSWEBOBJKRB) $(DES)/libdes.a -rm -f $(LIBAFSWEBKRB) - ld -G -M../mapfile -o $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS) + ${LD} -G -M../mapfile -o $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS) diff --git a/src/ntp/Makefile b/src/ntp/Makefile index 5e9fb9542..ff773628f 100644 --- a/src/ntp/Makefile +++ b/src/ntp/Makefile @@ -149,7 +149,7 @@ install: AFS_component_version_number.c ntest ntpd ntp ntpdc runntp # make ${MFLAGS} DESTDIR=${DESTDIR} install-link install-man: - cd man; make ${MFLAGS} DESTDIR=${DESTDIR} install + cd man; $(MAKE) ${MFLAGS} DESTDIR=${DESTDIR} install install-link: rm -f ${BINDIR}/${LINKDIR}/ntpd diff --git a/src/ptserver/Makefile b/src/ptserver/Makefile index 3fa42800c..af05c4eab 100644 --- a/src/ptserver/Makefile +++ b/src/ptserver/Makefile @@ -57,7 +57,7 @@ include ../config/Makefile.version clean: $(RM) -f *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \ - libprot.a pts readgroup readpwd db_verify testpt pterror.h pterror.c \ + libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \ core AFS_component_version_number.c ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${auditlib} @@ -108,7 +108,6 @@ libprot.a: ${LIBOBJS} AFS_component_version_number.o $(RM) -f libprot.a $(AR) r libprot.a ${LIBOBJS} AFS_component_version_number.o $(RANLIB) libprot.a - pts: pts.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS) $(CC) ${CFLAGS} -o pts pts.o ${SRCDIR}lib/afs/libcmd.a libprot.a ${LIBS} ${XLIBS} @@ -130,6 +129,10 @@ testpt: testpt.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS) testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c +pt_util: pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS) + $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS) ${XLIBS} + +ubik.o: ubik.c ${INCLS} system: install @@ -143,7 +146,7 @@ ukinstall webinstall: ${UKSRCS} Kptint.h Kptint.cs.c Kptint.xdr.c ${INSTALL} Kptint.xdr.c ${UKERNELDIR}afsint/ptint.xdr.c ${INSTALL} ${UKSRCS} ${UKERNELDIR}afs -all: ptclient libprot.a pts db_verify readgroup readpwd testpt +all: ptclient libprot.a pts db_verify readgroup readpwd testpt pt_util ${DESTDIR}root.server/usr/afs/bin/ptserver: ptserver ${INSTALL} $? $@ @@ -151,11 +154,14 @@ ${DESTDIR}root.server/usr/afs/bin/ptserver: ptserver ${DESTDIR}bin/pts ${DESTDIR}root.server/usr/afs/bin/pts: pts ${INSTALL} $? $@ +${DESTDIR}root.server/usr/afs/bin/pt_util: pt_util + ${INSTALL} $? $@ + ${DESTDIR}lib/afs/libprot.a: libprot.a ${INSTALL} $? $@ -install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root.server/usr/afs/bin/pts ${DESTDIR}bin/pts ${DESTDIR}lib/afs/libprot.a +install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root.server/usr/afs/bin/pts ${DESTDIR}bin/pts ${DESTDIR}lib/afs/libprot.a ${DESTDIR}root.server/usr/afs/bin/pt_util ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index fceb55670..7e98bab6e 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -95,7 +95,7 @@ afs_int32 ReadHeader() } /* Check and see if database exists and is approximately OK. */ if (ntohl(cheader.headerSize) != sizeof(cheader) || - ntohl(cheader.eofPtr) == NULL) { + ntohl(cheader.eofPtr) == 0) { if (code) return code; com_err (whoami, PRDBBAD, "header is bad"); return PRDBBAD; diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index 9e98967e5..4e06c6601 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -45,6 +45,7 @@ afs_int32 listEntries(), changeEntry(), setFieldsEntry(), put_prentries(); afs_int32 listElements(), listOwned(), isAMemberOf(), idToName(); static stolower(); +extern int IDCmp(); /* When abort, reset initd so that the header is read in on next call. * Abort the transarction and return the code. @@ -593,7 +594,7 @@ afs_int32 Delete (call, aid) /* Delete each continuation block as a separate transaction so that no one * transaction become to large to complete. */ nptr = tentry.next; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { struct contentry centry; int i; @@ -636,7 +637,7 @@ afs_int32 Delete (call, aid) * transaction, we start a new transaction every 50 entries. */ count = 0; nptr = tentry.owned; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { struct prentry nentry; code = pr_ReadEntry (tt, 0, nptr, &nentry); @@ -1650,7 +1651,6 @@ afs_int32 addWildCards(tt,alist,host) afs_int32 hostid; int size = 0, i, code; int added = 0; - extern afs_int32 IDCmp(); while (host = (host & wild)) { wild = htonl ( ntohl(wild) << 8) ; diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 52a00bc1e..23b988408 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -78,13 +78,15 @@ int GetGlobals (as) return code; } -void CleanUp (as) +int CleanUp (as) register struct cmd_syndesc *as; { if (!strcmp(as->name,"help")) return; /* Need to shutdown the ubik_client & other connections */ pr_End(); rx_Finalize(); + + return 0; } CreateGroup (as) diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index 8f4e9546e..bcaef4bb9 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -32,6 +32,7 @@ extern struct ubik_dbase *dbase; extern struct afsconf_dir *prdir; extern int pr_noAuth; +extern int IDCmp(); extern afs_int32 AddToEntry(); static char *whoami = "ptserver"; @@ -444,7 +445,7 @@ afs_int32 RemoveFromEntry (at, aid, bid) } hloc = 0; nptr = tentry.next; - while (nptr != NULL) { + while (nptr != 0) { code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return code; if ((centry.id != bid) || !(centry.flags & PRCONT)) return PRDBBAD; @@ -526,7 +527,7 @@ afs_int32 DeleteEntry (at, tentry, loc) if (code) return code; } nptr = tentry->next; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return PRDBFAIL; for (i=0;inext; - while (nptr != NULL) { + while (nptr != (afs_int32)NULL) { code = pr_ReadCoEntry(tt,0,nptr,&nentry); if (code != 0) return code; last = nptr; @@ -693,7 +694,7 @@ afs_int32 AddToEntry (tt, entry, loc, aid) bzero(&aentry,sizeof(aentry)); aentry.flags |= PRCONT; aentry.id = entry->id; - aentry.next = NULL; + aentry.next = 0; aentry.entries[0] = aid; code = pr_WriteCoEntry(tt,0,nptr,&aentry); if (code != 0) return code; @@ -739,7 +740,6 @@ afs_int32 GetList (at, tentry, alist, add) afs_int32 nptr; int size; int count = 0; - extern afs_int32 IDCmp(); size = 0; alist->prlist_val = 0; @@ -752,7 +752,7 @@ afs_int32 GetList (at, tentry, alist, add) if (code) return code; } - for (nptr = tentry->next; nptr != NULL; nptr = centry.next) { + for (nptr = tentry->next; nptr != 0; nptr = centry.next) { /* look through cont entries */ code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return code; @@ -795,7 +795,6 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add) afs_int32 nptr; afs_int32 size; int count = 0; - extern afs_int32 IDCmp(); size = 0; alist->prlist_val = 0; @@ -808,7 +807,7 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add) } nptr = tentry->next; - while (nptr != NULL) { + while (nptr != (afs_uint32)NULL) { /* look through cont entries */ code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) return code; @@ -831,7 +830,7 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add) if (!code) { nptr = tentry2->next; - while (nptr != NULL) { + while (nptr != (afs_uint32)NULL) { /* look through cont entries */ code = pr_ReadCoEntry(at,0,nptr,¢ry); if (code != 0) break; @@ -869,7 +868,6 @@ afs_int32 GetOwnedChain (ut, next, alist) struct prentry tentry; int size; int count = 0; - extern afs_int32 IDCmp(); size = 0; alist->prlist_val = 0; @@ -970,7 +968,7 @@ afs_int32 Initdb() } if ((ntohl(cheader.version) == PRDBVERSION) && ntohl(cheader.headerSize) == sizeof(cheader) && - ntohl(cheader.eofPtr) != NULL && + ntohl(cheader.eofPtr) != (afs_uint32)NULL && FindByID(tt,ANONYMOUSID) != 0){ /* database exists, so we don't have to build it */ code = ubik_EndTrans(tt); @@ -1016,7 +1014,7 @@ afs_int32 Initdb() */ if ((ntohl(cheader.version) == PRDBVERSION) && ntohl(cheader.headerSize) == sizeof(cheader) && - ntohl(cheader.eofPtr) != NULL && + ntohl(cheader.eofPtr) != (afs_uint32)NULL && FindByID(tt,ANONYMOUSID) != 0){ /* database exists, so we don't have to build it */ code = ubik_EndTrans(tt); diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c index 3d0936835..8b81ad439 100644 --- a/src/ptserver/testpt.c +++ b/src/ptserver/testpt.c @@ -837,7 +837,7 @@ static char tmp_conf_file[128] = ""; static char tmp_cell_file[128] = ""; static char tmp_noauth_file[128] = ""; -static afs_int32 MyAfterProc (as, arock) +static int MyAfterProc (as, arock) struct cmd_syndesc *as; char *arock; { afs_int32 code; @@ -848,7 +848,7 @@ static afs_int32 MyAfterProc (as, arock) return 0; } -static afs_int32 MyBeforeProc (as, arock) +static int MyBeforeProc (as, arock) struct cmd_syndesc *as; char *arock; { afs_int32 code; diff --git a/src/ptserver/utils.c b/src/ptserver/utils.c index ef456f184..368614947 100644 --- a/src/ptserver/utils.c +++ b/src/ptserver/utils.c @@ -287,7 +287,7 @@ afs_int32 aid; if (code != 0) return 0; if (aid == tentry.id) return entry; entry = tentry.nextID; - while (entry != NULL) { + while (entry != 0) { bzero(&tentry,sizeof(tentry)); code = pr_ReadEntry(at,0,entry,&tentry); if (code != 0) return 0; @@ -317,7 +317,7 @@ struct prentry *tentryp; if (code != 0) return 0; if ((strncmp(aname,tentryp->name,PR_MAXNAMELEN)) == 0) return entry; entry = tentryp->nextName; - while (entry != NULL) { + while (entry != 0) { bzero(tentryp, sizeof(struct prentry)); code = pr_ReadEntry(at,0,entry, tentryp); if (code != 0) return 0; @@ -410,7 +410,7 @@ afs_int32 *aid; return PRSUCCESS; } -afs_int32 IDCmp(a,b) +int IDCmp(a,b) afs_int32 *a; afs_int32 *b; { @@ -437,18 +437,18 @@ afs_int32 *loc; /* ??? in case ID hashed twice ??? */ bzero(&tentry,sizeof(tentry)); bzero(&bentry,sizeof(bentry)); trail = 0; - if (current == NULL) return PRSUCCESS; /* already gone */ + if (current == 0) return PRSUCCESS; /* already gone */ code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; while (aid != tentry.id) { trail = current; current = tentry.nextID; - if (current == NULL) break; + if (current == 0) break; code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; } - if (current == NULL) return PRSUCCESS; /* we didn't find him, so he's already gone */ - if (trail == NULL) { + if (current == 0) return PRSUCCESS; /* we didn't find him, so he's already gone */ + if (trail == 0) { /* it's the first entry! */ cheader.idHash[i] = htonl(tentry.nextID); code = pr_Write(tt,0,72+HASHSIZE*4+i*4,(char *)&cheader.idHash[i],sizeof(cheader.idHash[i])); @@ -504,18 +504,18 @@ afs_int32 *loc; bzero(&tentry,sizeof(tentry)); bzero(&bentry,sizeof(bentry)); trail = 0; - if (current == NULL) return PRSUCCESS; /* already gone */ + if (current == 0) return PRSUCCESS; /* already gone */ code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; while (strcmp(aname,tentry.name)) { trail = current; current = tentry.nextName; - if (current == NULL) break; + if (current == 0) break; code = pr_ReadEntry(tt,0,current,&tentry); if (code) return PRDBFAIL; } - if (current == NULL) return PRSUCCESS; /* we didn't find him, already gone */ - if (trail == NULL) { + if (current == 0) return PRSUCCESS; /* we didn't find him, already gone */ + if (trail == 0) { /* it's the first entry! */ cheader.nameHash[i] = htonl(tentry.nextName); code = pr_Write(tt,0,72+i*4,(char *)&cheader.nameHash[i],sizeof(cheader.nameHash[i])); @@ -609,7 +609,7 @@ afs_int32 RemoveFromOwnerChain(at,gid,oid) le = &thisEntry; lastLoc = 0; nptr = thisEntry.owned; - while (nptr != NULL) { + while (nptr != 0) { if (nptr == lastLoc) te = le; else { if (&thisEntry == le) te = &thatEntry; @@ -690,7 +690,7 @@ afs_int32 gid; nptr = ntohl(cheader.orphan); bzero(&bentry,sizeof(bentry)); loc = 0; - while (nptr != NULL) { + while (nptr != 0) { code = pr_ReadEntry(at,0,nptr,&tentry); if (code != 0) return PRDBFAIL; if (gid == tentry.id) { diff --git a/src/rcp/Makefile b/src/rcp/Makefile index b3903599c..9525c2024 100644 --- a/src/rcp/Makefile +++ b/src/rcp/Makefile @@ -54,13 +54,13 @@ rcp: ${OBJS} ${LIBS} esac ../rsh/rcmd.o: ../rsh/rcmd.c - (cd ../rsh ; make rcmd.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR}) + (cd ../rsh ; $(MAKE) rcmd.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR}) ../rsh/herror.o: ../rsh/herror.c - (cd ../rsh ; make herror.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR}) + (cd ../rsh ; $(MAKE) herror.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR}) ../inetd/ta-rauth.o: ../inetd/ta-rauth.c - (cd ../inetd ; make ta-rauth.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR}) + (cd ../inetd ; $(MAKE) ta-rauth.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR}) clean: clean: diff --git a/src/rlogind/Makefile b/src/rlogind/Makefile index 4ac2d3578..1b399bf28 100644 --- a/src/rlogind/Makefile +++ b/src/rlogind/Makefile @@ -66,13 +66,13 @@ rexecd: rexecd.o ${ALIBS} ../login/libutil.a : ../login/util_login.c ../login/util_logout.c ../login/util_logwtmp.c - ( cd ../login ; make libutil.a ) + ( cd ../login ; $(MAKE) libutil.a ) ../rsh/rcmd.o : ../rsh/rcmd.c - (cp AFS_component_version_number.c ../rsh/AFS_component_version_number.c ; cd ../rsh ; make rsh.o ) + (cp AFS_component_version_number.c ../rsh/AFS_component_version_number.c ; cd ../rsh ; $(MAKE) rsh.o ) ../rsh/herror.o : ../rsh/herror.c - ( cd ../rsh ; make herror.o ) + ( cd ../rsh ; $(MAKE) herror.o ) clean: rm -f ${OBJS} core rlogind AFS_component_version_number.c diff --git a/src/rsh/Makefile b/src/rsh/Makefile index 6717c5bc8..a76f10831 100644 --- a/src/rsh/Makefile +++ b/src/rsh/Makefile @@ -52,9 +52,9 @@ rlogin.o: rlogin.c AFS_component_version_number.c rsh.o: rsh.c AFS_component_version_number.c ../rlogind/herror.o: ../rlogind/herror.c - (cd ../rlogind ; make herror.o ) + (cd ../rlogind ; $(MAKE) herror.o ) ../inetd/ta-rauth.o : ../inetd/ta-rauth.c - (cd ../inetd ; make ta-rauth.o DESTDIR=${DESTDIR}) + (cd ../inetd ; $(MAKE) ta-rauth.o DESTDIR=${DESTDIR}) clean: rm -f ${OBJS} core rsh *.BAK AFS_component_version_number.c diff --git a/src/rsh/rcmd.c b/src/rsh/rcmd.c index 759b27dbc..9772e0439 100644 --- a/src/rsh/rcmd.c +++ b/src/rsh/rcmd.c @@ -596,7 +596,7 @@ _checkhost(rhost, lhost, len) nodomain = 1; return(0); } - ldomain[MAXHOSTNAMELEN] = NULL; + ldomain[MAXHOSTNAMELEN] = '\0'; if ((domainp = index(ldomain, '.')) == (char *)NULL) { nodomain = 1; return(0); diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index 2ab62d20a..bd467e37f 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -274,7 +274,6 @@ struct rx_peer *rxi_FindPeer(); struct rx_call *rxi_NewCall(); void rxi_FreeCall(); struct rx_call *rxi_FindCall(); -void rx_ListenerProc(); int rxi_ReadPacket(); struct rx_packet *rxi_ReceivePacket(); struct rx_packet *rxi_ReceiveDataPacket(); diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index c78d69541..6517423b9 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -54,7 +54,7 @@ void rxi_Wakeup(void *addr) } PROCESS rx_listenerPid; /* LWP process id of socket listener process */ -void rx_ListenerProc(); +static void rx_ListenerProc(void *dummy); /* * Delay the current thread the specified number of seconds. @@ -250,7 +250,7 @@ void rxi_ListenerProc(rfds, tnop, newcallp) /* This is the listener process request loop. The listener process loop * becomes a server thread when rxi_ListenerProc returns, and stays * server thread until rxi_ServerProc returns. */ -static void rx_ListenerProc() +static void rx_ListenerProc(void *dummy) { int threadID; int sock; diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index 50b62918c..c81f86b05 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -49,6 +49,8 @@ static long rx_pthread_n_event_wakeups; */ static int rx_pthread_event_rescheduled = 0; +static void rx_ListenerProc(void *); + /* * We supply an event handling thread for Rx's event processing. * The condition variable is used to wakeup the thread whenever a new diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index e0f272dfd..a774acd66 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -97,6 +97,7 @@ static unsigned_dec(); static def_package(); static def_prefix(); static def_startingopcode(); +static def_statindex(); static def_split(); static customize_struct(); static def_special(); diff --git a/src/rxkad/rxkad_server.c b/src/rxkad/rxkad_server.c index 6c2e19e5b..43c232a60 100644 --- a/src/rxkad/rxkad_server.c +++ b/src/rxkad/rxkad_server.c @@ -76,7 +76,7 @@ pthread_mutex_t rxkad_random_mutex; static void init_random_int32 () { struct timeval key; - gettimeofday (&key, (char *) 0); + gettimeofday (&key, NULL); LOCK_RM fc_keysched (&key, random_int32_schedule); UNLOCK_RM diff --git a/src/sgistuff/Makefile b/src/sgistuff/Makefile index 51618f763..8ec1c4c98 100644 --- a/src/sgistuff/Makefile +++ b/src/sgistuff/Makefile @@ -48,10 +48,10 @@ afskauthlib.so: sgi_auth.o ${KAFSLIBS} ${AUTHFILES} $(LD) ${LDFLAGS} -shared -all -o afskauthlib.so sgi_auth.o $(KAFSLIBS) ${AUTHFILES} ../rsh/rcmd.o: ../rsh/rcmd.c - (cd ../rsh ; make rcmd.o ) + (cd ../rsh ; $(MAKE) rcmd.o ) ../rsh/herror.o: ../rsh/herror.c - (cd ../rsh ; make herror.o ) + (cd ../rsh ; $(MAKE) herror.o ) sgi_auth.o: sgi_auth.c ${CC} ${CFLAGS} -c sgi_auth.c diff --git a/src/sys/rmtsysc.c b/src/sys/rmtsysc.c index e83238946..9b8fe1548 100644 --- a/src/sys/rmtsysc.c +++ b/src/sys/rmtsysc.c @@ -201,7 +201,8 @@ struct ViceIoctl *data; { struct rx_connection *conn; clientcred creds; - afs_int32 errorcode, groups[NGROUPS_MAX], errornumber, ins= data->in_size; + afs_int32 errorcode, errornumber, ins= data->in_size; + afs_uint32 groups[NGROUPS_MAX]; rmtbulk InData, OutData; char pathname[256], *pathp = pathname, *inbuffer; #if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */ diff --git a/src/ubik/ubikclient.c b/src/ubik/ubikclient.c index 30499db1d..253ab6262 100644 --- a/src/ubik/ubikclient.c +++ b/src/ubik/ubikclient.c @@ -132,7 +132,7 @@ static void afs_random_once(void) * use time and pid to try to get some initial randomness. */ #if !defined(UKERNEL) -#define ranstage(x) (x)= (afs_uint32) (3141592621*((afs_uint32)x)+1) +#define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1) unsigned int afs_random(void) { diff --git a/src/usd/usd_file.c b/src/usd/usd_file.c index 9ec145cf2..a2b497349 100644 --- a/src/usd/usd_file.c +++ b/src/usd/usd_file.c @@ -64,8 +64,8 @@ typedef off_t osi_lloff_t; static int usd_FileRead( usd_handle_t usd, char *buf, - u_int nbytes, - u_int *xferdP) + afs_uint32 nbytes, + afs_uint32 *xferdP) { int fd = (int)(usd->handle); int got; @@ -84,8 +84,8 @@ static int usd_FileRead( static int usd_FileWrite( usd_handle_t usd, char *buf, - u_int nbytes, - u_int *xferdP) + afs_uint32 nbytes, + afs_uint32 *xferdP) { int fd = (int)(usd->handle); int sent; diff --git a/src/venus/fs.c b/src/venus/fs.c index 74e4d8cae..2f92a09fc 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -2764,6 +2764,61 @@ static StoreBehindCmd(as) return error; } + +static afs_int32 SetCryptCmd(as) + struct cmd_syndesc *as; +{ + afs_int32 code = 0, flag; + struct ViceIoctl blob; + char *tp; + + tp = as->parms[0].items->data; + if (strcmp(tp, "on") == 0) + flag = 1; + else if (strcmp(tp, "off") == 0) + flag = 0; + else { + fprintf (stderr, "%s: %s must be \"on\" or \"off\".\n", pn, tp); + return EINVAL; + } + + blob.in = (char *) &flag; + blob.in_size = sizeof(flag); + blob.out_size = 0; + code = pioctl(0, VIOC_SETRXKCRYPT, &blob, 1); + if (code) + Die(code, (char *) 0); + return 0; +} + + +static afs_int32 GetCryptCmd(as) + struct cmd_syndesc *as; +{ + afs_int32 code = 0, flag; + struct ViceIoctl blob; + char *tp; + + blob.in = (char *) 0; + blob.in_size = 0; + blob.out_size = sizeof(flag); + blob.out = space; + + code = pioctl(0, VIOC_GETRXKCRYPT, &blob, 1); + + if (code) Die(code, (char *) 0); + else { + tp = space; + bcopy(tp, &flag, sizeof(afs_int32)); + printf("Security level is currently "); + if (flag == 1) + printf("crypt (data security).\n"); + else + printf("clear.\n"); + } + return 0; +} + #include "AFS_component_version_number.c" main(argc, argv) @@ -2987,6 +3042,9 @@ defect 3069 cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "show status"); cmd_CreateAlias(ts, "sb"); + ts = cmd_CreateSyntax("setcrypt", SetCryptCmd, 0, "set cache manager encryption flag"); + cmd_AddParm(ts, "-crypt", CMD_SINGLE, 0, "on or off"); + ts = cmd_CreateSyntax("rxstatproc", RxStatProcCmd, 0, "Manage per process RX statistics"); cmd_AddParm(ts, "-enable", CMD_FLAG, CMD_OPTIONAL, diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 6f6650a0d..e57e41081 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -58,7 +58,7 @@ int LogLevel = 0; int smallMem = 0; int rxJumbograms = 1; /* default is to send and receive jumbo grams */ -CheckSignal_Signal() {IOMGR_SoftSig(CheckSignal, 0);} +static void CheckSignal_Signal() {IOMGR_SoftSig(CheckSignal, 0);} static CheckSignal() { diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 9d801b2b2..1d8a25d14 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -431,7 +431,7 @@ int SalvageVolumeHeaderFile(register struct InodeSummary *isp, void showlog(void); int UseTheForceLuke(char *path); - +static int IsVnodeOrphaned(VnodeId vnode); /* Uniquifier stored in the Inode */ static Unique IUnique(u) @@ -547,6 +547,14 @@ static handleit(as) orphans = ORPH_ATTACH; } +#ifdef FAST_RESTART + if (ti = as->parms[16].items) { /* -DontSalvage */ + printf("Exiting immediately without salvage. Look into the FileLog"); + printf(" to find volumes which really need to be salvaged!\n"); + Exit(0); + } +#endif /* FAST_RESTART */ + /* Note: if seemvol we initialize this as a standard volume utility: this has the implication that the file server may be running; negotations have to be made with the file server in this case to take the read write volume and associated read-only @@ -713,6 +721,9 @@ char **argv; cmd_AddParm(ts, "-showsuid", CMD_FLAG,CMD_OPTIONAL, "Report on suid/sgid files"); cmd_AddParm(ts, "-showmounts", CMD_FLAG,CMD_OPTIONAL, "Report on mountpoints"); cmd_AddParm(ts, "-orphans", CMD_SINGLE, CMD_OPTIONAL, "ignore | remove | attach"); +#ifdef FAST_RESTART + cmd_AddParm(ts, "-DontSalvage", CMD_FLAG, CMD_OPTIONAL, "Don't salvage. This my be set in BosConfig to let the fileserver restart immediately after a crash. Bad volumes will be taken offline"); +#endif /* FAST_RESTART */ err = cmd_Dispatch(argc, argv); Exit(err); } diff --git a/src/vol/volume.c b/src/vol/volume.c index 0d540e328..2345e231d 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -98,7 +98,7 @@ #include #endif /* ITIMER_REAL */ #endif /* AFS_NT40_ENV */ -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_LINUX20_ENV) #include #else #include @@ -746,6 +746,7 @@ private Volume *attach2(ec, path, header, partp, isbusy) return NULL; } if (programType == fileServer) { +#ifndef FAST_RESTART if (V_inUse(vp) && VolumeWriteable(vp)) { if (!V_needsSalvaged(vp)) { V_needsSalvaged(vp) = 1; @@ -756,6 +757,7 @@ private Volume *attach2(ec, path, header, partp, isbusy) *ec = VSALVAGE; return NULL; } +#endif /* FAST_RESTART */ if (V_destroyMe(vp) == DESTROY_ME) { FreeVolume(vp); Log("VAttachVolume: volume %s is junk; it should be destroyed at next salvage\n", path); @@ -767,6 +769,7 @@ private Volume *attach2(ec, path, header, partp, isbusy) AddVolumeToHashTable(vp, V_id(vp)); vp->nextVnodeUnique = V_uniquifier(vp); vp->vnodeIndex[vSmall].bitmap = vp->vnodeIndex[vLarge].bitmap = NULL; +#ifndef BITMAP_LATER if (programType == fileServer && VolumeWriteable(vp)) { int i; for (i = 0; ispecialStatus) vp->specialStatus = 0; @@ -1209,6 +1213,43 @@ int VAllocBitmapEntry_r(ec,vp,index) *ec = VREADONLY; return 0; } +#ifdef BITMAP_LATER + if ((programType == fileServer) && !index->bitmap) { + int i; + int wasVBUSY = 0; + if (vp->specialStatus == VBUSY) { + if (vp->goingOffline) { /* vos dump waiting for the volume to + go offline. We probably come here + from AddNewReadableResidency */ + wasVBUSY = 1; + } else { + VOL_UNLOCK + while (vp->specialStatus == VBUSY) +#ifdef AFS_PTHREAD_ENV + sleep(2); +#else /* AFS_PTHREAD_ENV */ + IOMGR_Sleep(2); +#endif /* AFS_PTHREAD_ENV */ + VOL_LOCK + } + } + if (!index->bitmap) { + vp->specialStatus = VBUSY; /* Stop anyone else from using it.*/ + for (i = 0; ispecialStatus = 0; + vp->shuttingDown = 1; /* Let who has it free it. */ + return NULL; + } + } + if (!wasVBUSY) + vp->specialStatus = 0; /* Allow others to have access. */ + } + } +#endif /* BITMAP_LATER */ bp = index->bitmap + index->bitmapOffset; ep = index->bitmap + index->bitmapSize; while (bp < ep) { @@ -1253,6 +1294,9 @@ void VFreeBitMapEntry_r(Error *ec, register struct vnodeIndex *index, { unsigned int offset; *ec = 0; +#ifdef BITMAP_LATER + if (!index->bitmap) return; +#endif /* BITMAP_LATER */ offset = bitNumber>>3; if (offset >= index->bitmapSize) { *ec = VNOVNODE; @@ -1339,6 +1383,9 @@ static void GetBitmap(Error *ec, Volume *vp, VnodeClass class) struct VnodeDiskObject *vnode; unsigned int unique = 0; FdHandle_t *fdP; +#ifdef BITMAP_LATER + byte *BitMap = 0; +#endif /* BITMAP_LATER */ *ec = 0; @@ -1357,9 +1404,14 @@ static void GetBitmap(Error *ec, Volume *vp, VnodeClass class) the whole thing is rounded up to nearest 4 bytes, because the bit map allocator likes it that way */ +#ifdef BITMAP_LATER + BitMap = (byte *) calloc(1, vip->bitmapSize); + assert(BitMap != NULL); +#else /* BITMAP_LATER */ vip->bitmap = (byte *) calloc(1, vip->bitmapSize); assert(vip->bitmap != NULL); vip->bitmapOffset = 0; +#endif /* BITMAP_LATER */ if (STREAM_SEEK(file,vcp->diskSize,0) != -1) { int bitNumber = 0; for (bitNumber = 0; bitNumber < nVnodes+100; bitNumber++) { @@ -1372,7 +1424,11 @@ static void GetBitmap(Error *ec, Volume *vp, VnodeClass class) *ec = VSALVAGE; break; } +#ifdef BITMAP_LATER + *(BitMap + (bitNumber>>3)) |= (1 << (bitNumber & 0x7)); +#else /* BITMAP_LATER */ *(vip->bitmap + (bitNumber>>3)) |= (1 << (bitNumber & 0x7)); +#endif /* BITMAP_LATER */ if (unique <= vnode->uniquifier) unique = vnode->uniquifier + 1; } @@ -1394,6 +1450,17 @@ static void GetBitmap(Error *ec, Volume *vp, VnodeClass class) STREAM_CLOSE(file); FDH_CLOSE(fdP); free(vnode); +#ifdef BITMAP_LATER + /* There may have been a racing condition with some other thread, both + * creating the bitmaps for this volume. If the other thread was faster + * the pointer to bitmap should already be filled and we can free ours. + */ + if (vip->bitmap == NULL) { + vip->bitmap = BitMap; + vip->bitmapOffset = 0; + } else + free((byte *)BitMap); +#endif /* BITMAP_LATER */ } static void GetVolumePath(Error *ec, VolId volumeId, char **partitionp, diff --git a/src/vol/vutil.c b/src/vol/vutil.c index f58fdd1ca..83b97b334 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -56,7 +56,7 @@ #ifdef AFS_AIX_ENV #include #endif -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_LINUX20_ENV) #include #else #include diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index d5808f3e7..e44971ffd 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -673,7 +673,7 @@ static int DumpDumpHeader(register struct iod *iodp, register Volume *vp, if (!code) code = DumpString(iodp, 'n',V_name(vp)); dumpTimes[0] = fromtime; dumpTimes[1] = V_backupDate(vp); /* Until the time the clone was made */ - if (!code) code = DumpArrayInt32(iodp, 't', (unsigned int *)dumpTimes, 2); + if (!code) code = DumpArrayInt32(iodp, 't', (afs_uint32 *)dumpTimes, 2); return code; } @@ -811,7 +811,7 @@ int RestoreVolume(register struct rx_call *call, Volume *avp, register Volume *vp; struct iod iod; register struct iod *iodp = &iod; - int *b1=0, *b2=0; + afs_int32 *b1=0, *b2=0; int s1=0, s2=0, delo=0, tdelo; int tag; @@ -913,7 +913,7 @@ static int ReadVnodes(register struct iod *iodp, Volume *vp, while (tag == D_VNODE) { int haveStuff = 0; bzero(buf, sizeof (buf)); - if (!ReadInt32(iodp, (unsigned int *)&vnodeNumber)) + if (!ReadInt32(iodp, (afs_uint32 *)&vnodeNumber)) break; ReadInt32(iodp, &vnode->uniquifier); @@ -946,7 +946,7 @@ static int ReadVnodes(register struct iod *iodp, Volume *vp, ReadInt32(iodp, &vnode->owner); break; case 'g': - ReadInt32(iodp, (unsigned int *)&vnode->group); + ReadInt32(iodp, (afs_uint32 *)&vnode->group); break; case 'b': { unsigned short modeBits; @@ -1101,7 +1101,7 @@ static int ReadDumpHeader(register struct iod *iodp, struct DumpHeader *hp) register tag; afs_uint32 beginMagic; if (iod_getc(iodp) != D_DUMPHEADER || !ReadInt32(iodp, &beginMagic) - || !ReadInt32(iodp, (unsigned int *)&hp->version) + || !ReadInt32(iodp, (afs_uint32 *)&hp->version) || beginMagic != DUMPBEGINMAGIC ) return 0; hp->volumeId = 0; @@ -1122,7 +1122,8 @@ static int ReadDumpHeader(register struct iod *iodp, struct DumpHeader *hp) return 0; hp->nDumpTimes = (arrayLength >> 1); for (i = 0; inDumpTimes; i++) - if (!ReadInt32(iodp, (unsigned int *)&hp->dumpTimes[i].from) || !ReadInt32(iodp, (unsigned int *)&hp->dumpTimes[i].to)) + if (!ReadInt32(iodp, (afs_uint32 *)&hp->dumpTimes[i].from) + || !ReadInt32(iodp, (afs_uint32 *)&hp->dumpTimes[i].to)) return 0; break; }