From 339167ef1fda899655969f4572ff95271dfdb7cf Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 10 Jul 2019 15:14:28 -0500 Subject: [PATCH] Remove dead code There is a perhaps-surprisingly large amount of code disabled behind directives like '#if 0', '#ifdef notdef', and '#ifdef notyet'. At best, this code is clutter, and at worst some of it is confusing/outdated, and/or confusingly nested inside other preprocessor conditionals. Sometimes this disabled code shows up when grepping the tree, and causes a nuisance when refactoring related areas of code. Get rid of all of it. If anyone ever wants this code back, it can always be restored by reverting portions of this commit. Also delete some comments that clearly refer to the disabled code, and in some cases, adjust the adjacent comments to make sense accordingly. This commit doesn't touch any files in src/external/. Change-Id: If260a41257e8d107930bd3c177eddb8ab336f0d1 Reviewed-on: https://gerrit.openafs.org/13683 Reviewed-by: Benjamin Kaduk Tested-by: Benjamin Kaduk --- src/JAVA/libjafs/File.c | 69 -- src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp | 21 +- src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp | 19 - src/WINNT/afsapplib/al_browseset.cpp | 40 - src/WINNT/afsapplib/resize.cpp | 12 - src/WINNT/afsclass/worker.cpp | 9 - src/WINNT/afsd/cm_btree.c | 3 - src/WINNT/afsd/cm_buf.c | 31 - src/WINNT/afsd/cm_daemon.c | 11 - src/WINNT/afsd/cm_ioctl.c | 145 --- src/WINNT/afsd/cm_nls.c | 17 - src/WINNT/afsd/cm_nls.h | 13 - src/WINNT/afsd/cm_performance.c | 18 - src/WINNT/afsd/cm_vnodeops.c | 23 - src/WINNT/afsd/fs.c | 10 - src/WINNT/afsd/krb.h | 63 -- src/WINNT/afsd/rpc_srvsvc.c | 12 - src/WINNT/afsd/smb.c | 38 +- src/WINNT/afsd/smb3.c | 5 - src/WINNT/afsrdr/kernel/lib/AFSInit.cpp | 26 - src/WINNT/afsrdr/user/RDRFunction.c | 18 - src/WINNT/client_config/config.cpp | 128 --- src/WINNT/client_config/drivemap.cpp | 24 - src/WINNT/client_config/tab_hosts.cpp | 5 - src/WINNT/client_osi/osidb.c | 42 - src/WINNT/client_osi/osidebug.c | 57 -- src/WINNT/install/loopback/wmi.cpp | 34 - src/WINNT/kfw/inc/krb4/conf.h | 5 - src/WINNT/kfw/inc/krb4/krb.h | 9 - src/WINNT/kfw/inc/krb5/krb5/krb5.h | 3 - src/WINNT/kfw/inc/krbcc/cacheapi.h | 15 - src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h | 22 - src/WINNT/kfw/inc/netidmgr/khmsgtypes.h | 8 - src/WINNT/netidmgr_plugin/afsfuncs.c | 30 - src/WINNT/netidmgr_plugin/afsplugin.c | 11 - src/WINNT/tests/largefiles/lftest.c | 6 - src/WINNT/tests/torture/Source/WinTorture.c | 10 +- src/afs/AIX/osi_sleep.c | 5 - src/afs/AIX/osi_vnodeops.c | 8 - src/afs/DARWIN/osi_inode.c | 11 - src/afs/DARWIN/osi_machdep.h | 14 - src/afs/DARWIN/osi_vfsops.c | 3 - src/afs/DARWIN/osi_vm.c | 19 - src/afs/DARWIN/osi_vnodeops.c | 22 - src/afs/FBSD/osi_inode.c | 154 ---- src/afs/FBSD/osi_vnodeops.c | 27 - src/afs/HPUX/osi_vnodeops.c | 106 --- src/afs/IRIX/osi_vfs.h | 4 - src/afs/LINUX/osi_nfssrv.c | 20 - src/afs/LINUX/osi_probe.c | 6 - src/afs/LINUX/osi_vnodeops.c | 14 - src/afs/NBSD/osi_file.c | 3 - src/afs/NBSD/osi_machdep.h | 4 - src/afs/NBSD/osi_vnodeops.c | 24 - src/afs/OBSD/osi_file.c | 3 - src/afs/OBSD/osi_misc.c | 28 - src/afs/OBSD/osi_vnodeops.c | 9 - src/afs/UKERNEL/osi_machdep.h | 3 - src/afs/VNOPS/afs_vnop_lookup.c | 4 - src/afs/afs_callback.c | 123 --- src/afs/afs_daemons.c | 3 - src/afs/afs_disconnected.c | 54 +- src/afs/afs_fetchstore.c | 13 - src/afs/afs_pag_cred.c | 3 - src/afs/afs_pioctl.c | 4 - src/afs/afs_vcache.c | 151 ---- src/afs/afs_volume.c | 19 - src/afsd/afsd.c | 19 - src/afsmonitor/afsmon-win.c | 4 - src/afsmonitor/afsmonitor.c | 24 - src/afsweb/nsafs.c | 6 - src/aklog/aklog.c | 4 - src/auth/ktc.c | 5 - src/auth/ktc_nt.c | 14 +- src/bozo/bnode.c | 4 - src/bucoord/bc_status.c | 26 - src/bucoord/config.c | 20 - src/bucoord/dsstub.c | 54 -- src/bucoord/dump.c | 27 - src/budb/database.h | 6 - src/budb/db_dump.c | 23 - src/budb/db_hash.c | 84 -- src/budb/procs.c | 165 ---- src/butc/afsxbsa.c | 20 - src/butc/recoverDb.c | 9 - src/butc/tcmain.c | 18 - src/comerr/error_table_nt.c | 8 - src/config/param.nbsd40.h | 8 - src/config/param.nbsd50.h | 10 - src/config/param.nbsd60.h | 10 - src/config/param.nbsd70.h | 10 - src/config/param.sgi_65.h | 10 - src/config/param.sun4x_510.h | 4 - src/config/param.sun4x_511.h | 4 - src/config/param.sun4x_58.h | 4 - src/config/param.sun4x_59.h | 4 - src/config/param.sunx86_510.h | 4 - src/config/param.sunx86_511.h | 4 - src/config/param.sunx86_58.h | 4 - src/config/param.sunx86_59.h | 4 - src/config/stds.h | 25 - src/export/cfgafs.c | 3 - src/export/cfgexport.c | 10 - src/export/export.c | 3 - src/gtx/curses_test.c | 8 - src/gtx/gtxX11win.h | 11 - src/gtx/gtxdumbwin.h | 11 - src/gtx/object_test.c | 6 - src/kauth/admin_tools.c | 45 - src/kauth/crypt.c | 56 -- src/kauth/kadatabase.c | 14 - src/kauth/kaprocs.c | 9 - src/kauth/kpasswd.c | 22 - src/libadmin/test/bos.c | 16 - src/libadmin/test/vos.c | 8 - src/libadmin/vos/vsprocs.c | 103 --- src/lwp/lock.h | 37 - src/lwp/test/selserver.c | 7 - src/platform/DARWIN/AFSPreference/Krb5Util.m | 7 - src/platform/DARWIN/growlagent/main.m | 4 - src/ptserver/ptclient.c | 10 - src/ptserver/ptprocs.c | 9 - src/ptserver/pts.c | 92 -- src/ptserver/testpt.c | 12 - src/rx/AIX/rx_knet.c | 15 - src/rx/FBSD/rx_knet.c | 5 - src/rx/HPUX/rx_kmutex.h | 42 - src/rx/NBSD/rx_knet.c | 6 - src/rx/rx_packet.h | 18 - src/rxgen/rpc_cout.c | 7 - src/rxgen/rpc_parse.c | 23 - src/rxkad/bg-fcrypt.c | 18 - src/rxkad/fcrypt.c | 10 - src/rxkad/rxkad_convert.h | 7 - src/rxkad/test/stress_c.c | 20 - src/rxkad/test/stress_s.c | 6 - src/rxkad/ticket5.c | 5 - src/scout/scout.c | 54 -- src/sys/afssyscalls.c | 54 -- src/tests/afscp.c | 22 - src/tests/asu.c | 7 - src/tests/ga-test.c | 7 - src/tests/large-dir.c | 4 - src/tests/large-dir2.c | 4 - src/tests/mmap-and-read.c | 5 - src/tests/rename-under-feet.c | 4 - src/tools/dumpscan/directory.c | 13 - src/tools/dumpscan/dumptool.c | 3 - src/tools/dumpscan/intNN.h | 7 - src/tsalvaged/salvsync-debug.c | 19 - src/tsm41/aix_aklog.c | 33 - src/ubik/utst_server.c | 3 - src/uss/uss_common.c | 6 - src/uss/uss_vol.c | 38 - src/uss/uss_vol.h | 15 - src/util/afs_lhash.c | 3 - src/util/ktime.c | 6 - src/venus/fs.c | 12 - src/venus/fstrace.c | 4 - src/venus/kdump.c | 165 ---- src/venus/test/fulltest.c | 8 - src/vfsck/pass5.c | 12 - src/viced/afsfileprocs.c | 8 - src/viced/fsprobe.c | 842 ------------------ src/viced/state_analyzer.c | 27 - src/vol/listinodes.c | 9 - src/vol/partition.c | 8 - src/vol/purge.c | 24 - src/vol/salvsync-server.c | 34 - src/vol/volume.c | 49 - src/vol/volume.h | 5 +- src/volser/restorevol.c | 17 - src/volser/vol-dump.c | 9 - src/volser/vos.c | 41 - src/volser/vsprocs.c | 96 -- tests/rpctestlib/rpc_test_procs.c | 5 - 176 files changed, 10 insertions(+), 4875 deletions(-) diff --git a/src/JAVA/libjafs/File.c b/src/JAVA/libjafs/File.c index 0804742199..78a6029f97 100644 --- a/src/JAVA/libjafs/File.c +++ b/src/JAVA/libjafs/File.c @@ -394,62 +394,6 @@ JNIEXPORT jlong JNICALL Java_org_openafs_jafs_File_listNative (JNIEnv *env, jobject obj, jobject buffer) { return 0; -#if 0 - char dirName[FILENAME_MAX]; - jclass arrayListClass; - jmethodID addID; - jstring entryJString; - usr_DIR *dirp; - struct usr_dirent *enp; - int i, dirSize; - - *dirName='\0'; - getAbsolutePath(env, &obj, dirName); - if(*dirName == '\0') { - fprintf(stderr, "File::listNative(): failed to get dirName\n"); - setError(env, &obj, -1); - return 0; - } - arrayListClass = (*env)->GetObjectClass(env, buffer); - if(arrayListClass == NULL) { - fprintf(stderr, "File::listNative(): GetObjectClass failed\n"); - setError(env, &obj, -1); - return 0; - } - addID = (*env) -> GetMethodID(env, arrayListClass, "add", - "(Ljava/lang/Object;)Z"); - if(addID == 0) { - fprintf(stderr, - "File::listNative(): failed to get addID\n"); - setError(env, &obj, -1); - return 0; - } - dirp = uafs_opendir(dirName); - if(dirp == NULL) { - fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n", - dirName, afs_error_message(errno)); - setError(env, &obj, errno); - //throwAFSSecurityException( env, errno ); - return 0; - } - while((enp = uafs_readdir(dirp)) != NULL) { - if(strcmp(enp->d_name, ".") == 0 || strcmp(enp->d_name, "..") == 0) { - continue; - } - entryJString = (*env) -> NewStringUTF(env, enp->d_name); - if(entryJString == NULL) { - fprintf(stderr, "File::listNative(): NewStringUTF failed\n"); - setError(env, &obj, -1); - return 0; - } - (*env) -> CallBooleanMethod(env, buffer, addID, entryJString); - } - /*uafs_closedir(dirp);*/ - - setError(env, &obj, 0); - - return (jlong) dirp; -#endif } /** @@ -465,19 +409,6 @@ JNIEXPORT jboolean JNICALL Java_org_openafs_jafs_File_closeDir { return JNI_TRUE; - -#if 0 - usr_DIR *dirp = (usr_DIR *) dp; - int rc; - - rc = uafs_closedir(dirp); - if (rc < 0) { - setError(env, &obj, errno); - return JNI_FALSE; - } - else return JNI_TRUE; -#endif - } diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp index b986e5468e..3dd62d06f2 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp @@ -57,26 +57,7 @@ BOOL ADMINAPI BindToAdminServer (LPCTSTR pszAddress, BOOL fWait, UINT_PTR *pidCl for (DWORD dwTickStart = GetTickCount(); ; ) { -#ifdef notdef - // First we'll enumerate the name services around here to see if - // an admin server is already running. - // - RPC_NS_HANDLE hEnum; - if ((status = RpcNsBindingImportBegin (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_c_ifspec, NULL, &hEnum)) == 0) - { - RPC_BINDING_HANDLE hBind; - status = RpcNsBindingImportNext (hEnum, &hBind); - RpcNsBindingImportDone (&hEnum); - - if (status) - RpcBindingFree (&hBind); - else if (ValidateBinding (hBind, pidClient, (ULONG*)&status)) - return TRUE; - else if (status != RPC_S_CALL_FAILED_DNE) // server rejected us! - break; - } -#endif - // Failing that, we'll try to bind to the well-known endpoint that the + // Try to bind to the well-known endpoint that the // admin server may have had to use. (if RpcNsBindingExport failed.) // unsigned char *pszStringBinding = NULL; diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp index e62973855d..ef8e8fd383 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp @@ -85,9 +85,6 @@ int cdecl main (int argc, char **argv) // Clean up any broken interface registration // RpcServerUnregisterIf (ITaAfsAdminSvr_v1_0_s_ifspec, 0, FALSE); -#ifdef notdef - RpcNsBindingUnexport (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_s_ifspec, NULL); -#endif // Register our interface // @@ -125,13 +122,6 @@ int cdecl main (int argc, char **argv) { BOOL fExportedBinding = FALSE; -#ifdef notdef - if ((status = RpcNsBindingExport (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_s_ifspec, pBindingVector, NULL)) == 0) - fExportedBinding = TRUE; - else - Print (dlWARNING, TEXT("RpcNsBindingExport failed (benign); error 0x%08lX"), status); -#endif - if (!fExportedBinding && !fGotPort) { Print (dlERROR, TEXT("RpcNsBindingExport failed; error 0x%08lX"), status); @@ -166,15 +156,6 @@ int cdecl main (int argc, char **argv) AfsAdmSvr_Shutdown(); } -#ifdef notdef - if (fExportedBinding) - { - if ((status = RpcNsBindingUnexport (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_s_ifspec, NULL)) != 0) - { - Print (dlWARNING, TEXT("RpcNsBindingExport failed; error 0x%08lX"), status); - } - } -#endif if ((status = RpcEpUnregister (ITaAfsAdminSvr_v1_0_s_ifspec, pBindingVector, NULL)) != 0) { Print (dlWARNING, TEXT("RpcEpUnregister failed; error 0x%08lX"), status); diff --git a/src/WINNT/afsapplib/al_browseset.cpp b/src/WINNT/afsapplib/al_browseset.cpp index 672c45f45f..fbb8125944 100644 --- a/src/WINNT/afsapplib/al_browseset.cpp +++ b/src/WINNT/afsapplib/al_browseset.cpp @@ -301,46 +301,6 @@ DWORD WINAPI BrowseSet_Init_ThreadProc (LPARAM lp) // Fill in hList with the names of all filesets in the cell. // ULONG status = 0; -#if 0 - // TODO - if (OpenFTS (&status)) - { - PVOID hCell; - if ((status = FtsOpenCell (szCellA, &hCell)) == 0) - { - fldb_short_ft_info_t *fti; - if ((status = FtsAllocateShortFtInfoBuffer (&fti)) == 0) - { - PVOID cookie = 0; - ULONG nEntries; - - while ( (FtsListFilesetsFromFldb (hCell, fti, &nEntries, &cookie) == 0) && (nEntries > 0) ) - { - if (!IsWindow ((HWND)(lpp->pInternal))) - break; - - for (ULONG ii = 0; ii < nEntries; ++ii) - { -#define DECODE_SHINFO_TYPE_FLAGS(_fl) ((_fl) >> 12) - if (DECODE_SHINFO_TYPE_FLAGS(fti[ ii ].flags) & FTS_FT_SHINFO_TYPE_RW) - { - LPTSTR pszFileset; - if ((pszFileset = CloneString (fti[ii].name)) != NULL) - { - PostMessage ((HWND)(lpp->pInternal), WM_FOUNDNAME, (WPARAM)pszFileset, 0); - // string memory is freed by recipient of message - } - } - } - } - FtsFreeShortFtInfoBuffer (fti); - } - FtsCloseCell (hCell); - } - CloseFTS(); - } -#endif - if (IsWindow ((HWND)(lpp->pInternal))) PostMessage ((HWND)(lpp->pInternal), WM_THREADDONE, status, 0); diff --git a/src/WINNT/afsapplib/resize.cpp b/src/WINNT/afsapplib/resize.cpp index 0c1c5014bb..98fd8e1115 100644 --- a/src/WINNT/afsapplib/resize.cpp +++ b/src/WINNT/afsapplib/resize.cpp @@ -636,18 +636,6 @@ LONG APIENTRY SplitterWndProc (HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) SetWindowLong (hWnd, GWL_USER, 0); } break; - -#if 0 // Enable me to make the splitters draw in black - case WM_PAINT: - { - PAINTSTRUCT ps; - HDC hdc = BeginPaint (hWnd, &ps); - FillRect (hdc, &ps.rcPaint, GetStockObject(BLACK_BRUSH)); - EndPaint (hWnd, &ps); - return 0; - } - break; -#endif } } diff --git a/src/WINNT/afsclass/worker.cpp b/src/WINNT/afsclass/worker.cpp index 5960fd6f79..2a65f6d856 100644 --- a/src/WINNT/afsclass/worker.cpp +++ b/src/WINNT/afsclass/worker.cpp @@ -30,21 +30,12 @@ extern "C" { * */ -#if 0 -static LPCTSTR cszAFSVOSDLL = TCHAR("AfsVosAdmin.dll"); -static LPCTSTR cszAFSBOSDLL = TCHAR("AfsBosAdmin.dll"); -static LPCTSTR cszAFSKASDLL = TCHAR("AfsKasAdmin.dll"); -static LPCTSTR cszAFSPTSDLL = TCHAR("AfsPtsAdmin.dll"); -static LPCTSTR cszAFSUTILDLL = TCHAR("AfsAdminUtil.dll"); -static LPCTSTR cszAFSCLIENTDLL = TCHAR("AfsClientAdmin.dll"); -#else static LPCTSTR cszAFSVOSDLL = __T("AfsVosAdmin.dll"); static LPCTSTR cszAFSBOSDLL = __T("AfsBosAdmin.dll"); static LPCTSTR cszAFSKASDLL = __T("AfsKasAdmin.dll"); static LPCTSTR cszAFSPTSDLL = __T("AfsPtsAdmin.dll"); static LPCTSTR cszAFSUTILDLL = __T("AfsAdminUtil.dll"); static LPCTSTR cszAFSCLIENTDLL = __T("AfsClientAdmin.dll"); -#endif /* * VARIABLES __________________________________________________________________ diff --git a/src/WINNT/afsd/cm_btree.c b/src/WINNT/afsd/cm_btree.c index 82cd9d3782..615c4054e3 100644 --- a/src/WINNT/afsd/cm_btree.c +++ b/src/WINNT/afsd/cm_btree.c @@ -2147,9 +2147,6 @@ long cm_BPlusDirBuildTree(cm_scache_t *scp, cm_user_t *userp, cm_req_t* reqp) bplus_build_time += (end.QuadPart - start.QuadPart); -#if 0 - cm_BPlusDirEnumTest(scp, 1); -#endif return rc; } diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 37c8e803a5..57bd614c32 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -2603,37 +2603,6 @@ long buf_ClearRDRFlag(cm_scache_t *scp, char *reason) return 0; } -#if 0 -long buf_CleanDirtyBuffers(cm_scache_t *scp) -{ - cm_buf_t *bp; - afs_uint32 bcount = 0; - cm_fid_t * fidp = &scp->fid; - - for (bp = cm_data.buf_allp; bp; bp=bp->allp, bcount++) { - if (!cm_FidCmp(fidp, &bp->fid) && (bp->flags & CM_BUF_DIRTY)) { - buf_Hold(bp); - lock_ObtainMutex(&bp->mx); - _InterlockedAnd(&bp->cmFlags, ~CM_BUF_CMSTORING); - _InterlockedAnd(&bp->flags, ~CM_BUF_DIRTY); - bp->dirty_length = 0; - _InterlockedOr(&bp->flags, CM_BUF_ERROR); - bp->error = VNOVNODE; - bp->dataVersion = CM_BUF_VERSION_BAD; /* bad */ - bp->dirtyCounter++; - if (bp->flags & CM_BUF_WAITING) { - osi_Log2(buf_logp, "BUF CleanDirtyBuffers Waking [scp 0x%x] bp 0x%x", scp, bp); - osi_Wakeup((long) &bp); - } - lock_ReleaseMutex(&bp->mx); - buf_Release(bp); - buf_DecrementUsedCount(); - } - } - return 0; -} -#endif - /* * The following routines will not be used on a * regular basis but are very useful in a variety diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index d6bfdfcbdc..2a3f032e26 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -881,17 +881,6 @@ void cm_DaemonShutdown(void) if (cm_LockDaemon_ShutdownEvent) code = thrd_WaitForSingleObject_Event(cm_LockDaemon_ShutdownEvent, INFINITE); - -#if 0 - /* - * Do not waste precious time waiting for the ipaddr daemon to shutdown. - * When it does it means we have lost our network connection and we need - * it during cache shutdown in order to notify the file servers that this - * client is giving up all callbacks. - */ - if (cm_IPAddrDaemon_ShutdownEvent) - code = thrd_WaitForSingleObject_Event(cm_IPAddrDaemon_ShutdownEvent, INFINITE); -#endif } void cm_InitDaemon(int nDaemons) diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index 5322479d82..ba4530fc8d 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -2526,151 +2526,6 @@ cm_UsernameToId(char *uname, cm_ucell_t * ucellp, afs_uint32* uid) } #endif /* QUERY_AFSID */ -#if 0 -/* This has been copied to smb_IoctlSetToken in its entirety. - * An equivalent version will need to be produced for the - * redirector and some extensive refactoring might be required. - */ -afs_int32 -cm_IoctlSetToken(struct cm_ioctl *ioctlp, struct cm_user *userp) -{ - char *saveDataPtr; - char *tp; - int ticketLen; - char *ticket; - int ctSize; - struct ClearToken ct; - cm_cell_t *cellp; - cm_ucell_t *ucellp; - char *uname = NULL; - afs_uuid_t uuid; - int flags; - char sessionKey[8]; - char *smbname; - int release_userp = 0; - char * wdir = NULL; - - saveDataPtr = ioctlp->inDatap; - - cm_SkipIoctlPath(ioctlp); - - tp = ioctlp->inDatap; - - /* ticket length */ - memcpy(&ticketLen, tp, sizeof(ticketLen)); - tp += sizeof(ticketLen); - if (ticketLen < MINKTCTICKETLEN || ticketLen > MAXKTCTICKETLEN) - return CM_ERROR_INVAL; - - /* remember ticket and skip over it for now */ - ticket = tp; - tp += ticketLen; - - /* clear token size */ - memcpy(&ctSize, tp, sizeof(ctSize)); - tp += sizeof(ctSize); - if (ctSize != sizeof(struct ClearToken)) - return CM_ERROR_INVAL; - - /* clear token */ - memcpy(&ct, tp, ctSize); - tp += ctSize; - if (ct.AuthHandle == -1) - ct.AuthHandle = 999; /* more rxvab compat stuff */ - - /* more stuff, if any */ - if (ioctlp->inCopied > tp - saveDataPtr) { - /* flags: logon flag */ - memcpy(&flags, tp, sizeof(int)); - tp += sizeof(int); - - /* cell name */ - cellp = cm_GetCell(tp, CM_FLAG_CREATE | CM_FLAG_NOPROBE); - if (!cellp) - return CM_ERROR_NOSUCHCELL; - tp += strlen(tp) + 1; - - /* user name */ - uname = tp; - tp += strlen(tp) + 1; - - if (flags & PIOCTL_LOGON) { - /* SMB user name with which to associate tokens */ - smbname = tp; - osi_Log2(smb_logp,"cm_IoctlSetToken for user [%s] smbname [%s]", - osi_LogSaveString(smb_logp,uname), osi_LogSaveString(smb_logp,smbname)); - fprintf(stderr, "SMB name = %s\n", smbname); - tp += strlen(tp) + 1; - } else { - osi_Log1(smb_logp,"cm_IoctlSetToken for user [%s]", - osi_LogSaveString(smb_logp, uname)); - } - - /* uuid */ - memcpy(&uuid, tp, sizeof(uuid)); - if (!cm_FindTokenEvent(uuid, sessionKey)) - return CM_ERROR_INVAL; - } else { - cellp = cm_data.rootCellp; - osi_Log0(smb_logp,"cm_IoctlSetToken - no name specified"); - } - - if (flags & PIOCTL_LOGON) { - clientchar_t *cname; - - cname = cm_FsStringToClientStringAlloc(smbname, -1, NULL); - - userp = smb_FindCMUserByName(cname, ioctlp->fidp->vcp->rname, - SMB_FLAG_CREATE|SMB_FLAG_AFSLOGON); - if (cname) - free(cname); - release_userp = 1; - } - - /* store the token */ - lock_ObtainMutex(&userp->mx); - ucellp = cm_GetUCell(userp, cellp); - osi_Log1(smb_logp,"cm_IoctlSetToken ucellp %lx", ucellp); - ucellp->ticketLen = ticketLen; - if (ucellp->ticketp) - free(ucellp->ticketp); /* Discard old token if any */ - ucellp->ticketp = malloc(ticketLen); - memcpy(ucellp->ticketp, ticket, ticketLen); - /* - * Get the session key from the RPC, rather than from the pioctl. - */ - /* - memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey)); - */ - memcpy(ucellp->sessionKey.data, sessionKey, sizeof(sessionKey)); - ucellp->kvno = ct.AuthHandle; - ucellp->expirationTime = ct.EndTimestamp; - ucellp->gen++; -#ifdef QUERY_AFSID - ucellp->uid = ANONYMOUSID; -#endif - if (uname) { - StringCbCopyA(ucellp->userName, MAXKTCNAMELEN, uname); -#ifdef QUERY_AFSID - cm_UsernameToId(uname, ucellp, &ucellp->uid); -#endif - } - _InterlockedOr(&ucellp->flags, CM_UCELLFLAG_RXKAD); - lock_ReleaseMutex(&userp->mx); - - if (flags & PIOCTL_LOGON) { - ioctlp->flags |= CM_IOCTLFLAG_LOGON; - } - - cm_ResetACLCache(cellp, userp); - - if (release_userp) - cm_ReleaseUser(userp); - - return 0; -} -#endif - /* * VIOC_GETTOK internals. * diff --git a/src/WINNT/afsd/cm_nls.c b/src/WINNT/afsd/cm_nls.c index 9b70b727b6..06b81f780f 100644 --- a/src/WINNT/afsd/cm_nls.c +++ b/src/WINNT/afsd/cm_nls.c @@ -1309,23 +1309,6 @@ int cm_stricmp_utf8(const char * str1, const char * str2) } } -#if 0 -wchar_t * strupr_utf16(wchar_t * wstr, size_t cbstr) -{ - wchar_t wstrd[NLSMAXCCH]; - int len; - - if (!nls_init) - cm_InitNormalization(); - - len = cbstr / sizeof(wchar_t); - len = LCMapStringW(nls_lcid, LCMAP_UPPERCASE, wstr, len, wstrd, NLSMAXCCH); - StringCbCopyW(wstr, cbstr, wstrd); - - return wstr; -} -#endif - char * strupr_utf8(char * str, size_t cbstr) { wchar_t wstr[NLSMAXCCH]; diff --git a/src/WINNT/afsd/cm_nls.h b/src/WINNT/afsd/cm_nls.h index 403047abc4..4d6591400b 100644 --- a/src/WINNT/afsd/cm_nls.h +++ b/src/WINNT/afsd/cm_nls.h @@ -274,18 +274,5 @@ cm_is_valid_utf16(__in_z const wchar_t * c, int cch); wchar_t * cm_GetRawCharsAlloc(const wchar_t * c, int len); #endif -#if 0 - -extern long cm_NormalizeUtf16StringToUtf8(const wchar_t * src, int cch_src, - char * adest, int cch_adest); - -extern char * char_next_utf8(const char * c); - -extern char * char_prev_utf8(const char * c); - -extern char * strupr_utf8(char * str, size_t cbstr); - -#endif - #define lengthof(a) (sizeof(a)/sizeof(a[0])) #endif diff --git a/src/WINNT/afsd/cm_performance.c b/src/WINNT/afsd/cm_performance.c index 41343e534e..4a25c4adef 100644 --- a/src/WINNT/afsd/cm_performance.c +++ b/src/WINNT/afsd/cm_performance.c @@ -118,24 +118,6 @@ void cm_PerformanceAddSCache(cm_scache_t *scp) } lock_ReleaseRead(&scp->rw); -#if 0 - if (statp->fid.vnode == 1) { - cm_volume_t *volp = NULL; - cm_cell_t *cellp = NULL; - cm_req_t req; - - cm_InitReq(&req); - - cellp = cm_FindCellByID(statp->fid.cell, 0); - if (cellp) { - if (!cm_FindVolumeByID(cellp, statp->fid.volume, cm_rootUserp, &req, 0, &volp)) { - statp->flags |= CM_FIDSTATS_HAVE_VOLUME; - cm_PutVolume(volp); - } - } - } -#endif - cm_PerformanceInsertToHashTable(statp); } diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 1c3edd6dfa..074a970450 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -1913,21 +1913,12 @@ long cm_AssembleLink(cm_scache_t *linkScp, fschar_t *pathSuffixp, StringCchCopyA(tsp->data,lengthof(tsp->data), linkp); code = CM_ERROR_PATH_NOT_COVERED; } else if (*linkp == '\\' || *linkp == '/') { -#if 0 - /* formerly, this was considered to be from the AFS root, - * but this seems to create problems. instead, we will just - * reject the link */ - StringCchCopyA(tsp->data,lengthof(tsp->data), linkp+1); - *newRootScpp = cm_RootSCachep(userp, reqp); - cm_HoldSCache(*newRootScpp); -#else /* we still copy the link data into the response so that * the user can see what the link points to */ linkScp->fileType = CM_SCACHETYPE_INVALID; StringCchCopyA(tsp->data,lengthof(tsp->data), linkp); code = CM_ERROR_NOSUCHPATH; -#endif } else { /* a relative link */ StringCchCopyA(tsp->data,lengthof(tsp->data), linkp); @@ -4740,20 +4731,6 @@ long cm_IntSetLock(cm_scache_t * scp, cm_user_t * userp, int lockType, osi_Log2(afsd_logp, "CALL SetLock scp 0x%p for lock %d", scp, lockType); -#if 0 - /* - * The file server prior to 1.6.2 does not report an accurate value - * and callbacks are not issued if the lock is dropped due to expiration. - */ - if ((lockType != LOCKING_ANDX_SHARED_LOCK && scp->fsLockCount != 0) || - (lockType == LOCKING_ANDX_SHARED_LOCK && scp->fsLockCount < 0)) - { - code = CM_ERROR_LOCK_NOT_GRANTED; - osi_Log2(afsd_logp, "CALL SetLock FAILURE, fsLockCount %d code 0x%x", scp->fsLockCount, code); - return code; - } -#endif - memset(&volSync, 0, sizeof(volSync)); tfid.Volume = scp->fid.volume; diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index f77033d029..a7f0722cc3 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -3049,10 +3049,6 @@ GetCellCmd(struct cmd_syndesc *as, void *arock) continue; } printf("Cell %s status: ", info.name); -#ifdef notdef - if (args.stat & 1) - printf("primary "); -#endif if (args.stat & 2) printf("no setuid allowed"); else @@ -5251,9 +5247,6 @@ int wmain(int argc, wchar_t **wargv) ts = cmd_CreateSyntax("setvol", SetVolCmd, NULL, 0, "set volume status"); cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path"); cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_OPTIONAL, "disk space quota in 1K units"); -#ifdef notdef - cmd_AddParm(ts, "-min", CMD_SINGLE, CMD_OPTIONAL, "disk space guaranteed"); -#endif cmd_AddParm(ts, "-motd", CMD_SINGLE, CMD_OPTIONAL, "message of the day"); cmd_AddParm(ts, "-offlinemsg", CMD_SINGLE, CMD_OPTIONAL, "offline message"); cmd_CreateAlias(ts, "sv"); @@ -5323,9 +5316,6 @@ int wmain(int argc, wchar_t **wargv) ts = cmd_CreateSyntax("setquota", SetQuotaCmd, NULL, 0, "set volume quota"); cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "dir/file path"); cmd_AddParm(ts, "-max", CMD_SINGLE, 0, "max quota in kbytes"); -#ifdef notdef - cmd_AddParm(ts, "-min", CMD_SINGLE, CMD_OPTIONAL, "min quota in kbytes"); -#endif cmd_CreateAlias(ts, "sq"); ts = cmd_CreateSyntax("newcell", NewCellCmd, NULL, 0, "configure new cell"); diff --git a/src/WINNT/afsd/krb.h b/src/WINNT/afsd/krb.h index 0065a94217..9ac508f9b6 100644 --- a/src/WINNT/afsd/krb.h +++ b/src/WINNT/afsd/krb.h @@ -157,69 +157,6 @@ typedef struct ktext KTEXT_ST; /* Error code returned by krb_mk_safe */ #define SAFE_PRIV_ERROR -1 /* syscall error */ -#if 0 -/* - * macros for byte swapping; also scratch space - * u_quad 0-->7, 1-->6, 2-->5, 3-->4, 4-->3, 5-->2, 6-->1, 7-->0 - * u_long 0-->3, 1-->2, 2-->1, 3-->0 - * u_short 0-->1, 1-->0 - */ - -#define swap_u_16(x) {\ - unsigned long _krb_swap_tmp[4];\ - swab(((char *) x) +0, ((char *) _krb_swap_tmp) +14 ,2); \ - swab(((char *) x) +2, ((char *) _krb_swap_tmp) +12 ,2); \ - swab(((char *) x) +4, ((char *) _krb_swap_tmp) +10 ,2); \ - swab(((char *) x) +6, ((char *) _krb_swap_tmp) +8 ,2); \ - swab(((char *) x) +8, ((char *) _krb_swap_tmp) +6 ,2); \ - swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \ - swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \ - swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \ - memcpy((char *)x, (char *)_krb_swap_tmp, 16);\ - } - -#define swap_u_12(x) {\ - unsigned long _krb_swap_tmp[4];\ - swab(( char *) x, ((char *) _krb_swap_tmp) +10 ,2); \ - swab(((char *) x) +2, ((char *) _krb_swap_tmp) +8 ,2); \ - swab(((char *) x) +4, ((char *) _krb_swap_tmp) +6 ,2); \ - swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \ - swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \ - swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \ - memcpy((char *)x, (char *)_krb_swap_tmp, 12);\ - } - -#define swap_C_Block(x) {\ - unsigned long _krb_swap_tmp[4];\ - swab(( char *) x, ((char *) _krb_swap_tmp) +6 ,2); \ - swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \ - swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \ - swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \ - memcpy((char *)x, (char *)_krb_swap_tmp, 8);\ - } -#define swap_u_quad(x) {\ - unsigned long _krb_swap_tmp[4];\ - swab(( char *) &x, ((char *) _krb_swap_tmp) +6 ,2); \ - swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \ - swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \ - swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \ - memcpy((char *)&x, (char *)_krb_swap_tmp, 8);\ - } - -#define swap_u_long(x) {\ - unsigned long _krb_swap_tmp[4];\ - swab((char *) &x, ((char *) _krb_swap_tmp) +2 ,2); \ - swab(((char *) &x) +2,((char *) _krb_swap_tmp),2); \ - x = _krb_swap_tmp[0]; \ - } - -#define swap_u_short(x) {\ - unsigned short _krb_swap_sh_tmp; \ - swab((char *) &x, ( &_krb_swap_sh_tmp) ,2); \ - x = (unsigned short) _krb_swap_sh_tmp; \ - } -#endif /* 0 */ - #include "krb_prot.h" static send_to_kdc( diff --git a/src/WINNT/afsd/rpc_srvsvc.c b/src/WINNT/afsd/rpc_srvsvc.c index 2c8f462e40..aa262fea0c 100644 --- a/src/WINNT/afsd/rpc_srvsvc.c +++ b/src/WINNT/afsd/rpc_srvsvc.c @@ -1426,18 +1426,6 @@ void __RPC_USER SHARE_DEL_HANDLE_rundown( SHARE_DEL_HANDLE h) { } -#if 0 -/* [nocode] */ void Opnum3NotUsedOnWire( - /* [in] */ handle_t IDL_handle) -{ -} - -/* [nocode] */ void Opnum4NotUsedOnWire( - /* [in] */ handle_t IDL_handle) -{ -} -#endif - /* [nocode] */ void Opnum5NotUsedOnWire( /* [in] */ handle_t IDL_handle) { diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index c1adc591c0..22b9d43018 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -3908,13 +3908,7 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) } lock_ObtainMutex(&vcp->mx); -#if 0 - if (VistaProtoIndex != -1) { - protoIndex = VistaProtoIndex; - vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3); - } else -#endif - if (NTProtoIndex != -1) { + if (NTProtoIndex != -1) { protoIndex = NTProtoIndex; vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3); } @@ -9846,36 +9840,6 @@ void smb_Listener(void *parmp) lock_ReleaseMutex(&smb_StartedLock); break; } -#if 0 - else if (code != 0) { - char tbuffer[AFSPATHMAX]; - - /* terminate silently if shutdown flag is set */ - while (!lock_TryMutex(&smb_StartedLock)) { - if (smb_ListenerState == SMB_LISTENER_STOPPED || smbShutdownFlag == 1) - goto exit_thread; - Sleep(50); - } - - osi_Log3(smb_logp, - "NCBLISTEN lana=%d failed with code %d [%s]", - ncbp->ncb_lana_num, code, ncb_error_string(code)); - osi_Log0(smb_logp, - "Client exiting due to network failure. Please restart client.\n"); - - sprintf(tbuffer, - "Client exiting due to network failure. Please restart client.\n" - "NCBLISTEN lana=%d failed with code %d [%s]", - ncbp->ncb_lana_num, code, ncb_error_string(code)); - if (showErrors) - code = (*smb_MBfunc)(NULL, tbuffer, "AFS Client Service: Fatal Error", - MB_OK|MB_SERVICE_NOTIFICATION); - osi_panic(tbuffer, __FILE__, __LINE__); - - lock_ReleaseMutex(&smb_StartedLock); - break; - } -#endif /* 0 */ /* a successful packet received. clear bridge error count */ bridgeCount = 0; diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 290b1e7158..d461f85157 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -3766,10 +3766,6 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t /* TRANS2_SET_PATH_INFORMATION */ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *opx) { -#if 0 - osi_Log0(smb_logp,"ReceiveTran2SetPathInfo - NOT_SUPPORTED"); - return CM_ERROR_BADOP; -#else long code = 0; unsigned short infoLevel; clientchar_t * pathp; @@ -3968,7 +3964,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet smb_FreeTran2Packet(outp); return 0; -#endif } /* TRANS2_QUERY_FILE_INFORMATION */ diff --git a/src/WINNT/afsrdr/kernel/lib/AFSInit.cpp b/src/WINNT/afsrdr/kernel/lib/AFSInit.cpp index f25f5d556c..3eb45b8124 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSInit.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSInit.cpp @@ -122,32 +122,6 @@ DriverEntry( PDRIVER_OBJECT DriverObject, RtlGetVersion( &AFSRtlSysVersion); -#if 0 - // - // By not fetching the RtlSetSaclSecurityDescriptor function - // pointer it disables the additional of a mandatory label - // to the default acl which is returned by AFSRedir for all - // security information queries. The addition of the - // mandatory label appears to have a negative consequence - // for roaming profiles and redirected folders. All links - // become untrusted and IE9 is unable to open a new instance - // to a non-default home page. - // - // - // Only retrieve this function for Vista and above since - // Mandatory Labels only exist on those operating systems. - // - - if( AFSRtlSysVersion.dwMajorVersion >= 6) - { - RtlInitUnicodeString( &uniRoutine, - L"RtlSetSaclSecurityDescriptor"); - - AFSRtlSetSaclSecurityDescriptor = (PAFSRtlSetSaclSecurityDescriptor)MmGetSystemRoutineAddress( &uniRoutine); - } - -#endif - RtlInitUnicodeString( &uniRoutine, L"RtlSetGroupSecurityDescriptor"); diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index 940deda7e4..cffb9b58c6 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -4091,24 +4091,6 @@ RDR_RequestFileExtentsAsync( IN cm_user_t *userp, bHaveBuffer = TRUE; } else if (bufp->flags & CM_BUF_DIRTY) { bHaveBuffer = FALSE; -#if 0 - code = buf_CleanAsyncLocked(scp, bufp, &req, 0, NULL); - switch (code) { - case 0: - bHaveBuffer = TRUE; - break; - case CM_ERROR_RETRY: - /* Couldn't flush it, obtain it asynchronously so we don't block the thread. */ - bHaveBuffer = FALSE; - code = 0; - break; - default: - smb_MapNTError(cm_MapRPCError(code, &req), &status, TRUE); - RDR_SetFileStatus(&FileId, &userp->authgroup, status); - bHaveBuffer = FALSE; - code = 0; - } -#endif } else { osi_hyper_t minLength; /* effective end of file */ diff --git a/src/WINNT/client_config/config.cpp b/src/WINNT/client_config/config.cpp index c6d1938a28..8d064a99dc 100644 --- a/src/WINNT/client_config/config.cpp +++ b/src/WINNT/client_config/config.cpp @@ -217,134 +217,6 @@ BOOL Config_SetCellName (LPCTSTR pszName, ULONG *pStatus) return TRUE; } -#if 0 -/* These two functions are not needed as of the 1.2.2a updates. - The old implementation used to 'bind' afslogon.dll to the credentials manager - when the Integrated Logon was selected. - - With version 1.2.2a afslogon.dll is always 'bound' to the credentials manager; therefore, - the binding operation is done during installation. Note: the Integrated Logon is - selected by an entry in the registry (LogonOptions). -*/ -void Config_GetAuthentFlag (BOOL *pfFlag) -{ - *pfFlag = FALSE; - - HKEY hk; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Control\\NetworkProvider\\Order"), 0, KEY_QUERY_VALUE, &hk) == ERROR_SUCCESS) - { - if (g.fIsWinNT) - { - TCHAR szProviders[ MAX_PATH ] = TEXT(""); - DWORD dwSize = sizeof(szProviders); - - if (RegQueryValueEx (hk, TEXT("ProviderOrder"), NULL, NULL, (PBYTE)szProviders, &dwSize) == ERROR_SUCCESS) - { - for (LPTSTR pch = szProviders; *pch; ) - { - if (!lstrncmpi (pch, TEXT("TransarcAFSDaemon"), lstrlen(TEXT("TransarcAFSDaemon")))) - *pfFlag = TRUE; - - for ( ; *pch && (*pch != TEXT(',')); ++pch) - ; - for ( ; *pch == TEXT(','); ++pch) - ; - } - } - - RegCloseKey (hk); - } - else // (!g.fIsWinNT) - { - TCHAR szLHS[ MAX_PATH ] = TEXT(""); - DWORD dwSize = sizeof(szLHS); - - if (RegQueryValueEx (hk, TEXT("TransarcAFSDaemon"), NULL, NULL, (PBYTE)szLHS, &dwSize) == ERROR_SUCCESS) - *pfFlag = TRUE; - } - } -} - - -BOOL Config_SetAuthentFlag (BOOL fFlag, ULONG *pStatus) -{ - ULONG status = 0; - BOOL rc = FALSE; - - HKEY hk; - DWORD dwDisp; - if ((status = RegCreateKeyEx (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Control\\NetworkProvider\\Order"), 0, TEXT("container"), 0, KEY_QUERY_VALUE | KEY_SET_VALUE, NULL, &hk, &dwDisp)) == ERROR_SUCCESS) - { - if (g.fIsWinNT) - { - TCHAR szOldProviders[ MAX_PATH ] = TEXT(""); - TCHAR szNewProviders[ MAX_PATH ] = TEXT(""); - DWORD dwSize = sizeof(szOldProviders); - RegQueryValueEx (hk, TEXT("ProviderOrder"), NULL, NULL, (PBYTE)szOldProviders, &dwSize); - - for (LPTSTR pch = szOldProviders; *pch; ) - { - BOOL fCopy = TRUE; - if (!lstrncmpi (pch, TEXT("TransarcAFSDaemon"), lstrlen(TEXT("TransarcAFSDaemon")))) - { - fCopy = fFlag; - fFlag = FALSE; - } - - if (fCopy) - { - LPTSTR pchOut = &szNewProviders[ lstrlen(szNewProviders) ]; - if (szNewProviders[0]) - *pchOut++ = TEXT(','); - for ( ; *pch && (*pch != TEXT(',')); ) - *pchOut++ = *pch++; - *pchOut = TEXT('\0'); - } - - for ( ; *pch && (*pch != TEXT(',')); ++pch) - ; - for ( ; *pch == TEXT(','); ++pch) - ; - } - - if (fFlag) - { - if (szNewProviders[0]) - lstrcat (szNewProviders, TEXT(",")); - lstrcat (szNewProviders, TEXT("TransarcAFSDaemon")); - } - - if ((status = RegSetValueEx (hk, TEXT("ProviderOrder"), NULL, REG_SZ, (PBYTE)szNewProviders, sizeof(TCHAR)*(1+lstrlen(szNewProviders)))) == ERROR_SUCCESS) - rc = TRUE; - } - else // (!g.fIsWinNT) - { - TCHAR szLHS[ cchRESOURCE ] = TEXT("TransarcAFSDaemon"); - TCHAR szRHS[ cchRESOURCE ] = TEXT(""); - - if (fFlag) - { - if ((status = RegSetValueEx (hk, szLHS, NULL, REG_SZ, (PBYTE)szRHS, sizeof(TCHAR)*(lstrlen(szRHS)+1))) == 0) - rc = TRUE; - } - else - { - RegDeleteValue (hk, szLHS); - rc = TRUE; - } - } - - RegCloseKey (hk); - } - - if (pStatus && !rc) - *pStatus = status; - if (!rc) - Message (MB_ICONHAND, GetErrorTitle(), IDS_FAILCONFIG_AUTHENT, TEXT("%ld"), status); - return rc; -} -#endif - void Config_GetTrayIconFlag (BOOL *pfFlag) { if (!Config_ReadUserNum (TEXT("ShowTrayIcon"), (DWORD*)pfFlag)) diff --git a/src/WINNT/client_config/drivemap.cpp b/src/WINNT/client_config/drivemap.cpp index cb9a9a21a1..30f86a3cf7 100644 --- a/src/WINNT/client_config/drivemap.cpp +++ b/src/WINNT/client_config/drivemap.cpp @@ -198,30 +198,6 @@ static void FreeStringMemory (LPTSTR pszString) Free (pszString); } -#if 0 -static int lstrncmpi (LPCTSTR pszA, LPCTSTR pszB, size_t cch) -{ - if (!pszA || !pszB) - { - return (!pszB) - (!pszA); // A,!B:1, !A,B:-1, !A,!B:0 - } - - for ( ; cch > 0; cch--, pszA = CharNext(pszA), pszB = CharNext(pszB)) - { - TCHAR chA = toupper( *pszA ); - TCHAR chB = toupper( *pszB ); - - if (!chA || !chB) - return (!chB) - (!chA); // A,!B:1, !A,B:-1, !A,!B:0 - - if (chA != chB) - return (int)(chA) - (int)(chB); // -1:AB - } - - return 0; // no differences before told to stop comparing, so A==B -} -#endif - /* * REALLOC ____________________________________________________________________ * diff --git a/src/WINNT/client_config/tab_hosts.cpp b/src/WINNT/client_config/tab_hosts.cpp index a6c6a98f39..40cb578da4 100644 --- a/src/WINNT/client_config/tab_hosts.cpp +++ b/src/WINNT/client_config/tab_hosts.cpp @@ -321,11 +321,6 @@ void HostsTab_FillList (HWND hDlg) TCHAR szText[ MAX_PATH ]; lstrcpy (szText, Info.szCell); -#if 0 // Add this if you like a more verbose Cell Hosts tab - if (Info.szComment) - wsprintf (&szText[ lstrlen(szText) ], TEXT(" (%s)"), Info.szComment); -#endif - FASTLISTADDITEM ai; memset (&ai, 0x00, sizeof(ai)); ai.iFirstImage = IMAGE_NOIMAGE; diff --git a/src/WINNT/client_osi/osidb.c b/src/WINNT/client_osi/osidb.c index 98adc044dd..ec349e74cb 100644 --- a/src/WINNT/client_osi/osidb.c +++ b/src/WINNT/client_osi/osidb.c @@ -107,36 +107,6 @@ void dbrpc_Close(handle_t handle, osi_remHyper_t *fnp, long *codep) *codep = OSI_DBRPC_NOFD; } -#ifdef notdef -long osi_CleanupRPCEntry(char *exportName) -{ - UUID_VECTOR uuidvp; - RPC_NS_HANDLE thandle; - UUID tuuid; - long code; - - code = RpcNsEntryObjectInqBegin(RPC_C_NS_SYNTAX_DCE, exportName, &thandle); - if (code != RPC_S_OK && code != RPC_S_ENTRY_NOT_FOUND) return code; - while(1) { - code = RpcNsEntryObjectInqNext(thandle, &tuuid); - if (code == RPC_S_NO_MORE_MEMBERS) { - code = 0; - break; - } - else if (code != RPC_S_OK) { - break; - } - uuidvp.Count = 1; - uuidvp.Uuid[0] = &tuuid; - code = RpcNsBindingUnexport(RPC_C_NS_SYNTAX_DCE, exportName, dbrpc_v1_0_s_ifspec, - &uuidvp); - if (code != RPC_S_OK && code != RPC_S_INTERFACE_NOT_FOUND) break; - } - RpcNsEntryObjectInqDone(&thandle); - return code; -} -#endif /* notdef */ - long osi_InitDebug(osi_uid_t *exportIDp) { RPC_STATUS rpcStatus; @@ -174,22 +144,10 @@ long osi_InitDebug(osi_uid_t *exportIDp) uuidVector.Count = 1; uuidVector.Uuid[0] = exportIDp; -#ifdef notdef - /* don't use CDS any longer; too big and slow */ - rpcStatus = osi_CleanupRPCEntry(exportName); - if (rpcStatus) goto done; -#endif /* notdef */ - rpcStatus = RpcEpRegister(dbrpc_v1_0_s_ifspec, bindingVector, &uuidVector, (unsigned char *) 0); if (rpcStatus != RPC_S_OK) goto done; -#ifdef notdef - /* don't use CDS */ - rpcStatus = RpcNsBindingExport(RPC_C_NS_SYNTAX_DCE, exportName, - dbrpc_v1_0_s_ifspec, bindingVector, &uuidVector); -#endif /* notdef */ - rpcStatus = RpcBindingVectorFree(&bindingVector); if (rpcStatus != RPC_S_OK) goto done; diff --git a/src/WINNT/client_osi/osidebug.c b/src/WINNT/client_osi/osidebug.c index 244ed2e915..2cb72b2902 100644 --- a/src/WINNT/client_osi/osidebug.c +++ b/src/WINNT/client_osi/osidebug.c @@ -321,63 +321,6 @@ main_formatCache_t *main_GetFormatCache(RPC_BINDING_HANDLE handle, char *typep, else return NULL; } -#ifdef notdef -/* take a name and return a working binding to the server. Server must be - * exporting a dbrpc interface. - */ -main_GetBinding(char *name, RPC_BINDING_HANDLE *handlep) -{ - RPC_NS_HANDLE tempContext; /* context used for iteration */ - RPC_BINDING_HANDLE thp; /* temp handle we're using now */ - long code; - int count=0; - int valid; - - code = RpcNsBindingImportBegin(RPC_C_NS_SYNTAX_DCE, name, *dbrpc_v1_0_c_ifspecp, - (UUID *) 0, &tempContext); - if (code != RPC_S_OK) return code; - - /* this next line is useful when trying to debug things */ - // RpcNsMgmtHandleSetExpAge(tempContext, 0); - - valid = 0; /* is thp valid? */ - while (1) { - code = RpcNsBindingImportNext(tempContext, &thp); - if (code == RPC_S_NO_MORE_BINDINGS) break; /* we're done */ - - if (code != RPC_S_OK) { - RpcNsBindingImportDone(&tempContext); - return code; - } - - /* otherwise we have a putatively good binding; try it out - * with the probe interface and see if it really works - */ - code = RpcMgmtSetComTimeout(thp, 2); - - code = 0; - RpcTryExcept { - dbrpc_Ping(thp); - } - RpcExcept(1) { - code = RpcExceptionCode(); - } - RpcEndExcept; - - /* now, if call worked, we're done */ - if (code == 0) break; - - /* else cleanup the binding and try again */ - RpcBindingFree(&thp); - } - - /* cleanup and return */ - RpcNsBindingImportDone(&tempContext); - *handlep = thp; - return code; -} -#endif /* notdef */ - main_GetBinding(char *hostNamep, UUID *exportIDp, RPC_BINDING_HANDLE *handlep) { char *stringBindingp; diff --git a/src/WINNT/install/loopback/wmi.cpp b/src/WINNT/install/loopback/wmi.cpp index baf00998f7..79793fe9b5 100644 --- a/src/WINNT/install/loopback/wmi.cpp +++ b/src/WINNT/install/loopback/wmi.cpp @@ -361,20 +361,6 @@ WMIEnableStatic( ReportMessage(0,"Found Adapter Instance",NULL, InstancePath,0); -#if 0 - // Use the adapter instance index to set MAXLANA in the registry. - { - DWORD dwIndex; - if (swscanf(InstancePath, L"Win32_NetworkAdapterConfiguration.Index=%u", &dwIndex)==1) - { - DWORD ret = 0; - ReportMessage(1,"Setting MAXLANA",NULL,NULL,dwIndex+1); - ret = AdjustMaxLana(dwIndex+1); - if (ret) ReportMessage(0,"AdjustMaxLana returned the error code ",NULL,NULL,ret); - } - } -#endif - MethodName = SysAllocString(L"EnableStatic"); CLEANUP_ON_AND_SET(!MethodName, hr, E_OUTOFMEMORY); @@ -955,25 +941,6 @@ BOOL UpdateHostsFile( LPCWSTR swName, LPCWSTR swIp, LPCSTR szFilename, BOOL bPre } #ifdef TEST -#if 0 -int -wmain( - int argc, - wchar_t* argv[] - ) -{ - if (argc < 3) - { - printf("usage: %S ip mask\n" - " example: %S 10.0.0.1 255.0.0.0", argv[0], argv[0]); - return 0; - } - - return WMIEnableStatic(FindNetworkAdapterConfigurationInstanceByGUID, - L"{B4981E32-551C-4164-96B6-B8874BD2E555}", - argv[1], argv[2]); -} -#else int wmain( int argc, @@ -992,5 +959,4 @@ wmain( argv[1], argv[2], argv[3]); } #endif -#endif diff --git a/src/WINNT/kfw/inc/krb4/conf.h b/src/WINNT/kfw/inc/krb4/conf.h index 2e2a84cd6e..fca3ee0e87 100644 --- a/src/WINNT/kfw/inc/krb4/conf.h +++ b/src/WINNT/kfw/inc/krb4/conf.h @@ -47,11 +47,6 @@ typedef void *pointer; #endif #endif -/* Does your compiler understand "void"? */ -#ifdef notdef -#define void int -#endif - /* * A few checks to see that necessary definitions are included. */ diff --git a/src/WINNT/kfw/inc/krb4/krb.h b/src/WINNT/kfw/inc/krb4/krb.h index 37431fbdbc..59134da14b 100644 --- a/src/WINNT/kfw/inc/krb4/krb.h +++ b/src/WINNT/kfw/inc/krb4/krb.h @@ -43,15 +43,6 @@ typedef unsigned short gid_t; * the realm. */ -#ifdef notdef -/* this is server - only, does not belong here; */ -#define KRBLOG "/kerberos/kerberos.log" -/* are these used anyplace? */ -#define VX_KRB_HSTFILE "/etc/krbhst" -#define PC_KRB_HSTFILE "\\kerberos\\krbhst" -#endif - -#ifdef PC #define KRB_CONF "krb.con" #define KRB_RLM_TRANS "krbrealm.con" diff --git a/src/WINNT/kfw/inc/krb5/krb5/krb5.h b/src/WINNT/kfw/inc/krb5/krb5/krb5.h index 29dc7643ed..23b80b8c90 100644 --- a/src/WINNT/kfw/inc/krb5/krb5/krb5.h +++ b/src/WINNT/kfw/inc/krb5/krb5/krb5.h @@ -859,9 +859,6 @@ krb5_error_code krb5_decrypt_data #define KRB5_PADATA_TGS_REQ KRB5_PADATA_AP_REQ #define KRB5_PADATA_ENC_TIMESTAMP 2 #define KRB5_PADATA_PW_SALT 3 -#if 0 /* Not used */ -#define KRB5_PADATA_ENC_ENCKEY 4 /* Key encrypted within itself */ -#endif #define KRB5_PADATA_ENC_UNIX_TIME 5 /* timestamp encrypted in key */ #define KRB5_PADATA_ENC_SANDIA_SECURID 6 /* SecurId passcode */ #define KRB5_PADATA_SESAME 7 /* Sesame project */ diff --git a/src/WINNT/kfw/inc/krbcc/cacheapi.h b/src/WINNT/kfw/inc/krbcc/cacheapi.h index d274ecf7dc..1e706a2094 100644 --- a/src/WINNT/kfw/inc/krbcc/cacheapi.h +++ b/src/WINNT/kfw/inc/krbcc/cacheapi.h @@ -104,21 +104,6 @@ typedef struct opaque_dll_control_block_type* apiCB; typedef struct opaque_ccache_pointer_type* ccache_p; typedef struct opaque_credential_iterator_type* ccache_cit; -#if 0 -enum _cc_data_type { - type_ticket = 0, /* 0 for ticket, second_ticket */ - /* Ted's draft spec says these are to be - "as defined in the Kerberos V5 protocol" - all I can find are typdefs, - can't find an enumerated type or #define - */ - type_address, /* = <"as defined in the Kerberos V5 protocol"> */ - type_authdata, /* = <"as defined in the Kerberos V5 protocol"> */ - type_encryption, /* = <"as defined in the Kerberos V5 protocol"> */ - cc_data_type_max /* for validation */ -}; -#endif - typedef struct _cc_data { cc_uint32 type; // should be one of _cc_data_type diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h index 4c9c3f25e2..5944585cee 100644 --- a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h @@ -107,28 +107,6 @@ TYPEDEF_FUNC( (krb5_context, krb5_ap_rep * ) ); -/* Removed around the time of krb5_rc_* change... */ -#if 0 -TYPEDEF_FUNC( - void, - KRB5_CALLCONV, - krb5_free_safe, - (krb5_context, krb5_safe * ) - ); -TYPEDEF_FUNC( - void, - KRB5_CALLCONV, - krb5_free_priv, - (krb5_context, krb5_priv * ) - ); -TYPEDEF_FUNC( - void, - KRB5_CALLCONV, - krb5_free_priv_enc_part, - (krb5_context, krb5_priv_enc_part * ) - ); -#endif - TYPEDEF_FUNC( void, KRB5_CALLCONV, diff --git a/src/WINNT/kfw/inc/netidmgr/khmsgtypes.h b/src/WINNT/kfw/inc/netidmgr/khmsgtypes.h index 5f99ab98d9..e5922e8c7f 100644 --- a/src/WINNT/kfw/inc/netidmgr/khmsgtypes.h +++ b/src/WINNT/kfw/inc/netidmgr/khmsgtypes.h @@ -462,14 +462,6 @@ */ #define KMSG_CRED_DESTROY_CREDS 32 -#if 0 -/*! \brief Parse an identity - - \note May be sent to individual credential subscriptions. - */ -#define KMSG_CRED_IDENT_PARSE 65 -#endif - /*! \brief A property page is being launced Message parameters: diff --git a/src/WINNT/netidmgr_plugin/afsfuncs.c b/src/WINNT/netidmgr_plugin/afsfuncs.c index db9b72550b..3439a6756f 100644 --- a/src/WINNT/netidmgr_plugin/afsfuncs.c +++ b/src/WINNT/netidmgr_plugin/afsfuncs.c @@ -369,36 +369,6 @@ afs_list_tokens_internal(void) continue; } -#if 0 - /* failed attempt at trying to figure out the principal name from - the token. The ticket that is attached to the token is not - in a form that is useful at this point */ - idname[0] = L'\0'; - if(atoken.kvno == RXKAD_TKT_TYPE_KERBEROS_V5) { - krb5_context ctx = 0; - krb5_ccache cc = 0; - krb5_creds * k5c; - krb5_error_code code; - char * princ; - - code = khm_krb5_initialize(&ctx, &cc); - if(code) - goto _no_krb5; - - k5c = (krb5_creds *) atoken.ticket; - - code = krb5_unparse_name(ctx, k5c->client, &princ); - if(code) - goto _no_krb5; - - MultiByteToWideChar(CP_ACP, 0, princ, strlen(princ), idname, sizeof(idname)/sizeof(idname[0])); - - krb5_free_unparsed_name(ctx, princ); -_no_krb5: - ; - } -#endif - method = AFS_TOKEN_AUTO; afs_princ_to_string(&aclient, idname, sizeof(idname)); diff --git a/src/WINNT/netidmgr_plugin/afsplugin.c b/src/WINNT/netidmgr_plugin/afsplugin.c index 87cd429a64..9ddb4df134 100644 --- a/src/WINNT/netidmgr_plugin/afsplugin.c +++ b/src/WINNT/netidmgr_plugin/afsplugin.c @@ -713,11 +713,6 @@ afs_msg_system(khm_int32 msg_subtype, if(afs_credtype_id >= 0) { kcdb_credtype_unregister(afs_credtype_id); } -#if 0 - if(afs_attr_client >= 0) { - kcdb_attrib_unregister(afs_attr_client); - } -#endif if(afs_attr_cell >= 0) { kcdb_attrib_unregister(afs_attr_cell); } @@ -772,12 +767,6 @@ afs_msg_kcdb(khm_int32 msg_subtype, { khm_int32 rv = KHM_ERROR_SUCCESS; - /* we don't really do anything with this yet */ -#if 0 - switch(msg_subtype) { - } -#endif - return rv; } diff --git a/src/WINNT/tests/largefiles/lftest.c b/src/WINNT/tests/largefiles/lftest.c index 4f63c8dc81..0ffcd0aa9b 100644 --- a/src/WINNT/tests/largefiles/lftest.c +++ b/src/WINNT/tests/largefiles/lftest.c @@ -48,12 +48,6 @@ int test_write(HANDLE hf, LARGE_INTEGER offset) { ret = -1; } -#if 0 - if (!FlushFileBuffers(hf)) { - fprintf(stderr, "Flush buffers fails at offset 0x%08x:%08x gle = 0x%08x\n", - offset.u.HighPart, offset.u.LowPart, GetLastError()); - } -#endif return ret; } diff --git a/src/WINNT/tests/torture/Source/WinTorture.c b/src/WINNT/tests/torture/Source/WinTorture.c index a8b27e194d..3493ad8da4 100644 --- a/src/WINNT/tests/torture/Source/WinTorture.c +++ b/src/WINNT/tests/torture/Source/WinTorture.c @@ -534,15 +534,7 @@ int main(int argc, char *argv[]) { #endif /* HAVE_HESOID */ strcpy(AfsLocker, Locker); -#if 0 - /* jaltman - this makes no sense. why strip off the server name and leave - * an absolute path on the local disk? - */ - if (!strnicmp(Locker, "\\\\afs\\", strlen("\\\\afs\\"))) - strcpy(TargetDirectory, &Locker[strlen("\\\\afs\\")]); - else -#endif - strcpy(TargetDirectory, Locker); + strcpy(TargetDirectory, Locker); #ifdef HAVE_HESOID } #endif /* HAVE_HESOID */ diff --git a/src/afs/AIX/osi_sleep.c b/src/afs/AIX/osi_sleep.c index ba95579129..37235468f1 100644 --- a/src/afs/AIX/osi_sleep.c +++ b/src/afs/AIX/osi_sleep.c @@ -20,11 +20,6 @@ static char waitV; static void AfsWaitHack(struct trb *trb) { -#if 0 -/* this gets called at interrupt context; let's not tempt fate... */ - AFS_STATCNT(WaitHack); -#endif - e_clear_wait(trb->func_data, THREAD_TIMED_OUT); } diff --git a/src/afs/AIX/osi_vnodeops.c b/src/afs/AIX/osi_vnodeops.c index d0cabe9c83..1722d355e2 100644 --- a/src/afs/AIX/osi_vnodeops.c +++ b/src/afs/AIX/osi_vnodeops.c @@ -1239,14 +1239,6 @@ afs_direct_rdwr(struct vnode *vp, goto fail; } - /* check for "file too big" error, which should really be done above us */ -#ifdef notdef - if (rw == UIO_WRITE && xfrSize + fileSize > get_ulimit()) { - code = EFBIG; - ReleaseReadLock(&vcp->lock); - goto fail; - } -#endif ReleaseReadLock(&vcp->lock); if (rw == UIO_WRITE) { ObtainWriteLock(&vcp->lock, 400); diff --git a/src/afs/DARWIN/osi_inode.c b/src/afs/DARWIN/osi_inode.c index e854a418ab..1ee2ef2132 100644 --- a/src/afs/DARWIN/osi_inode.c +++ b/src/afs/DARWIN/osi_inode.c @@ -139,10 +139,6 @@ getinode(fs, dev, inode, vpp, perror) #ifdef VFSTOHFS if (!strcmp(mp->mnt_vfc->vfc_name, "hfs")) { hmp = VFSTOHFS(mp); -#if 0 - if (hmp->hfs_mp == NULL) - break; -#endif if (hmp->hfs_raw_dev == dev) { fs = hmp->hfs_mp; } @@ -217,14 +213,7 @@ iforget(vp) if (vp->v_usecount == 1) { vp->v_usecount = 0; VOP_UNLOCK(vp, 0, current_proc()); -#if 0 - simple_lock(&vnode_free_list_slock); - TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist); - freevnodes++; - simple_unlock(&vnode_free_list_slock); -#else printf("iforget: leaking vnode\n"); -#endif } else { vput(vp); } diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index a4f01b3e16..49fe1599ac 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -88,11 +88,6 @@ enum vcexcl { EXCL, NONEXCL }; #define vput vnode_rele #define vref vnode_ref #define vattr vnode_attr -#if 0 -#define vn_lock(v, unused1, unused2) vnode_get((v)) -#define VOP_LOCK(v, unused1, unused2) vnode_get((v)) -#define VOP_UNLOCK(v, unused1, unused2) vnode_put((v)) -#endif #define va_size va_data_size #define va_atime va_access_time @@ -203,15 +198,6 @@ extern struct lock__bsd__ afs_global_lock; #define SPLVAR #define NETPRI #define USERPRI -#if 0 -#undef SPLVAR -#define SPLVAR int x -#undef NETPRI -#define NETPRI x=splnet() -#undef USERPRI -#define USERPRI splx(x) -#endif - #define AFS_APPL_UFS_CACHE 1 #define AFS_APPL_HFS_CACHE 2 #define AFS_APPL_APFS_CACHE 3 diff --git a/src/afs/DARWIN/osi_vfsops.c b/src/afs/DARWIN/osi_vfsops.c index 50ac15269b..3893f97e4b 100644 --- a/src/afs/DARWIN/osi_vfsops.c +++ b/src/afs/DARWIN/osi_vfsops.c @@ -357,9 +357,6 @@ afs_statfs(struct mount *mp, STATFS_TYPE *abp, CTX_TYPE ctx) abp->f_bsize = mp->vfs_bsize; abp->f_iosize = mp->vfs_bsize; #endif -#if 0 - abp->f_type = MOUNT_AFS; -#endif abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = abp->f_ffree = AFS_VFS_FAKEFREE; diff --git a/src/afs/DARWIN/osi_vm.c b/src/afs/DARWIN/osi_vm.c index f847037529..c2fdb9c707 100644 --- a/src/afs/DARWIN/osi_vm.c +++ b/src/afs/DARWIN/osi_vm.c @@ -37,12 +37,6 @@ osi_VM_FlushVCache(struct vcache *avc) if (!vp) return 0; AFS_GUNLOCK(); -#if 0 - if (!(UBCINFOMISSING(vp) || UBCINFORECLAIMED(vp))) { - size=ubc_getsize(vp); - kret=ubc_invalidate(vp,0,size); - } -#endif cache_purge(vp); AFS_GLOCK(); @@ -161,19 +155,6 @@ osi_VM_Truncate(struct vcache *avc, int alen, afs_ucred_t *acred) void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) { -#if 0 - void *object; - struct vcache *avc = VTOAFS(vp); - - offset = trunc_page(offset); - size = round_page(size + 1); - while (size) { - ubc_page_op(vp, (vm_offset_t) offset, - UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP, 0, 0); - size -= PAGE_SIZE; - offset += PAGE_SIZE; - } -#endif } int diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index a32ae29a5b..a3c222aec5 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -596,12 +596,6 @@ afs_vop_access(ap) bits |= PRSFS_INSERT; if (ap->a_action & KAUTH_VNODE_DELETE_CHILD) bits |= PRSFS_DELETE; -#if 0 /* I'd argue this should be enforced on the parent. But that's ugly */ - if (ap->a_action & KAUTH_VNODE_READ_ATTRIBUTES) - bits |= PRSFS_LOOKUP; - if (ap->a_action & KAUTH_VNODE_READ_SECURITY) /* mode bits/gid, not afs acl */ - bits |= PRSFS_LOOKUP; -#endif } else { if (ap->a_action & KAUTH_VNODE_READ_DATA) bits |= PRSFS_READ; @@ -622,12 +616,6 @@ afs_vop_access(ap) } if (ap->a_action & KAUTH_VNODE_WRITE_ATTRIBUTES) bits |= PRSFS_WRITE; -#if 0 /* no extended attributes */ - if (ap->a_action & KAUTH_VNODE_READ_EXTATTRIBUTES) - bits |= PRSFS_READ; - if (ap->a_action & KAUTH_VNODE_WRITE_EXTATTRIBUTES) - bits |= PRSFS_WRITE; -#endif if (ap->a_action & KAUTH_VNODE_WRITE_SECURITY) bits |= PRSFS_WRITE; /* we can't check for KAUTH_VNODE_TAKE_OWNERSHIP, so we always permit it */ @@ -2046,10 +2034,6 @@ afs_vop_bmap(ap) } if (ap->a_runp != NULL) *ap->a_runp = 0; -#ifdef notyet - if (ap->a_runb != NULL) - *ap->a_runb = 0; -#endif return 0; } @@ -2177,12 +2161,6 @@ afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, if (!(avc->f.states & CDeadVnode) && vnode_vtype(ovp) != VNON) { AFS_GUNLOCK(); -#if 0 /* unsupported */ - if (dvp && cnp) - vnode_update_identity(ovp, dvp, cnp->cn_nameptr, cnp->cn_namelen, - cnp->cn_hash, - VNODE_UPDATE_PARENT|VNODE_UPDATE_NAME); -#endif /* Can end up in reclaim... drop GLOCK */ vnode_rele(ovp); AFS_GLOCK(); diff --git a/src/afs/FBSD/osi_inode.c b/src/afs/FBSD/osi_inode.c index 7588c81ac3..8a89bab610 100644 --- a/src/afs/FBSD/osi_inode.c +++ b/src/afs/FBSD/osi_inode.c @@ -118,159 +118,6 @@ igetinode(vfsp, dev, inode, ipp, perror) return (0); } -#if 0 -/* - * icreate system call -- create an inode - */ -afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) - long *retval; - long dev, near_inode, param1, param2, param3, param4; -{ - int dummy, err = 0; - struct inode *ip, *newip; - int code; - struct vnode *vp; - - AFS_STATCNT(afs_syscall_icreate); - - if (!afs_suser(NULL)) - return (EPERM); - - code = getinode(0, (dev_t) dev, 2, &ip, &dummy); - if (code) { - return (ENOENT); - } - code = ialloc(ip, (ino_t) near_inode, 0, &newip); - iput(ip); - if (code) { - return (code); - } - IN_LOCK(newip); - newip->i_flag |= IACC | IUPD | ICHG; - - newip->i_nlink = 1; - - newip->i_mode = IFREG; - - IN_UNLOCK(newip); - vp = ITOV(newip); - VN_LOCK(vp); - vp->v_type = VREG; - VN_UNLOCK(vp); - - /* - * if ( !vp->v_object) - * { - * extern struct vfs_ubcops ufs_ubcops; - * extern struct vm_ubc_object* ubc_object_allocate(); - * struct vm_ubc_object* vop; - * vop = ubc_object_allocate(&vp, &ufs_ubcops, - * vp->v_mount->m_funnel); - * VN_LOCK(vp); - * vp->v_object = vop; - * VN_UNLOCK(vp); - * } - */ - - IN_LOCK(newip); - /* newip->i_flags |= IC_XUID|IC_XGID; */ - /* newip->i_flags &= ~IC_PROPLIST; */ - newip->i_vicep1 = param1; - if (param2 == 0x1fffffff /*INODESPECIAL*/) { - newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3)); - newip->i_vicep3a = (u_short) (param3 >> 16); - newip->i_vicep3b = (u_short) param3; - } else { - newip->i_vicep2 = - (((param2 >> 16) & 0x1f) << 27) + - (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff); - newip->i_vicep3a = (u_short) param4; - newip->i_vicep3b = (u_short) param2; - } - newip->i_vicemagic = VICEMAGIC; - - *retval = newip->i_number; - IN_UNLOCK(newip); - iput(newip); - return (code); -} - - -int -afs_syscall_iopen(dev, inode, usrmod, retval) - long *retval; - int dev, inode, usrmod; -{ - struct file *fp; - struct inode *ip; - struct vnode *vp = NULL; - int dummy; - int fd; - extern struct fileops vnops; - int code; - - AFS_STATCNT(afs_syscall_iopen); - - if (!afs_suser(NULL)) - return (EPERM); - - code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); - if (code) { - return (code); - } - if ((code = falloc(curproc, &fp, &fd)) != 0) { - iput(ip); - return (code); - } - IN_UNLOCK(ip); - - /* FreeBSD doesn't do much mp stuff yet :( */ - /* FP_LOCK(fp); */ - fp->f_flag = (usrmod) & FMASK; - fp->f_type = DTYPE_VNODE; - fp->f_ops = &vnops; - fp->f_data = (caddr_t) ITOV(ip); - - /* FP_UNLOCK(fp); */ - return (0); -} - - -/* - * Support for iinc() and idec() system calls--increment or decrement - * count on inode. - * Restricted to super user. - * Only VICEMAGIC type inodes. - */ -int -afs_syscall_iincdec(dev, inode, inode_p1, amount) - int dev, inode, inode_p1, amount; -{ - int dummy; - struct inode *ip; - int code; - - if (!afs_suser(NULL)) - return (EPERM); - - code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); - if (code) { - return (code); - } - if (!IS_VICEMAGIC(ip)) { - return (EPERM); - } else if (ip->i_vicep1 != inode_p1) { - return (ENXIO); - } - ip->i_nlink += amount; - if (ip->i_nlink == 0) { - CLEAR_VICEMAGIC(ip); - } - ip->i_flag |= ICHG; - iput(ip); - return (0); -} -#else int afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; @@ -293,4 +140,3 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount) { return EOPNOTSUPP; } -#endif diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 9ebf840de6..e0213a47cf 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -305,12 +305,6 @@ afs_vop_lock(ap) struct vnode *vp = ap->a_vp; struct lock *lkp = vp->v_vnlock; -#if 0 && defined(AFS_FBSD80_ENV) && !defined(UKERNEL) - afs_warn("afs_vop_lock: tid %d pid %d \"%s\"\n", curthread->td_tid, - curthread->td_proc->p_pid, curthread->td_name); - kdb_backtrace(); -#endif - #ifdef AFS_FBSD80_ENV return (_lockmgr_args(lkp, ap->a_flags, VI_MTX(vp), LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, @@ -621,27 +615,6 @@ afs_vop_mknod(ap) return (ENODEV); } -#if 0 -static int -validate_vops(struct vnode *vp, int after) -{ - int ret = 0; - struct vnodeopv_entry_desc *this; - for (this = afs_vnodeop_entries; this->opve_op; this++) { - if (vp->v_op[this->opve_op->vdesc_offset] != this->opve_impl) { - if (!ret) { - printf("v_op %d ", after); - vprint("check", vp); - } - ret = 1; - printf("For oper %d (%s), func is %p, not %p", - this->opve_op->vdesc_offset, this->opve_op->vdesc_name, - vp->v_op[this->opve_op->vdesc_offset], this->opve_impl); - } - } - return ret; -} -#endif int afs_vop_open(ap) struct vop_open_args /* { diff --git a/src/afs/HPUX/osi_vnodeops.c b/src/afs/HPUX/osi_vnodeops.c index bce2441da4..b54bf1a25e 100644 --- a/src/afs/HPUX/osi_vnodeops.c +++ b/src/afs/HPUX/osi_vnodeops.c @@ -882,60 +882,6 @@ afspgin_io(vfspage_t * vm_info, struct vnode *devvp, pgcnt_t bpages, space_t space = VM_SPACE(vm_info); int num_io = VM_GET_NUM_IO(vm_info); -#ifdef notdef /* Not used in AFS */ - /* - * With VM_READ_AHEAD_ALLOWED() macro, check if read-ahead should - * be used in this case. - * - * Unlike UFS, NFS does not start the faulting page I/O - * asynchronously. Why? Asynchronous requests are handled by the - * biod's. It doesn't make sense to queue up the faulting request - * behind other asynchrnous requests. This is not true for UFS - * where the asynchrnous request is immediately handled. - */ - - if ((VM_READ_AHEAD_ALLOWED(vm_info)) && (nfs_read_ahead_on) - && (NFS_DO_READ_AHEAD) && (should_do_read_ahead(prp, vaddr))) { - - pgcnt_t max_rhead_io; - caddr_t rhead_vaddr; - pgcnt_t total_rheads_allowed; - - /* - * Determine the maximum amount of read-ahead I/O. - */ - total_rheads_allowed = maxpagein - count; - - /* - * If the count is less than a block, raise it to one. - */ - if (total_rheads_allowed < bpages) - total_rheads_allowed = bpages; - - max_rhead_io = total_rheads_allowed; - rhead_vaddr = VM_MAPPED_ADDR(vm_info) + (count * NBPG); - error = - nfs_read_ahead(vm_info->vp, prp, wrt, space, rhead_vaddr, - &max_rhead_io); - - /* - * Set the next fault location. If read_ahead launches any - * I/O it will adjust it accordingly. - */ - vm_info->prp->p_nextfault = vm_info->startindex + count; - - /* - * Now perform the faulting I/O synchronously. - */ - vm_unlock(vm_info); - - error = - syncpageio((swblk_t) VM_GET_IO_STARTBLK(vm_info, 0), - VM_MAPPED_SPACE(vm_info), VM_MAPPED_ADDR(vm_info), - (int)ptob(count), B_READ, devvp, - B_vfs_pagein | B_pagebf, VM_REGION(vm_info)); - } else -#endif { virt_addr = VM_MAPPED_ADDR(vm_info); vm_unlock(vm_info); @@ -1199,22 +1145,6 @@ afs_pagein(vp, prp, wrt, space, vaddr, ret_startindex) if (retval == VM_PAGE_PRESENT) return (count); -#if 0 - /* - * The definition of krusage_cntr_t is in h/kmetric.h, which - * is not shipped. Since it's just statistics, we punt and do - * not update it. If it's a problem we'll need to get HP to export - * an interface that we can use to increment the counter. - */ - - /* It's a real fault, not a reclaim */ - { - krusage_cntr_t *temp; - temp = kt_cntrp(u.u_kthreadp); - temp->krc_majflt++; - } -#endif - /* * Tell VM where the I/O intends to start. This may be different * from the faulting point. @@ -1895,32 +1825,6 @@ afs_vm_checkpage(vp, args, pgindx, cur_data) VM_SETFS_FLAGS(args, PAGEOUT_TRUNCATE); return (1); } -#ifdef notdef - if ((args->vm_flags & PAGEOUT_VHAND) - && (!(args->vm_flags & PAGEOUT_RESERVED)) - && (!(VM_IS_ZOMBIE(args)))) { - VASSERT(args->run == 0); - if (vm_reserve_malloc_memory(NFS_PAGEOUT_MEM)) { - /* - * Got enough memory to pageout. Mark the fact that we did - * a sysprocmemreserve(), so that we can sysprocmemunreserve() it - * later (in remote_pageout()). - */ - args->vm_flags |= PAGEOUT_RESERVED; - } else { - /* - * We do not have enough memory to do this pageout. By - * definition, we do not yet have a run, so we just unlock - * this page and tell foreach_valid() to continue scanning. - * If we come across another dirty page, we will try to - * reserve memory again. That is okay, in fact some memory - * may have freed up (as earlier pageouts complete under - * interrupt). - */ - return 1; - } - } -#endif return (0); } @@ -2042,12 +1946,6 @@ afs_ioctl(vp, com, data, flag, cred) /* The call must be a VICEIOCTL call */ if (((com >> 8) & 0xff) == 'V') { -#ifdef notdef - /* AFS_COPYIN returns error 14. Copy data in instead */ - AFS_COPYIN(data, (caddr_t) & afsioctl, sizeof(afsioctl), error); - if (error) - return (error); -#endif ai = (struct afs_ioctl *)data; afsioctl.in = ai->in; afsioctl.out = ai->out; @@ -2512,10 +2410,6 @@ afsHashGarbageCollect() } hashUnlock(hashTable[index].lock); } -#if 0 - if (!foundFlag) - osi_Panic("afs: SEMA HashTable full\n"); -#endif } #endif /* AFS_SV_SEMA_HASH */ diff --git a/src/afs/IRIX/osi_vfs.h b/src/afs/IRIX/osi_vfs.h index d257b1a94c..cd5cfbf8bd 100644 --- a/src/afs/IRIX/osi_vfs.h +++ b/src/afs/IRIX/osi_vfs.h @@ -176,10 +176,6 @@ extern int afs_is_numa_arch; extern int afs_is_numa_arch; typedef struct bhv_head1 { struct bhv_desc *bh_first; /* first behavior in chain */ -#ifdef notdef - /* This is not present in the non NUMA machines. */ - mrlock_t bh_mrlock; /* lock for ops-in-progress synch. */ -#endif } bhv_head1_t; typedef struct vnode1 { diff --git a/src/afs/LINUX/osi_nfssrv.c b/src/afs/LINUX/osi_nfssrv.c index 425ecd3411..27f34448f3 100644 --- a/src/afs/LINUX/osi_nfssrv.c +++ b/src/afs/LINUX/osi_nfssrv.c @@ -160,26 +160,6 @@ done: } -#if 0 -/* This doesn't work, because they helpfully NULL out rqstp->authop - * before calling us, so we have no way to tell what the original - * auth flavor was. - */ -static int -svcauth_afs_release(struct svc_rqst *rqstp) -{ - struct nfs_server_thread *ns; - - AFS_GLOCK(); - ns = find_nfs_thread(0); - if (ns) ns->active = 0; - AFS_GUNLOCK(); - - return afs_orig_authtab[rqstp->rq_authop->flavour]->release(rqstp); -} -#endif - - int osi_linux_nfs_initreq(struct vrequest *av, afs_ucred_t *cr, int *code) { struct nfs_server_thread *ns; diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c index 11a1be39d0..fc8153c978 100644 --- a/src/afs/LINUX/osi_probe.c +++ b/src/afs/LINUX/osi_probe.c @@ -427,12 +427,6 @@ static int main_zapped_syscalls[] = { 1132, 1136, 1135, #endif -/* And the same deal for arm (not arm26), if we ever support that. */ -#if 0 - /* create_module, query_module, get_kernel_sysms */ - 127, 167, 130, -#endif - /* * Alpha-Linux uses syscall number mappings chosen to be compatible * with OSF/1. So, it doesn't have any of the traditional calls or diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 0ca2646afb..dc39822e43 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1289,20 +1289,6 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) osi_Assert(vcp->mvid.parent != NULL); } -#ifdef notdef - /* If the last looker changes, we should make sure the current - * looker still has permission to examine this file. This would - * always require a crref() which would be "slow". - */ - if (vcp->last_looker != treq.uid) { - if (!afs_AccessOK(vcp, (vType(vcp) == VREG) ? PRSFS_READ : PRSFS_LOOKUP, &treq, CHECK_MODE_BITS)) { - goto bad_dentry; - } - - vcp->last_looker = treq.uid; - } -#endif - parent = dget_parent(dp); pvcp = VTOAFS(parent->d_inode); parent_dv = parent_vcache_dv(parent->d_inode, credp); diff --git a/src/afs/NBSD/osi_file.c b/src/afs/NBSD/osi_file.c index efebc39ecb..ead7d99618 100644 --- a/src/afs/NBSD/osi_file.c +++ b/src/afs/NBSD/osi_file.c @@ -129,9 +129,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize) void osi_DisableAtimes(struct vnode *avp) { -#if 0 - VTOI(avp)->i_flag &= ~IN_ACCESS; -#endif } diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h index d80ef35827..4a2803b3d0 100644 --- a/src/afs/NBSD/osi_machdep.h +++ b/src/afs/NBSD/osi_machdep.h @@ -44,10 +44,6 @@ typedef char * caddr_t; #define osi_vfs_bsize mnt_stat.f_bsize #define osi_vfs_iosize mnt_stat.f_iosize #define osi_vfs_fsid mnt_stat.f_fsid -#if 0 -#define vfs_bsize mnt_stat.f_bsize -#define vfs_fsid mnt_stat.f_fsid -#endif #define vfs_vnodecovered mnt_vnodecovered #define v_vfsp v_mount diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c index b4899dcb86..2dc0a9b0cf 100644 --- a/src/afs/NBSD/osi_vnodeops.c +++ b/src/afs/NBSD/osi_vnodeops.c @@ -194,9 +194,6 @@ const struct vnodeopv_entry_desc afs_vnodeop_entries[] = { {&vop_islocked_desc, afs_nbsd_islocked}, /* islocked */ {&vop_pathconf_desc, afs_nbsd_pathconf}, /* pathconf */ {&vop_advlock_desc, afs_nbsd_advlock}, /* advlock */ -#if 0 - {&vop_reallocblks_desc, afs_nbsd_reallocblks}, /* reallocblks */ -#endif {&vop_bwrite_desc, vn_bwrite}, /* bwrite */ {&vop_getpages_desc, genfs_getpages}, /* getpages */ {&vop_putpages_desc, genfs_putpages}, /* putpages */ @@ -377,13 +374,6 @@ afs_nbsd_lookup(void *v) #endif out: -#if 0 -#ifdef AFS_NBSD50_ENV - if ((afs_debug & AFSDEB_VNLAYER) != 0 && (dvp->v_vflag & VV_ROOT) != 0) -#else - if ((afs_debug & AFSDEB_VNLAYER) != 0 && (dvp->v_flag & VROOT) != 0) -#endif -#endif if ((afs_debug & AFSDEB_VNLAYER) != 0) { printf("nbsd_lookup done dvp %p cnt %d\n", dvp, dvp->v_usecount); } @@ -638,11 +628,6 @@ afs_nbsd_read(void *v) printf("nbsd_read enter %p vp %p\n", ap, ap->a_vp); } -#if 0 - if (ap->a_uio->uio_offset > ap->a_vp->v_size) { - return 0; } -#endif - AFS_GLOCK(); code = afs_read(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, 0); AFS_GUNLOCK(); @@ -1360,15 +1345,6 @@ afs_nbsd_bmap(void *v) *ap->a_vpp = ap->a_vp; if (ap->a_runp != NULL) *ap->a_runp = 1024 * 1024; /* XXX */ -#ifdef notyet - if (ap->a_runb != NULL) - *ap->a_runb = 0; -#endif - -#if 0 - if (afs_debug & AFSDEB_VNLAYER) - printf("nbsd_bmap: exit %p\n", ap); -#endif return (0); } diff --git a/src/afs/OBSD/osi_file.c b/src/afs/OBSD/osi_file.c index 6c5ddd9332..b4635a1c90 100644 --- a/src/afs/OBSD/osi_file.c +++ b/src/afs/OBSD/osi_file.c @@ -118,9 +118,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize) void osi_DisableAtimes(struct vnode *avp) { -#if 0 - VTOI(avp)->i_flag &= ~IN_ACCESS; -#endif } diff --git a/src/afs/OBSD/osi_misc.c b/src/afs/OBSD/osi_misc.c index 53911037d2..0d17ef14c9 100644 --- a/src/afs/OBSD/osi_misc.c +++ b/src/afs/OBSD/osi_misc.c @@ -135,34 +135,6 @@ osi_obsd_Free(void *p, size_t asize) } #endif -#if 0 /* XXX */ -/* I speculate this usage may be more correct than definitions - * in afs_osi_alloc.c, which I discarded successfully for FreeBSD 7+, - * and am trying to discard for NetBSD 4.x, but until tested, I'm - * not rocking the boat. Matt. - */ - -void -osi_FreeLargeSpace(void *p) -{ - osi_obsd_Free(p, 0); -} - -void -osi_FreeSmallSpace(void *p) -{ - osi_obsd_Free(p, 0); -} - -void * -osi_AllocLargeSpace(size_t size) -{ - AFS_ASSERT_GLOCK(); - AFS_STATCNT(osi_AllocLargeSpace); - return (osi_obsd_Alloc(size, 1)); -} -#endif - int afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; diff --git a/src/afs/OBSD/osi_vnodeops.c b/src/afs/OBSD/osi_vnodeops.c index 2863361550..fa3a112446 100644 --- a/src/afs/OBSD/osi_vnodeops.c +++ b/src/afs/OBSD/osi_vnodeops.c @@ -937,14 +937,6 @@ afs_obsd_reclaim(void *v) int haveGlock = ISAFS_GLOCK(); int haveVlock = CheckLock(&afs_xvcache); -#if 0 - printf("reclaim usecount %d\n", vp->v_usecount); - /* OK, there are no internal vrefCounts, so there shouldn't - * be any more refs here. */ - vp->v_data = NULL; /* remove from vnode */ - avc->v = NULL; /* also drop the ptr to vnode */ - return 0; -#else if (!haveGlock) AFS_GLOCK(); if (!haveVlock) @@ -956,7 +948,6 @@ afs_obsd_reclaim(void *v) if (!haveGlock) AFS_GUNLOCK(); return code; -#endif } #ifdef AFS_OBSD42_ENV diff --git a/src/afs/UKERNEL/osi_machdep.h b/src/afs/UKERNEL/osi_machdep.h index e252c7623d..cd2a5556fc 100644 --- a/src/afs/UKERNEL/osi_machdep.h +++ b/src/afs/UKERNEL/osi_machdep.h @@ -51,9 +51,6 @@ #define osi_vnhold(avc, r) do { VN_HOLD(AFSTOV(avc)); } while(0) -#if 0 -#define afs_suser(x) suser(x) -#endif /* * Global lock support. */ diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index e54e382b55..c38b3cb5af 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -278,10 +278,6 @@ EvalMountPoint(struct vcache *avc, struct vcache *advc, afs_uint32 avnoid, auniq; AFS_STATCNT(EvalMountPoint); -#ifdef notdef - if (avc->mvid.target_root && (avc->f.states & CMValid)) - return 0; /* done while racing */ -#endif *avolpp = NULL; code = afs_HandleLink(avc, areq); if (code) diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index f8b7c6a00a..b90dd700a6 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -1639,135 +1639,12 @@ SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call, } -#if 0 && defined(AFS_LINUX24_ENV) -extern struct vcache *afs_globalVp; - -int recurse_dcache_parent(parent, a_index, addr, inode, flags, time, fileName) - struct dentry * parent; - afs_int32 a_index; - afs_int32 *addr; - afs_int32 *inode; - afs_int32 *flags; - afs_int32 *time; - char ** fileName; -{ - struct dentry *this_parent = parent; - struct list_head *next; - int found = 0; - struct dentry *dentry; - -repeat: - next = this_parent->d_subdirs.next; -resume: - while (next != &this_parent->d_subdirs) { - struct list_head *tmp = next; - dentry = list_entry(tmp, struct dentry, d_child); - if (a_index == 0) - goto searchdone3; - a_index--; - next = tmp->next; - /* - * Descend a level if the d_subdirs list is non-empty. - */ - if (!list_empty(&dentry->d_subdirs)) { - this_parent = dentry; - goto repeat; - } - } - /* - * All done at this level ... ascend and resume the search. - */ - if (this_parent != parent) { - next = this_parent->d_child.next; - this_parent = this_parent->d_parent; - goto resume; - } - goto ret; - - searchdone3: - if (d_unhashed(dentry)) - *flags = 1; - else - *flags = 0; - - *fileName = afs_strdup(dentry->d_name.name?dentry->d_name.name:""); - *inode = ITOAFS(dentry->d_inode); - *addr = atomic_read(&(dentry)->d_count); - *time = dentry->d_time; - - return 0; - ret: - return 1; -} -#endif - int SRXAFSCB_GetDE(struct rx_call *a_call, afs_int32 a_index, afs_int32 *addr, afs_int32 *inode, afs_int32 *flags, afs_int32 *time, char ** fileName) { /*SRXAFSCB_GetDE*/ int code = 0; /*Return code*/ -#if 0 && defined(AFS_LINUX24_ENV) - int i; /*Loop variable*/ - struct vcache *tvc = afs_globalVp; - struct dentry *dentry; - struct list_head *cur, *head = &(AFSTOI(tvc))->i_dentry; - -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - -#if defined(AFS_LINUX24_ENV) - spin_lock(&dcache_lock); -#endif - - cur = head; - while ((cur = cur->next) != head) { - dentry = list_entry(cur, struct dentry, d_alias); - - dget_locked(dentry); - -#if defined(AFS_LINUX24_ENV) - spin_unlock(&dcache_lock); -#endif - if (a_index == 0) - goto searchdone2; - a_index--; - - if (recurse_dcache_parent(dentry, a_index, addr, inode, flags, time, fileName) == 0) { - dput(dentry); - code = 0; - goto fcnDone; - } - dput(dentry); - } - searchdone2: - if (cur == head) { - /*Past EOF*/ - code = 1; - *fileName = afs_strdup(""); - goto fcnDone; - } - - if (d_unhashed(dentry)) - *flags = 1; - else - *flags = 0; - - *fileName = afs_strdup(dentry->d_name.name?dentry->d_name.name:""); - *inode = ITOAFS(dentry->d_inode); - *addr = atomic_read(&(dentry)->d_count); - *time = dentry->d_time; - - dput(dentry); - code = 0; - -fcnDone: - -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ -#endif return(code); } /*SRXAFSCB_GetDE*/ diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 2223ce8cd4..927f91e904 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -194,9 +194,6 @@ afs_Daemon(void) afs_FlushReclaimedVcaches(); ReleaseWriteLock(&afs_xvcache); afs_FlushActiveVcaches(1); /* keep flocks held & flush nfs writes */ -#if 0 - afs_StoreDirtyVcaches(); -#endif last1MinCheck = now; } diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c index 928133885f..ee79d31bce 100644 --- a/src/afs/afs_disconnected.c +++ b/src/afs/afs_disconnected.c @@ -1159,34 +1159,6 @@ afs_ResyncDisconFiles(struct vrequest *areq, afs_ucred_t *acred) tvc->f.ddirty_flags &= ~VDisconCreate; tvc->f.ddirty_flags |= VDisconCreated; } -#if 0 - /* Get server write lock. */ - do { - tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn); - if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETLOCK); - RX_AFS_GUNLOCK(); - code = RXAFS_SetLock(rxconn, - (struct AFSFid *)&tvc->f.fid.Fid, - LockWrite, - &tsync); - RX_AFS_GLOCK(); - XSTATS_END_TIME; - } else - code = -1; - - } while (afs_Analyze(tc, - rxconn, - code, - &tvc->f.fid, - areq, - AFS_STATS_FS_RPCIDX_SETLOCK, - SHARED_LOCK, - NULL)); - - if (code) - goto next_file; -#endif if (tvc->f.ddirty_flags & VDisconRename) { /* If we're renaming the file, do so now */ code = afs_ProcessOpRename(tvc, areq); @@ -1250,29 +1222,9 @@ afs_ResyncDisconFiles(struct vrequest *areq, afs_ucred_t *acred) } /* if DV match or client wins policy */ unlock_srv_file: - /* Release server write lock. */ -#if 0 - do { - tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK, &rxconn); - if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RELEASELOCK); - RX_AFS_GUNLOCK(); - ucode = RXAFS_ReleaseLock(rxconn, - (struct AFSFid *) &tvc->f.fid.Fid, - &tsync); - RX_AFS_GLOCK(); - XSTATS_END_TIME; - } else - ucode = -1; - } while (afs_Analyze(tc, - rxconn, - ucode, - &tvc->f.fid, - areq, - AFS_STATS_FS_RPCIDX_RELEASELOCK, - SHARED_LOCK, - NULL)); -#endif + /* If we ever lock files while replaying changes, we should unlock the + * file here. */ + next_file: ObtainWriteLock(&afs_disconDirtyLock, 710); if (code == 0) { diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c index 72b82ec0cf..c24c76dbbf 100644 --- a/src/afs/afs_fetchstore.c +++ b/src/afs/afs_fetchstore.c @@ -415,19 +415,6 @@ rxfs_storeInit(struct vcache *avc, struct afs_conn *tc, osi_Panic ("rxfs_storeInit: osi_AllocSmallSpace for iovecs returned NULL\n"); *ops = (struct storeOps *) &rxfs_storeMemOps; -#ifdef notdef - /* do this at a higher level now -- it's a parameter */ - /* for now, only do 'continue from close' code if file fits in one - * chunk. Could clearly do better: if only one modified chunk - * then can still do this. can do this on *last* modified chunk */ - length = avc->f.m.Length - 1; /* byte position of last byte we'll store */ - if (shouldWake) { - if (AFS_CHUNK(length) != 0) - *shouldWake = 0; - else - *shouldWake = 1; - } -#endif /* notdef */ } *rock = (void *)v; diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c index d6ba2bb7fc..651bb3a97c 100644 --- a/src/afs/afs_pag_cred.c +++ b/src/afs/afs_pag_cred.c @@ -231,9 +231,6 @@ SPAGCB_GetCreds(struct rx_call *a_call, afs_int32 a_uid, memset(a_creds, 0, sizeof(struct CredInfos)); if ((rx_HostOf(rx_PeerOf(rx_ConnectionOf(a_call))) != afs_nfs_server_addr || rx_PortOf(rx_PeerOf(rx_ConnectionOf(a_call))) != htons(7001)) -#if 0 /* for debugging ONLY! */ - && rx_PortOf(rx_PeerOf(rx_ConnectionOf(a_call))) != htons(7901) -#endif ) { RX_AFS_GUNLOCK(); return UAEPERM; diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 6848138e4c..50f804cba7 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -4766,10 +4766,6 @@ DECL_PIOCTL(PSetCPrefs) if (ainSize < sizeof(struct setspref)) return EINVAL; -#if 0 /* num_servers is unsigned */ - if (sin->num_servers < 0) - return EINVAL; -#endif if (sin->num_servers > AFS_MAX_INTERFACE_ADDR) return ENOMEM; diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index d78b7528aa..e91c481858 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -1451,18 +1451,6 @@ afs_WriteVCacheDiscon(struct vcache *avc, if (astatus->Mask & AFS_SETMODE) { avc->f.m.Mode = astatus->UnixModeBits; -#if 0 /* XXX: Leaving this out, so it doesn't mess up the file type flag.*/ - - if (vType(avc) == VREG) { - avc->f.m.Mode |= S_IFREG; - } else if (vType(avc) == VDIR) { - avc->f.m.Mode |= S_IFDIR; - } else if (vType(avc) == VLNK) { - avc->f.m.Mode |= S_IFLNK; - if ((avc->f.m.Mode & 0111) == 0) - avc->mvstat = AFS_MVSTAT_MTPT; - } -#endif flags |= VDisconSetMode; } /* if(astatus.Mask & AFS_SETMODE) */ @@ -2430,145 +2418,6 @@ afs_FetchStatus(struct vcache * avc, struct VenusFid * afid, return code; } -#if 0 -/* - * afs_StuffVcache - * - * Description: - * Stuff some information into the vcache for the given file. - * - * Parameters: - * afid : File in question. - * OutStatus : Fetch status on the file. - * CallBack : Callback info. - * tc : RPC connection involved. - * areq : vrequest involved. - * - * Environment: - * Nothing interesting. - */ -void -afs_StuffVcache(struct VenusFid *afid, - struct AFSFetchStatus *OutStatus, - struct AFSCallBack *CallBack, struct afs_conn *tc, - struct vrequest *areq) -{ - afs_int32 code, i, newvcache = 0; - struct vcache *tvc; - struct AFSVolSync tsync; - struct volume *tvp; - struct axscache *ac; - afs_int32 retry; - - AFS_STATCNT(afs_StuffVcache); -#ifdef IFS_VCACHECOUNT - ifs_gvcachecall++; -#endif - - loop: - ObtainSharedLock(&afs_xvcache, 8); - - tvc = afs_FindVCache(afid, &retry, DO_VLRU| IS_SLOCK /* no stats */ ); - if (tvc && retry) { -#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) - ReleaseSharedLock(&afs_xvcache); - spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); - goto loop; -#endif - } - - if (!tvc) { - /* no cache entry, better grab one */ - UpgradeSToWLock(&afs_xvcache, 25); - tvc = afs_NewVCache(afid, NULL); - newvcache = 1; - ConvertWToSLock(&afs_xvcache); - if (!tvc) - { - ReleaseSharedLock(&afs_xvcache); - return NULL; - } - } - - ReleaseSharedLock(&afs_xvcache); - ObtainWriteLock(&tvc->lock, 58); - - afs_StaleVCacheFlags(tvc, AFS_STALEVC_NOCB, 0); - - /* Is it always appropriate to throw away all the access rights? */ - afs_FreeAllAxs(&(tvc->Access)); - - /*Copy useful per-volume info */ - tvp = afs_GetVolume(afid, areq, READ_LOCK); - if (tvp) { - if (newvcache && (tvp->states & VForeign)) - tvc->f.states |= CForeign; - if (tvp->states & VRO) - tvc->f.states |= CRO; - if (tvp->states & VBackup) - tvc->f.states |= CBackup; - /* - * Now, copy ".." entry back out of volume structure, if - * necessary - */ - if (tvc->mvstat == AFS_MVSTAT_ROOT && tvp->dotdot.Fid.Volume != 0) { - if (!tvc->mvid.parent) - tvc->mvid.parent = (struct VenusFid *) - osi_AllocSmallSpace(sizeof(struct VenusFid)); - *tvc->mvid.parent = tvp->dotdot; - } - } - /* store the stat on the file */ - afs_RemoveVCB(afid); - afs_ProcessFS(tvc, OutStatus, areq); - tvc->callback = tc->srvr->server; - - /* we use osi_Time twice below. Ideally, we would use the time at which - * the FetchStatus call began, instead, but we don't have it here. So we - * make do with "now". In the CRO case, it doesn't really matter. In - * the other case, we hope that the difference between "now" and when the - * call actually began execution on the server won't be larger than the - * padding which the server keeps. Subtract 1 second anyway, to be on - * the safe side. Can't subtract more because we don't know how big - * ExpirationTime is. Possible consistency problems may arise if the call - * timeout period becomes longer than the server's expiration padding. */ - ObtainWriteLock(&afs_xcbhash, 470); - if (CallBack->ExpirationTime != 0) { - tvc->cbExpires = CallBack->ExpirationTime + osi_Time() - 1; - tvc->f.states |= CStatd; - tvc->f.states &= ~CBulkFetching; - afs_QueueCallback(tvc, CBHash(CallBack->ExpirationTime), tvp); - } else if (tvc->f.states & CRO) { - /* old-fashioned AFS 3.2 style */ - tvc->cbExpires = 3600 + osi_Time(); - /*XXX*/ tvc->f.states |= CStatd; - tvc->f.states &= ~CBulkFetching; - afs_QueueCallback(tvc, CBHash(3600), tvp); - } else { - afs_StaleVCacheFlags(tvc, AFS_STALEVC_CBLOCKED | AFS_STALEVC_CLEARCB, - CUnique); - } - ReleaseWriteLock(&afs_xcbhash); - if (tvp) - afs_PutVolume(tvp, READ_LOCK); - - /* look in per-pag cache */ - if (tvc->Access && (ac = afs_FindAxs(tvc->Access, areq->uid))) - ac->axess = OutStatus->CallerAccess; /* substitute pags */ - else /* not found, add a new one if possible */ - afs_AddAxs(tvc->Access, areq->uid, OutStatus->CallerAccess); - - ReleaseWriteLock(&tvc->lock); - afs_Trace4(afs_iclSetp, CM_TRACE_STUFFVCACHE, ICL_TYPE_POINTER, tvc, - ICL_TYPE_POINTER, tvc->callback, ICL_TYPE_INT32, - tvc->cbExpires, ICL_TYPE_INT32, tvc->cbExpires - osi_Time()); - /* - * Release ref count... hope this guy stays around... - */ - afs_PutVCache(tvc); -} /*afs_StuffVcache */ -#endif - /*! * Decrements the reference count on a cache entry. * diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index ff7cc4718f..6d97f249cd 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -910,25 +910,6 @@ afs_NewVolumeByName(char *aname, afs_int32 acell, int agood, SHARED_LOCK, tcell)); if (code) { - /* If the client has yet to contact this cell and contact failed due - * to network errors, mark the VLDB servers as back up. - * That the client tried and failed can be determined from the - * fact that there was a downtime incident, but CHasVolRef is not set. - */ - /* RT 48959 - unclear if this should really go */ -#if 0 - if (areq->networkError && !(tcell->states & CHasVolRef)) { - int i; - struct server *sp; - struct srvAddr *sap; - for (i = 0; i < AFS_MAXCELLHOSTS; i++) { - if ((sp = tcell->cellHosts[i]) == NULL) - break; - for (sap = sp->addr; sap; sap = sap->next_sa) - afs_MarkServerUpOrDown(sap, 0); - } - } -#endif afs_CopyError(treq, areq); osi_FreeLargeSpace(tbuffer); afs_PutCell(tcell, READ_LOCK); diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 345f1c8117..2d37aa184f 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -496,11 +496,6 @@ afsd_install_events(void) (NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetIPv4)); -#if 0 - /* This should tell us when the hostname(s) change. do we care? */ - keys[N] = SCDynamicStoreKeyCreateHostNames (NULL); -#endif - if (keys[0] != NULL) { CFArrayRef pattern_array; @@ -2077,20 +2072,6 @@ afsd_run(void) if (afsd_verbose) printf("%s: cacheFiles autotuned to %d\n", rn, cacheFiles); } -#if 0 - /* This actually needs to - 1) use powers of 2 - 2) not second-guess when a chunksize comes from the command line - 3) be less, um, small. 2^2?? - */ - /* Sanity check chunkSize */ - i = max(cacheBlocks / 1000, cacheBlocks / cacheFiles); - chunkSize = min(chunkSize, i); - chunkSize = max(chunkSize, 2); - if (afsd_verbose) - printf("%s: chunkSize autotuned to %d\n", rn, chunkSize); -#endif - if (!sawDCacheSize) { dCacheSize = cacheFiles / 2; if (dCacheSize > 10000) { diff --git a/src/afsmonitor/afsmon-win.c b/src/afsmonitor/afsmon-win.c index 4209fd5c2e..c5417ff225 100644 --- a/src/afsmonitor/afsmon-win.c +++ b/src/afsmonitor/afsmon-win.c @@ -27,10 +27,6 @@ #include /*Generic window package */ #include /*Object definitions */ #include -#if 0 -#include /*Text object circular buffer interface */ -#include /*Text object interface */ -#endif #include /*Light object interface */ #include /*Curses window package */ #include /*Dumb terminal window package */ diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index 1f28e3db25..2dc9ec6a0f 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -3955,25 +3955,6 @@ afsmonInit(struct cmd_syndesc *as, void *arock) /* use curses always until we support other packages */ -#ifdef notdef - wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data); - - switch (wpkg_to_use) { - case GATOR_WIN_CURSES: - fprintf(stderr, "curses\n"); - break; - case GATOR_WIN_DUMB: - fprintf(stderr, "dumb terminal\n"); - break; - case GATOR_WIN_X11: - fprintf(stderr, "X11\n"); - break; - default: - fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use); - afsmon_Exit(155); - } /*end switch (wpkg_to_use) */ -#endif - wpkg_to_use = GATOR_WIN_CURSES; /* get probe frequency . We check for meaningful bounds on the frequency @@ -4228,11 +4209,6 @@ main(int argc, char **argv) cmd_AddParm(ts, "-output", CMD_SINGLE, CMD_OPTIONAL, "storage file name"); cmd_AddParm(ts, "-detailed", CMD_FLAG, CMD_OPTIONAL, "output detailed statistics to storage file"); -#ifdef notdef - /* we hope to use this .... eventually! */ - cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED, - "Graphics Package to use"); -#endif cmd_AddParm(ts, "-debug", CMD_SINGLE, CMD_OPTIONAL, "turn debugging output on to the named file"); cmd_AddParm(ts, "-fshosts", CMD_LIST, CMD_OPTIONAL, diff --git a/src/afsweb/nsafs.c b/src/afsweb/nsafs.c index 10dc19503c..bcb2b7241e 100644 --- a/src/afsweb/nsafs.c +++ b/src/afsweb/nsafs.c @@ -916,13 +916,7 @@ nsafs_basic(pblock * pb, Session * sn, Request * rq) code = uafs_klog(user, cell, passwd, &reason); memset((void *)&passwd[0], 0, NSAFS_PASSWORD_MAX); if (code != 0) { -#if 0 - sprintf(txtbuf, "%s@%s: %s\n", user, cell, reason); - pblock_nvinsert("status", "Login Failed", rq->vars); - return nsafs_error_check(EPERM, txtbuf, pb, sn, rq); -#else /* 0 */ return REQ_PROCEED; -#endif /* 0 */ } expiration = u.u_expiration; usr_assert(expiration != 0); diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index 66b4dfe39f..da91229dbc 100644 --- a/src/aklog/aklog.c +++ b/src/aklog/aklog.c @@ -1948,10 +1948,6 @@ get_credv5_akimpersonate(krb5_context context, enc_tkt_reply->authtime = starttime; enc_tkt_reply->starttime = temp_time; *enc_tkt_reply->starttime = starttime; -#if 0 - enc_tkt_reply->renew_till = temp_time + 1; - *enc_tkt_reply->renew_till = endtime; -#endif enc_tkt_reply->endtime = endtime; #else if ((code = krb5_c_make_random_key(context, diff --git a/src/auth/ktc.c b/src/auth/ktc.c index 0c249085ad..27e5a2abb8 100644 --- a/src/auth/ktc.c +++ b/src/auth/ktc.c @@ -1110,11 +1110,6 @@ ktc_curpag(void) * . */ -#if 0 -#include -#include -#endif - #define TOO_BIG -1 #define TF_LCK_RETRY ((unsigned)2) /* seconds to sleep before * retry if ticket file is diff --git a/src/auth/ktc_nt.c b/src/auth/ktc_nt.c index 8a9172050a..36575be80c 100644 --- a/src/auth/ktc_nt.c +++ b/src/auth/ktc_nt.c @@ -650,12 +650,8 @@ ktc_GetTokenEx(char *cellName, struct ktc_setTokenData **tokenSet) { } } -#if 0 - code = pioctl(0, VIOC_GETTOK2, &iob, 0); -#else - code = -1; /* not yet implemented */ - errno = EINVAL; -#endif + code = -1; /* VIOC_GETTOK2 not yet implemented */ + errno = EINVAL; ReleaseMutex(ktcMutex); CloseHandle(ktcMutex); @@ -1084,12 +1080,8 @@ ktc_ListTokensEx(int prevIndex, int *newIndex, char **cellName) { iob.out = tbuffer; iob.out_size = sizeof(tbuffer); -#if 0 - code = pioctl(0, VIOC_GETTOK2, &iob, 0); -#else - code = -1; /* not yet implemented */ + code = -1; /* VIOC_GETTOK2 not yet implemented */ errno = EINVAL; -#endif /* Can't use new pioctl, so must use old one */ if (code == -1 && errno == EINVAL) { diff --git a/src/bozo/bnode.c b/src/bozo/bnode.c index 6c0ab90048..9dab6d0e69 100644 --- a/src/bozo/bnode.c +++ b/src/bozo/bnode.c @@ -706,10 +706,6 @@ SendNotifierData(int fd, struct bnode_proc *tp) bufp += strlen(bufp); (void)sprintf(bufp, "lastExit: %ld\n", afs_printable_int32_ld(tp->lastExit)); bufp += strlen(bufp); -#ifdef notdef - (void)sprintf(bufp, "lastSignal: %ld\n", afs_printable_int32_ld(tp->lastSignal)); - bufp += strlen(bufp); -#endif (void)sprintf(bufp, "flags: %ld\n", afs_printable_int32_ld(tp->flags)); bufp += strlen(bufp); (void)sprintf(bufp, "END bnode_proc\n"); diff --git a/src/bucoord/bc_status.c b/src/bucoord/bc_status.c index 2ba8728963..04b2ba9d8c 100644 --- a/src/bucoord/bc_status.c +++ b/src/bucoord/bc_status.c @@ -69,32 +69,6 @@ nextItem(statusP linkPtr) return ((statusP) ptr); } -#ifdef notdef -static statusP -nextItem(linkPtr) - statusP linkPtr; -{ - dlqlinkP ptr; - - ptr = (dlqlinkP) linkPtr; - - /* if last known item has terminated, reset ptr */ - if (ptr == 0) { - ptr = &statusHead; - if (dlqEmpty(ptr)) - return (0); - } - - ptr = ptr->dlq_next; - - /* if we're back at the head again */ - if (ptr == &statusHead) { - ptr = ptr->dlq_next; - } - return ((statusP) ptr); -} -#endif /* notdef */ - char *cmdLine; void * diff --git a/src/bucoord/config.c b/src/bucoord/config.c index bcaf017a0f..5735f707ef 100644 --- a/src/bucoord/config.c +++ b/src/bucoord/config.c @@ -16,26 +16,6 @@ struct bc_config *bc_globalConfig; -#if 0 -static int -TrimLine(char *abuffer, afs_int32 *aport) -{ - int tc; - char garb[100]; - - *aport = 0; - sscanf(abuffer, "%s %u", garb, aport); - while ((tc = *abuffer)) { - if (tc == ' ') { - *abuffer = 0; - return 0; - } - abuffer++; - } - return 0; -} -#endif - FILE * bc_open(struct bc_config *aconfig, char *aname, char *aext, char *amode) { diff --git a/src/bucoord/dsstub.c b/src/bucoord/dsstub.c index 01b1c78e7c..95577e94fb 100644 --- a/src/bucoord/dsstub.c +++ b/src/bucoord/dsstub.c @@ -174,21 +174,6 @@ static afs_int32 DeleteDump(afs_int32 adumpID) return code; } -#if 0 -static afs_int32 DeleteTape(char * atapeName) -{ - char *tp; - afs_int32 code; - - tp = TapeName(atapeName); - if (tp == NULL) - return ENOMEM; - code = unlink(tp); - free(tp); - return code; -} -#endif - /* tailCompPtr * name is a pathname style name, determine trailing name and return * pointer to it @@ -247,25 +232,6 @@ ScanDumpHdr(FILE *afile, char *aname, char *dumpName, afs_int32 *aparent, afs_in return 0; } -#if 0 -/* scan a tape header out of a tape file, leaving the file ptr positioned just past the header */ -static afs_int32 ScanTapeHdr(FILE *afile, afs_int32 *adumpID, afs_int32 *aseq, afs_int32 *adamage) -{ - char tbuffer[256]; - char *tp; - afs_int32 code; - - tp = fgets(tbuffer, sizeof(tbuffer), afile); - if (!tp) - return -1; - code = sscanf(tbuffer, "%ld %ld %ld", (long int *)adumpID, - (long int *)aseq, (long int *)adamage); - if (code != 3) - return -1; - return 0; -} -#endif - /* ScanTapeVolume * scan a tape volume record from a dump file, leaving the file ptr * positioned past the just-scanned record. @@ -323,23 +289,3 @@ afs_int32 ScanVolClone(FILE *tdump, char *volName, afs_int32 *cloneTime) } return (-1); } - -#if 0 -/* seek a dump file (after a header scan has been done) to position apos */ -static int SeekDump(FILE *afile, afs_int32 apos) -{ - afs_int32 i; - char *tp; - char tbuffer[256]; - - /* now skip to appropriate position */ - for (i = 0; i < apos; i++) { - tp = fgets(tbuffer, sizeof(tbuffer), afile); - if (!tp) { - fclose(afile); - return -1; - } - } - return 0; -} -#endif diff --git a/src/bucoord/dump.c b/src/bucoord/dump.c index e0b3ced57a..a85484d242 100644 --- a/src/bucoord/dump.c +++ b/src/bucoord/dump.c @@ -308,33 +308,6 @@ bc_StartDmpRst(struct bc_config *aconfig, char *adname, char *avname, return 0; } -#ifdef notdef -/* bc_FindDumpSlot - * Returns the dump slot of the dump with dumpID - * entry: - * dumpID - id to look for - * port - portoffset for tape coordinator - * exit: - * 0-n - i.e. 0 or positive number, is the dump slot - * -1 - failed to find dumpID - */ - -afs_int32 -bc_FindDumpSlot(afs_int32 dumpID, afs_int32 port) -{ - int i; - - for (i = 0; i < BC_MAXSIMDUMPS; i++) { - if ((bc_dumpTasks[i].flags & BC_DI_INUSE) - && (bc_dumpTasks[i].dumpID == dumpID) - && ((afs_int32) bc_dumpTasks[i].portOffset == port)) { - return (i); - } - } - return (-1); -} -#endif - /* bc_LabelTape * opens a connection to the tape coordinator and requests that it * label a tape diff --git a/src/budb/database.h b/src/budb/database.h index 8742aaa228..e283b6cb3f 100644 --- a/src/budb/database.h +++ b/src/budb/database.h @@ -310,12 +310,6 @@ extern struct memoryDB db; (char *)(addr)), \ sizeof(afs_int32)) -#ifdef notdef -/* simple min/max macros */ -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif /* notdef */ - struct memoryHashTable *ht_GetType(int type, int *e_sizeP); extern afs_uint32 ht_HashEntry(struct memoryHashTable *mht, char *e); extern dbadr ht_LookupBucket(struct ubik_trans *ut, diff --git a/src/budb/db_dump.c b/src/budb/db_dump.c index d4d1fcd45b..504514443d 100644 --- a/src/budb/db_dump.c +++ b/src/budb/db_dump.c @@ -771,26 +771,3 @@ writeDatabase(struct ubik_trans *ut, int fid) doneWriting(code); return (code); } - - -#ifdef notdef - -afs_int32 -canWrite(int fid) -{ - afs_int32 in, out, except; - struct timeval tp; - afs_int32 code; - - tp.tv_sec = 0; - tp.tv_usec = 0; - - out = (1 << fid); - in = 0; - except = 0; - - code = IOMGR_Select(32, &in, &out, &except, &tp); - return (code); -} - -#endif /* notdef */ diff --git a/src/budb/db_hash.c b/src/budb/db_hash.c index d9d20e5f87..72bb98364b 100644 --- a/src/budb/db_hash.c +++ b/src/budb/db_hash.c @@ -843,62 +843,6 @@ ht_MoveEntries(struct ubik_trans *ut, struct memoryHashTable *mht) } -#ifdef notdef -static afs_int32 -ht_MoveEntries(struct ubik_trans *ut, struct memoryHashTable *mht) -{ - afs_uint32 hash; - int bo; - struct memoryHTBlock *block; - afs_int32 code; - - if (mht->oldLength == 0) - return 0; - - LogDebug(3, "ht_MoveEntries:\n"); - /* we assume here that the hash function will map numbers smaller than the - * size of the hash table straight through to hash table indexes. - */ - hash = mht->progress; - - /* get hash table block ? */ - code = ht_GetTableBlock(ut, mht, hash, 1 /*old */ , &block, &bo); - if (code) - return code; - - if (block == 0) - return BUDB_INTERNALERROR; - - do { - mht->progress++; - if (block->b.bucket[bo]) { - code = ht_HashInList(ut, mht, ntohl(block->b.bucket[bo])); - if (code) { - Log("ht_MoveEntries: ht_HashInList failed\n"); - return (BUDB_IO); - } - code = - set_word_addr(ut, block->a, &block->b, &block->b.bucket[bo], - 0); - if (code) { - Log("ht_MoveEntries: clear old entry failed\n"); - return BUDB_IO; - } - break; - } - } while (++bo < nHTBuckets); - - if (mht->progress >= mht->oldLength) - return (ht_FreeTable(ut, mht)); - - if (set_word_addr(ut, 0, &db.h, &mht->ht->progress, htonl(mht->progress))) { - Log("ht_MoveEntries: progress set failed\n"); - return BUDB_IO; - } - return 0; -} -#endif /* notdef */ - afs_int32 ht_HashIn(struct ubik_trans *ut, struct memoryHashTable *mht, @@ -1015,34 +959,6 @@ ht_HashOutT(struct ubik_trans *ut, struct memoryHashTable *mht, ea, e, (dbadr *) (e + mht->threadOffset)); if (code) return code; -#if 0 - net_ea = htonl(ea); - unthread_ea = *(afs_int32 *) ((char *)e + mht->threadOffset); - if (block->b.bucket[bo] == net_ea) { - if (set_word_addr - (ut, block->a, &block->b, &block->b.bucket[bo], unthread_ea)) - return BUDB_IO; - goto done; - } - loop_a = ntohl(block->b.bucket[bo]); - while (1) { - if (dbread - (ut, loop_a + mht->threadOffset, (char *)&next_loop_a, - sizeof(dbadr))) - return BUDB_IO; - if (next_loop_a == 0) - return -1; /* not found */ - if (net_ea == next_loop_a) { - if (dbwrite - (ut, loop_a + mht->threadOffset, (char *)&unthread_ea, - sizeof(dbadr))) - return BUDB_IO; - goto done; - } - loop_a = ntohl(next_loop_a); - } - done: -#endif pentries = &mht->ht->entries; if (set_word_addr (ut, 0, &db.h, pentries, htonl(ntohl(mht->ht->entries) - 1))) diff --git a/src/budb/procs.c b/src/budb/procs.c index 6fbeb4c396..780262f0c1 100644 --- a/src/budb/procs.c +++ b/src/budb/procs.c @@ -1913,91 +1913,6 @@ FindClone(struct rx_call *call, afs_int32 dumpID, char *volName, return (code); } -#ifdef notdef -/* - * Searches each tape and each volume in the dump until the volume is found. - * If the volume is not in the dump, then we search it's parent dump. - * - * Re-write to do lookups by volume name. - */ -afs_int32 -FindClone(struct rx_call *call, afs_int32 dumpID, char *volName, - afs_int32 *clonetime) -{ - struct ubik_trans *ut; - dbadr diskAddr, tapeAddr, volFragmentAddr; - struct dump dump; - struct tape tape; - struct volFragment volFragment; - struct volInfo volInfo; - afs_int32 eval, code = 0; - - if (!callPermitted(call)) - return BUDB_NOTPERMITTED; - - eval = InitRPC(&ut, LOCKREAD, 1); - if (eval) - return (eval); - - *clonetime = 0; - - for (; dumpID; dumpID = ntohl(dump.parent)) { /*d */ - /* Get the dump entry */ - eval = ht_LookupEntry(ut, &db.dumpIden, &dumpID, &diskAddr, &dump); - if (eval) - ABORT(eval); - if (!diskAddr) - ABORT(BUDB_NODUMPID); - - /* just to be sure */ - if (ntohl(dump.id) != dumpID) { - LogDebug(4, "BUDB_FindClone: requested %d, found %d\n", dumpID, - ntohl(dump.id)); - ABORT(BUDB_INTERNALERROR); - } - - /* search all the tapes in this dump */ - for (tapeAddr = ntohl(dump.firstTape); tapeAddr; tapeAddr = ntohl(tape.nextTape)) { /*t */ - /* Get the tape entry */ - eval = dbread(ut, tapeAddr, &tape, sizeof(tape)); - if (eval) - ABORT(eval); - - /* search all the volume fragments on this tape */ - for (volFragmentAddr = ntohl(tape.firstVol); volFragmentAddr; volFragmentAddr = ntohl(volFragment.sameTapeChain)) { /*vf */ - /* Get the volume fragment entry */ - eval = - dbread(ut, volFragmentAddr, &volFragment, - sizeof(volFragment)); - if (eval) - ABORT(eval); - - /* Get the volume info entry */ - eval = - dbread(ut, ntohl(volFragment.vol), &volInfo, - sizeof(volInfo)); - if (eval) - ABORT(eval); - - /* check if this volume is the one we want */ - if (strcmp(volInfo.name, volName) == 0) { - *clonetime = ntohl(volFragment.clone); - ERROR(0); - } - } /*vf */ - } /*t */ - } /*d */ - - error_exit: - code = ubik_EndTrans(ut); - return (code); - - abort_exit: - ubik_EndTrans(ut); - return (code); -} -#endif - /* BUDB_FindDump * Find latest volume dump before adate. * Used by restore code when restoring a user requested volume(s) @@ -3693,86 +3608,6 @@ volFragsDump(struct ubik_trans *ut, FILE *dumpfid, dbadr dbAddr) return (0); } -#ifdef notdef -/* utilities - network to host conversion - * currently used for debug only - */ - -void -volFragmentDiskToHost(struct volFragment *diskVfPtr, - struct volFragment *hostVfPtr) -{ - hostVfPtr->vol = ntohl(diskVfPtr->vol); - hostVfPtr->sameNameChain = ntohl(diskVfPtr->sameNameChain); - hostVfPtr->tape = ntohl(diskVfPtr->tape); - hostVfPtr->sameTapeChain = ntohl(diskVfPtr->sameTapeChain); - hostVfPtr->position = ntohl(diskVfPtr->position); - hostVfPtr->clone = ntohl(diskVfPtr->clone); - hostVfPtr->incTime = ntohl(diskVfPtr->incTime); - hostVfPtr->startByte = ntohl(diskVfPtr->startByte); - hostVfPtr->nBytes = ntohl(diskVfPtr->nBytes); - hostVfPtr->flags = ntohs(diskVfPtr->flags); - hostVfPtr->sequence = ntohs(diskVfPtr->sequence); -} - -void -volInfoDiskToHost(struct volInfo *diskViPtr, struct volInfo *hostViPtr) -{ - strcpy(hostViPtr->name, diskViPtr->name); - hostViPtr->nameHashChain = ntohl(diskViPtr->nameHashChain); - hostViPtr->id = ntohl(diskViPtr->id); - strcpy(hostViPtr->server, diskViPtr->server); - hostViPtr->partition = ntohl(diskViPtr->partition); - hostViPtr->flags = ntohl(diskViPtr->flags); - hostViPtr->sameNameHead = ntohl(diskViPtr->sameNameHead); - hostViPtr->sameNameChain = ntohl(diskViPtr->sameNameChain); - hostViPtr->firstFragment = ntohl(diskViPtr->firstFragment); - hostViPtr->nFrags = ntohl(diskViPtr->nFrags); -} - -void -tapeDiskToHost(struct tape *diskTapePtr, struct tape *hostTapePtr) -{ - strcpy(hostTapePtr->name, diskTapePtr->name); - hostTapePtr->nameHashChain = ntohl(diskTapePtr->nameHashChain); - hostTapePtr->flags = ntohl(diskTapePtr->flags); - - /* tape id conversion here */ - hostTapePtr->written = ntohl(diskTapePtr->written); - hostTapePtr->nBytes = ntohl(diskTapePtr->nBytes); - hostTapePtr->nFiles = ntohl(diskTapePtr->nFiles); - hostTapePtr->nVolumes = ntohl(diskTapePtr->nVolumes); - hostTapePtr->seq = ntohl(diskTapePtr->seq); - hostTapePtr->dump = ntohl(diskTapePtr->dump); - hostTapePtr->nextTape = ntohl(diskTapePtr->nextTape); - hostTapePtr->firstVol = ntohl(diskTapePtr->firstVol); - hostTapePtr->useCount = ntohl(diskTapePtr->useCount); -} - -void -dumpDiskToHost(struct dump *diskDumpPtr, struct dump *hostDumpPtr) -{ - hostDumpPtr->id = ntohl(diskDumpPtr->id); - hostDumpPtr->idHashChain = ntohl(diskDumpPtr->idHashChain); - strcpy(hostDumpPtr->dumpName, diskDumpPtr->dumpName); - strcpy(hostDumpPtr->dumpPath, diskDumpPtr->dumpPath); - strcpy(hostDumpPtr->volumeSet, diskDumpPtr->volumeSet); - hostDumpPtr->nameHashChain = ntohl(diskDumpPtr->nameHashChain); - hostDumpPtr->flags = ntohl(diskDumpPtr->flags); - hostDumpPtr->parent = ntohl(diskDumpPtr->parent); - hostDumpPtr->created = ntohl(diskDumpPtr->created); -/* hostDumpPtr->incTime = ntohl(diskDumpPtr->incTime); */ - hostDumpPtr->nVolumes = ntohl(diskDumpPtr->nVolumes); - - /* tapeset conversion here */ - - hostDumpPtr->firstTape = ntohl(diskDumpPtr->firstTape); - - /* principal conversion here */ -} - -#endif /* notdef */ - int checkHash(struct ubik_trans *ut, int hashType) { diff --git a/src/butc/afsxbsa.c b/src/butc/afsxbsa.c index ee296bad8c..aee6b48e48 100644 --- a/src/butc/afsxbsa.c +++ b/src/butc/afsxbsa.c @@ -66,26 +66,6 @@ dsInt16_t (* AFSdsmRegisterFS)( dsUint32_t dsmHandle, regFSData *regFilespaceP); dsInt16_t (* AFSdsmBindMC)( dsUint32_t dsmHandle, dsmObjName *objNameP, dsmSendType sendType, mcBindKey *mcBindKeyP); dsInt16_t (* AFSdsmSendObj)( dsUint32_t dsmHandle, dsmSendType sendType, void *sendBuff, dsmObjName *objNameP, ObjAttr *objAttrPtr, DataBlk *dataBlkPtr); dsInt16_t (* AFSdsmChangePW)( dsUint32_t dsmHandle, char *oldPW, char *newPW); -#if 0 -dsInt16_t (* AFSdsmCleanUp)( dsBool_t mtFlag); -dsInt16_t (* AFSdsmDeleteAccess)( dsUint32_t dsmHandle, dsUint32_t ruleNum); -dsInt16_t (* AFSdsmDeleteFS)( dsUint32_t dsmHandle, char *fsName, dsUint8_t repository); -dsInt16_t (* AFSdsmEndGetDataEx)( dsmEndGetDataExIn_t *dsmEndGetDataExInP, dsmEndGetDataExOut_t *dsmEndGetDataExOutP); -dsInt16_t (* AFSdsmEndSendObjEx)( dsmEndSendObjExIn_t *dsmEndSendObjExInP, dsmEndSendObjExOut_t *dsmEndSendObjExOutP); -dsInt16_t (* AFSdsmEndTxnEx)( dsmEndTxnExIn_t *dsmEndTxnExInP, dsmEndTxnExOut_t *dsmEndTxnExOutP); -dsInt16_t (* AFSdsmGroupHandler)( dsmGroupHandlerIn_t *dsmGroupHandlerInP, dsmGroupHandlerOut_t *dsmGroupHandlerOutP); -dsInt16_t (* AFSdsmInitEx)( dsUint32_t *dsmHandleP, dsmInitExIn_t *dsmInitExInP, dsmInitExOut_t *dsmInitExOutP); -dsInt16_t (* AFSdsmLogEvent)( dsUint32_t dsmHandle, logInfo *lopInfoP); -dsInt16_t (* AFSdsmQueryAccess)( dsUint32_t dsmHandle, qryRespAccessData **accessListP, dsUint16_t *numberOfRules); -void (* AFSdsmQueryApiVersionEx)( dsmApiVersionEx *apiVersionP); -dsInt16_t (* AFSdsmQueryCliOptions)( optStruct *optstructP); -dsInt16_t (* AFSdsmQuerySessOptions)( dsUint32_t dsmHandle, optStruct *optstructP); -dsInt16_t (* AFSdsmRenameObj)( dsmRenameIn_t *dsmRenameInP, dsmRenameOut_t *dsmRenameOutP); -dsInt16_t (* AFSdsmSetAccess)( dsUint32_t dsmHandle, dsmAccessType accessType, dsmObjName *objNameP, char *node, char *owner); -dsInt16_t (* AFSdsmSetUp)( dsBool_t mtFlag, envSetUp *envSetUpPi); -dsInt16_t (* AFSdsmUpdateFS)( dsUint32_t dsmHandle, char *fs, dsmFSUpd *fsUpdP, dsUint32_t fsUpdAct); -dsInt16_t (* AFSdsmUpdateObj)( dsUint32_t dsmHandle, dsmSendType sendType, void *sendBuff, dsmObjName *objNameP, ObjAttr *objAttrPtr, dsUint32_t objUpdAct); -#endif /* <<< TSM function pointers. */ typedef struct s_delList { diff --git a/src/butc/recoverDb.c b/src/butc/recoverDb.c index 073fa24bf2..36abc56166 100644 --- a/src/butc/recoverDb.c +++ b/src/butc/recoverDb.c @@ -661,15 +661,6 @@ getScanTape(afs_int32 taskId, struct butm_tapeInfo *tapeInfoPtr, char *tname, /* If no name, accept any tape */ if (strcmp(tname, "") == 0) { break; /* Start scan on any tape */ -#ifdef notdef - if (curseq == 1) - break; /* The first tape */ - else { - TLog(taskId, "Expected first tape of dump, label seen %s\n", - gotname); - goto newtape; - } -#endif } if (strcmp(tname, tapeLabelPtr->AFSName) diff --git a/src/butc/tcmain.c b/src/butc/tcmain.c index 3d1a1f56eb..b7f1a91dc8 100644 --- a/src/butc/tcmain.c +++ b/src/butc/tcmain.c @@ -244,24 +244,6 @@ atocl(char *numstring, char crunit, afs_int32 *number) return (0); } -/* replace last two ocurrences of / by _ */ -#if 0 -static int -stringReplace(char *name) -{ - char *pos; - char buffer[256]; - - pos = strrchr(name, '/'); - *pos = '_'; - strcpy(buffer, pos); - pos = strrchr(name, '/'); - *pos = '\0'; - strcat(name, buffer); - return 0; -} -#endif - static int stringNowReplace(char *logFile, char *deviceName) { diff --git a/src/comerr/error_table_nt.c b/src/comerr/error_table_nt.c index 6bcef5b6c3..70c1408aa9 100755 --- a/src/comerr/error_table_nt.c +++ b/src/comerr/error_table_nt.c @@ -863,14 +863,6 @@ yyparse(YYPARSE_PARAM) yyerrdefault: /* current state does not do anything special for the error token. */ -#if 0 - /* This is wrong; only states that explicitly want error tokens - * should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it. */ - if (yyn) - goto yydefault; -#endif - yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) diff --git a/src/config/param.nbsd40.h b/src/config/param.nbsd40.h index d4b4730810..adb4ae6e6c 100644 --- a/src/config/param.nbsd40.h +++ b/src/config/param.nbsd40.h @@ -10,14 +10,6 @@ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ #define AFS_SYSCALL 318 /* 210 */ -#if 0 -/* including this file before sysincludes.h is canonical, but - * NBSD40's mount.h defines MOUNT_AFS */ -#ifndef MOUNT_AFS -#define MOUNT_AFS AFS_MOUNT_AFS -#endif -#endif - #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */ #define AFS_NBSD_ENV 1 diff --git a/src/config/param.nbsd50.h b/src/config/param.nbsd50.h index a65e5c9801..e8c1f07661 100644 --- a/src/config/param.nbsd50.h +++ b/src/config/param.nbsd50.h @@ -15,16 +15,6 @@ #define AFS_KFREE kmem_free #define VATTR_NULL vattr_null -#if 0 -/* including this file before sysincludes.h is canonical, but - * NBSD40's mount.h defines MOUNT_AFS */ - -#ifndef MOUNT_AFS -#define MOUNT_AFS AFS_MOUNT_AFS -#endif - -#endif /* 0 */ - #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */ #define AFS_NBSD_ENV 1 diff --git a/src/config/param.nbsd60.h b/src/config/param.nbsd60.h index 196e9d40b3..29519c82d2 100644 --- a/src/config/param.nbsd60.h +++ b/src/config/param.nbsd60.h @@ -15,16 +15,6 @@ #define AFS_KFREE kmem_free #define VATTR_NULL vattr_null -#if 0 -/* including this file before sysincludes.h is canonical, but - * NBSD40's mount.h defines MOUNT_AFS */ - -#ifndef MOUNT_AFS -#define MOUNT_AFS AFS_MOUNT_AFS -#endif - -#endif /* 0 */ - #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */ #define AFS_NBSD_ENV 1 diff --git a/src/config/param.nbsd70.h b/src/config/param.nbsd70.h index f01ecb9b4f..4395bab05a 100644 --- a/src/config/param.nbsd70.h +++ b/src/config/param.nbsd70.h @@ -15,16 +15,6 @@ #define AFS_KFREE kmem_free #define VATTR_NULL vattr_null -#if 0 -/* including this file before sysincludes.h is canonical, but - * NBSD40's mount.h defines MOUNT_AFS */ - -#ifndef MOUNT_AFS -#define MOUNT_AFS AFS_MOUNT_AFS -#endif - -#endif /* 0 */ - #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */ #define AFS_NBSD_ENV 1 diff --git a/src/config/param.sgi_65.h b/src/config/param.sgi_65.h index 389bc8f713..35961964b1 100644 --- a/src/config/param.sgi_65.h +++ b/src/config/param.sgi_65.h @@ -62,16 +62,6 @@ #define AFS_SGI_XFS_IOPS_ENV 1 /* turns on XFS inode ops. */ #define AFS_64BIT_IOPS_ENV 1 /* inode ops expect 64 bit inodes */ -/* Vnode size and access differs between Octane and Origin. The number - * can be used to indicate which altername vnodeX_t to use for future - * changes. - */ -#ifdef notdef -/* SGI may have cleared this problem up. */ -#define AFS_SGI_VNODE_GLUE 1 -#endif - - /* File system entry (used if mount.h doesn't define MOUNT_AFS */ #define AFS_MOUNT_AFS "afs" diff --git a/src/config/param.sun4x_510.h b/src/config/param.sun4x_510.h index 7225b56e7d..6a5e06113c 100644 --- a/src/config/param.sun4x_510.h +++ b/src/config/param.sun4x_510.h @@ -122,10 +122,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 65 diff --git a/src/config/param.sun4x_511.h b/src/config/param.sun4x_511.h index 714aa0ff70..256e89e7af 100644 --- a/src/config/param.sun4x_511.h +++ b/src/config/param.sun4x_511.h @@ -126,10 +126,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ /* so we get _IOW() when we include sys/ioctl.h */ diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h index fff3b841cf..4de40e7e1d 100644 --- a/src/config/param.sun4x_58.h +++ b/src/config/param.sun4x_58.h @@ -120,10 +120,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 65 diff --git a/src/config/param.sun4x_59.h b/src/config/param.sun4x_59.h index a80573c21e..ad50f364b3 100644 --- a/src/config/param.sun4x_59.h +++ b/src/config/param.sun4x_59.h @@ -122,10 +122,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 65 diff --git a/src/config/param.sunx86_510.h b/src/config/param.sunx86_510.h index af43b1e3dc..e0ce3871f2 100644 --- a/src/config/param.sunx86_510.h +++ b/src/config/param.sunx86_510.h @@ -132,10 +132,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 65 diff --git a/src/config/param.sunx86_511.h b/src/config/param.sunx86_511.h index c94bd81008..1ac462ead7 100644 --- a/src/config/param.sunx86_511.h +++ b/src/config/param.sunx86_511.h @@ -135,10 +135,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ /* so we get _IOW() when we include sys/ioctl.h */ diff --git a/src/config/param.sunx86_58.h b/src/config/param.sunx86_58.h index 246e99d05d..9f9ffec737 100644 --- a/src/config/param.sunx86_58.h +++ b/src/config/param.sunx86_58.h @@ -129,10 +129,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 65 diff --git a/src/config/param.sunx86_59.h b/src/config/param.sunx86_59.h index 8eb9a15e2f..4875e3c50f 100644 --- a/src/config/param.sunx86_59.h +++ b/src/config/param.sunx86_59.h @@ -133,10 +133,6 @@ #include -#if 0 -#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */ -#endif - #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 65 diff --git a/src/config/stds.h b/src/config/stds.h index 01b0a1bb2a..c54697e927 100644 --- a/src/config/stds.h +++ b/src/config/stds.h @@ -128,30 +128,6 @@ typedef afs_uint32 afs_uintmax_t; * some assistence in this matter. The hyper type is supposed to be compatible * with the afsHyper type: the same macros will work on both. */ -#if 0 - -typedef unsigned long afs_hyper_t; - -#define hcmp(a,b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0)) -#define hsame(a,b) ((a) == (b)) -#define hiszero(a) ((a) == 0) -#define hfitsin32(a) ((a) & 0xffffffff00000000) == 0) -#define hset(a,b) ((a) = (b)) -#define hzero(a) ((a) = 0) -#define hones(a) ((a) = ~((unsigned long)0)) -#define hget32(i,a) ((i) = (unsigned int)(a)) -#define hget64(hi,lo,a) ((lo) = ((unsigned int)(a)), (hi) = ((a) & (0xffffffff00000000))) -#define hset32(a,i) ((a) = ((unsigned int)(i))) -#define hset64(a,hi,lo) ((a) = (((hi) << 32) | (lo))) -#define hgetlo(a) ((a) & 0xffffffff) -#define hgethi(a) (((unsigned int)(a)) >> 32) -#define hadd(a,b) ((a) += (b)) -/* XXX */ -#define hadd32(a,b) ((a) += (b)) -#define hshlft(a,n) ((a)<<(n)) - -#else /* 0*/ - typedef struct afs_hyper_t { /* unsigned 64 bit integers */ unsigned int high; unsigned int low; @@ -199,7 +175,6 @@ typedef struct afs_hyper_t { /* unsigned 64 bit integers */ (a).low += (int)(i)) #define hadd(a,b) (hadd32(a,(b).low), (a).high += (b).high) -#endif /* 0 */ #if !defined(KERNEL) || defined(UKERNEL) #ifndef AFS_NT40_ENV diff --git a/src/export/cfgafs.c b/src/export/cfgafs.c index 5f55fb10f4..fdc8c4d0b2 100644 --- a/src/export/cfgafs.c +++ b/src/export/cfgafs.c @@ -111,9 +111,6 @@ main(argc, argv) sysconfig(SYS_KULOAD, &cload, sizeof(cload)); exit(1); } -#ifdef notdef - printf("cfgafs -d 0x%x # to remove AFS\n", cload.kmid); -#endif strcpy(PidFile, file); strcat(PidFile, ".kmid"); fp = fopen(PidFile, "w"); diff --git a/src/export/cfgexport.c b/src/export/cfgexport.c index 762b7ebe28..f4ab5d5a25 100644 --- a/src/export/cfgexport.c +++ b/src/export/cfgexport.c @@ -420,16 +420,6 @@ xlate_xtok(xp, kp, strp, szp) while (len >= left) { fprintf(stderr, "cfgexport: Out of memory. Increase SYMBUFSIZE and recompile\n"); exit(1); -#if 0 - /* Something is broken with this code, after being here - cfgexport segfaults */ - export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE); - if (!export_strings) - error("no memory for EXPORT string table"); - *strp = export_strings; - left += SYMBUFSIZE; - prev = ""; /* lazy */ -#endif } strcpy(prev = *strp + offset, xstrings + xp->n_offset); diff --git a/src/export/export.c b/src/export/export.c index c02ee66290..5aacec725c 100644 --- a/src/export/export.c +++ b/src/export/export.c @@ -165,9 +165,6 @@ import_kfunc(struct k_func * kfp) { sym_t *sym; int i, pri; -#if 0 - static caddr_t *g_toc; -#endif if (!myg_toc) { #ifdef __XCOFF64__ diff --git a/src/gtx/curses_test.c b/src/gtx/curses_test.c index c2710d1fbf..7c1fd7fa8a 100644 --- a/src/gtx/curses_test.c +++ b/src/gtx/curses_test.c @@ -51,14 +51,6 @@ main(argc, argv) refresh(); standend(); -#if 0 - box addstr("Enter a string and a number: "); - refresh(); - scanw(stdscr, "%s %d", str, &i); - wprintw(stdscr, "String was '%s', number was %d\n", str, i); - refresh(); -#endif /* 0 */ - endwin(); } /*main */ diff --git a/src/gtx/gtxX11win.h b/src/gtx/gtxX11win.h index f911b9709e..8527809f1c 100644 --- a/src/gtx/gtxX11win.h +++ b/src/gtx/gtxX11win.h @@ -15,17 +15,6 @@ /*Value for gwin w_type field*/ #define GATOR_WIN_X11 3 -/*Private data for a X11 gwin*/ -#if 0 -struct gator_X11gwin { - WINDOW *wp; /*Window pointer */ - int charwidth; /*Character width in pixels */ - int charheight; /*Character height in pixels */ - char box_vertchar; /*Vertical char for boxing purposes */ - char box_horizchar; /*Horizontal char for boxing purposes */ -}; -#endif /* 0 */ - /*X11 gwin's creation parameters*/ struct gator_X11gwin_params { struct gwin_createparams gwin_params; /*Basic params for the window */ diff --git a/src/gtx/gtxdumbwin.h b/src/gtx/gtxdumbwin.h index dc0789e59d..0d5f8500f1 100644 --- a/src/gtx/gtxdumbwin.h +++ b/src/gtx/gtxdumbwin.h @@ -15,17 +15,6 @@ /*Value for gwin w_type field*/ #define GATOR_WIN_DUMB 1 -/*Private data for a dumb gwin*/ -#if 0 -struct gator_dumbgwin { - WINDOW *wp; /*Window pointer */ - int charwidth; /*Character width in pixels */ - int charheight; /*Character height in pixels */ - char box_vertchar; /*Vertical char for boxing purposes */ - char box_horizchar; /*Horizontal char for boxing purposes */ -}; -#endif /* 0 */ - /*Dumb gwin's creation parameters*/ struct gator_dumbgwin_params { struct gwin_createparams gwin_params; /*Basic params for the window */ diff --git a/src/gtx/object_test.c b/src/gtx/object_test.c index ad6ce97de7..2b26d0c448 100644 --- a/src/gtx/object_test.c +++ b/src/gtx/object_test.c @@ -66,12 +66,6 @@ test_objects(pkg) int code; /*Return code */ struct onode_initparams oi_params; /*Init params */ struct gwin_initparams wi_params; /*Window initialization params */ -#if 0 - /*We don't need these, do we? */ - struct gator_cursesgwin_params c_crparams; /*Curses window creation params */ - struct gator_dumbgwin_params d_crparams; /*Dumb terminal window creation params */ - struct gator_X11gwin_params x_crparams; /*X11 window creation params */ -#endif /* 0 */ struct gator_light_crparams light_crparams; /*Light creation params */ char helpstring1[128]; /*Help string to use */ char helpstring2[128]; /*Help string to use */ diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index 9ec57062ec..769a9a9ace 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -1546,47 +1546,6 @@ ForgetTicket(struct cmd_syndesc *as, void *arock) { afs_int32 code; -#ifdef notdef - struct ktc_principal server; - - if (as->parms[0].items) { - char *name = as->parms[0].items->data; - code = - ka_ParseLoginName(name, server.name, server.instance, - server.cell); - if (code) { - afs_com_err(whoami, code, "couldn't interpret name '%s'", name); - return code; - } - if (server.cell[0] == 0) { - if (code = DefaultCell()) - return code; - strcpy(server.cell, cell); - } else { - code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ ); - if (code) { - afs_com_err(whoami, code, "Can't expand cell name"); - return code; - } - } - code = ktc_ForgetToken(&server); - if (code) { - afs_com_err(whoami, code, "couldn't remove tokens for %s", - PrintedPrincipal(&server)); - return code; - } - } else { - if (!as->parms[1].items) { - fprintf(stderr, "Must specify server name or -all\n"); - return KABADCMD; - } - code = ktc_ForgetAllTokens(); - if (code) { - afs_com_err(whoami, code, "couldn't delete all tokens"); - return code; - } - } -#endif code = ktc_ForgetAllTokens(); if (code) { afs_com_err(whoami, code, "couldn't delete all tokens"); @@ -1790,10 +1749,6 @@ ka_AdminInteractive(int cmd_argc, char *cmd_argv[]) ts = cmd_CreateSyntax("forgetticket", ForgetTicket, NULL, 0, "delete user's tickets"); -#ifdef notdef - cmd_AddParm(ts, "-name", CMD_SINGLE, (CMD_OPTIONAL | CMD_HIDE), - "name of server"); -#endif cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all tickets"); ts = cmd_CreateSyntax("listtickets", ListTickets, NULL, 0, diff --git a/src/kauth/crypt.c b/src/kauth/crypt.c index 45ea6189fc..6de8dfe340 100644 --- a/src/kauth/crypt.c +++ b/src/kauth/crypt.c @@ -908,62 +908,6 @@ init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS], } } -/* - * "setkey" routine (for backwards compatibility) - */ -#if 0 /* static and doesn't appear to be referenced */ -STATIC int -setkey(key) - const char *key; -{ - int i, j, k; - C_block keyblock; - - for (i = 0; i < 8; i++) { - k = 0; - for (j = 0; j < 8; j++) { - k <<= 1; - k |= (unsigned char)*key++; - } - keyblock.b[i] = k; - } - return (des_setkey((char *)keyblock.b)); -} -#endif - -#if 0 -/* - * "encrypt" routine (for backwards compatibility) - */ -int -encrypt(block, flag) - char *block; - int flag; -{ - int i, j, k; - C_block cblock; - - for (i = 0; i < 8; i++) { - k = 0; - for (j = 0; j < 8; j++) { - k <<= 1; - k |= (unsigned char)*block++; - } - cblock.b[i] = k; - } - if (des_cipher((char *)&cblock, (char *)&cblock, 0L, (flag ? -1 : 1))) - return (1); - for (i = 7; i >= 0; i--) { - k = cblock.b[i]; - for (j = 7; j >= 0; j--) { - *--block = k & 01; - k >>= 1; - } - } - return (0); -} -#endif - #ifdef CRYPT_DEBUG STATIC prtab(char *s, unsigned char *t, int num_rows) diff --git a/src/kauth/kadatabase.c b/src/kauth/kadatabase.c index 78f4900941..c63f643ef8 100644 --- a/src/kauth/kadatabase.c +++ b/src/kauth/kadatabase.c @@ -933,17 +933,3 @@ name_instance_legal(char *name, char *instance) dynamic_statistics.string_checks++; return code; } - -#if 0 -static int -string_legal(char *str, char *map) -{ - int slen; - - slen = strlen(str); - if (slen >= MAXKTCNAMELEN) - return 0; /* with trailing null must fit in data base */ - return (slen == strspn(str, map)); /* strspn returns length(str) if all chars in map */ -} -#endif - diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index 1c6c68f972..ded2d9616a 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -1144,15 +1144,6 @@ Authenticate(int version, struct rx_call *call, char *aname, char *ainstance, #endif /* EXPIREPW */ if (check_ka_skew(request.time, now, KTC_TIME_UNCERTAINTY)) { -#if 0 - if (oanswer->MaxSeqLen < sizeof(afs_int32)) - code = KAANSWERTOOLONG; - else { /* return our time if possible */ - oanswer->SeqLen = sizeof(afs_int32); - request.time = htonl(now); - memcpy(oanswer->SeqBody, &request.time, sizeof(afs_int32)); - } -#endif code = KACLOCKSKEW; goto abort; } diff --git a/src/kauth/kpasswd.c b/src/kauth/kpasswd.c index fbe9cbf546..f83e799d7d 100644 --- a/src/kauth/kpasswd.c +++ b/src/kauth/kpasswd.c @@ -155,21 +155,6 @@ read_pass(char *passwd, int len, char *prompt, int verify) return code; } -#if 0 -static int -password_ok(char *newpw, int *insist) -{ - if (insist == 0) { - /* see if it is reasonable, but don't get so obnoxious */ - /* FIXME: null pointer derefence!!! */ - (*insist)++; /* so we don't get called again */ - if (strlen(newpw) < 6) - return 0; - } - return 1; /* lie about it */ -} -#endif - static char rn[] = "kpasswd"; /* Routine name */ static int Pipe = 0; /* reading from a pipe */ @@ -474,13 +459,6 @@ CommandProc(struct cmd_syndesc *as, void *arock) memset(passwd, 0, sizeof(passwd)); code = ka_GetAdminToken(pw->pw_name, instance, realm, &key, ADMIN_LIFETIME, &token, /*!new */ 0); -#ifdef notdef - /* the folks in testing really *hate* this message */ - if (code == 0) { - fprintf(stderr, - "Warning: only the first 8 characters of your old password were significant.\n"); - } -#endif if (code == 0) { if (dess2k == -1) dess2k = 0; diff --git a/src/libadmin/test/bos.c b/src/libadmin/test/bos.c index 92b25cba60..badf34b4ba 100644 --- a/src/libadmin/test/bos.c +++ b/src/libadmin/test/bos.c @@ -1789,22 +1789,6 @@ DoBosSalvage(struct cmd_syndesc *as, void *arock) return 0; } -#if 0 -static void -Print_afs_RPCStatsState_p(afs_RPCStatsState_p state, const char *prefix) -{ - printf("%sThe rpc stats state is: ", prefix); - switch (*state) { - case AFS_RPC_STATS_DISABLED: - printf("disabled\n"); - break; - case AFS_RPC_STATS_ENABLED: - printf("enabled\n"); - break; - } -} -#endif - void SetupBosAdminCmd(void) { diff --git a/src/libadmin/test/vos.c b/src/libadmin/test/vos.c index 43312567ba..dd51425c5b 100644 --- a/src/libadmin/test/vos.c +++ b/src/libadmin/test/vos.c @@ -135,14 +135,6 @@ GetAddressFromString(const char *addr_str) return ntohl(addr); } -#if 0 -static void -PrintMessage(vos_messageType_t type, char *message) -{ - printf("%s\n", message); -} -#endif - int DoVosBackupVolumeCreate(struct cmd_syndesc *as, void *arock) { diff --git a/src/libadmin/vos/vsprocs.c b/src/libadmin/vos/vsprocs.c index f565019cfc..f22f42f0bc 100644 --- a/src/libadmin/vos/vsprocs.c +++ b/src/libadmin/vos/vsprocs.c @@ -1181,109 +1181,6 @@ DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part, #define ONERROR(ec, ep, es) if (ec) { fprintf(STDERR, (es), (ep)); error = (ec); goto rfail; } #define ERROREXIT(ec) { error = (ec); goto rfail; } -#if 0 /* doesn't appear to be used, why compile it */ -static int -CloneVol(afs_cell_handle_p cellHandle, struct rx_connection *conn, - afs_uint32 rwvid, afs_int32 part, afs_uint32 * rovidp, int nottemp, - struct nvldbentry *entry, afs_int32 * vidCreateDate, afs_status_p st) -{ - int rc = 0; - afs_status_t tst = 0, etst = 0; - afs_int32 rcode = 0, tid = 0; - struct volser_status volstatus; - char vname[64]; - - /* Begin transaction on RW volume marking it busy (clients will wait) */ - tst = AFSVolTransCreate(conn, rwvid, part, ITBusy, &tid); - if (tst) { - goto fail_CloneVol; - } - - /* Get the RO volume id. Allocate a new one if need to */ - *rovidp = entry->volumeId[ROVOL]; - if (*rovidp == INVALID_BID) { - tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, rovidp); - if (tst) { - goto fail_CloneVol; - } - - entry->volumeId[ROVOL] = *rovidp; - } - - /* If we are creating the ro clone, what are we calling it. - * Depends on whether its a temporary clone or not. - */ - if (nottemp) { - strcpy(vname, entry->name); - strcat(vname, ".readonly"); - } else { - strcpy(vname, "readonly-clone-temp"); /* Should be unique? */ - } - - /* Create the new clone. If it exists, then reclone it */ - tst = AFSVolClone(conn, tid, 0, readonlyVolume, vname, rovidp); - if (tst == VVOLEXISTS) { - tst = AFSVolReClone(conn, tid, *rovidp); - if (tst) { - goto fail_CloneVol; - } - } - if (tst) { - goto fail_CloneVol; - } - - /* Bring the volume back on-line as soon as possible */ - if (nottemp) { - afs_int32 fromtid = 0; - - /* Now bring the RO clone on-line */ - tst = AFSVolTransCreate(conn, *rovidp, part, ITOffline, &fromtid); - if (tst) { - goto fail_CloneVol; - } - - tst = AFSVolSetFlags(conn, fromtid, 0); - if (tst) { - goto fail_CloneVol; - } - - tst = AFSVolEndTrans(conn, fromtid, &rcode); - fromtid = 0; - if (!tst) - tst = rcode; - if (tst) { - goto fail_CloneVol; - } - } - - /* Get the time the RW was created for return information */ - tst = AFSVolGetStatus(conn, tid, &volstatus); - if (tst) { - goto fail_CloneVol; - } - *vidCreateDate = volstatus.creationDate; - rc = 1; - - fail_CloneVol: - - if (tid) { - tst = AFSVolEndTrans(conn, tid, &rcode); - tid = 0; - if (!tst) - tst = rcode; - if (tst) { - rc = 0; - goto fail_CloneVol; - } - } - - if (st != NULL) { - *st = tst; - } - return rc; -} -#endif - /* Get a "transaction" on this replica. Create the volume * if necessary. Return the time from which a dump should * be made (0 if it's a new volume) diff --git a/src/lwp/lock.h b/src/lwp/lock.h index c0081fba33..f0f0efc18b 100644 --- a/src/lwp/lock.h +++ b/src/lwp/lock.h @@ -167,15 +167,6 @@ void Lock_Destroy(struct Lock *lock); LOCK_UNLOCK(lock); \ ENDMAC -#ifdef notdef -/* this is what UnboostSharedLock looked like before the hi-C compiler */ -/* this must only be called with a WRITE or boosted SHARED lock! */ -#define UnboostSharedLock(lock)\ - ((lock)->excl_locked = SHARED_LOCK,\ - ((lock)->wait_states ?\ - Afs_Lock_ReleaseR(lock) : 0)) -#endif /* notdef */ - #define ReleaseReadLock(lock)\ BEGINMAC\ LOCK_LOCK(lock); \ @@ -185,15 +176,6 @@ void Lock_Destroy(struct Lock *lock); ENDMAC -#ifdef notdef -/* This is what the previous definition should be, but the hi-C compiler generates - a warning for each invocation */ -#define ReleaseReadLock(lock)\ - (!--(lock)->readers_reading && (lock)->wait_states ?\ - Afs_Lock_ReleaseW(lock) :\ - 0) -#endif /* notdef */ - #define ReleaseWriteLock(lock)\ BEGINMAC\ LOCK_LOCK(lock); \ @@ -202,15 +184,6 @@ void Lock_Destroy(struct Lock *lock); LOCK_UNLOCK(lock); \ ENDMAC -#ifdef notdef -/* This is what the previous definition should be, but the hi-C compiler generates - a warning for each invocation */ -#define ReleaseWriteLock(lock)\ - ((lock)->excl_locked &= ~WRITE_LOCK,\ - ((lock)->wait_states ?\ - Afs_Lock_ReleaseR(lock) : 0)) -#endif /* notdef */ - /* can be used on shared or boosted (write) locks */ #define ReleaseSharedLock(lock)\ BEGINMAC\ @@ -220,16 +193,6 @@ void Lock_Destroy(struct Lock *lock); LOCK_UNLOCK(lock); \ ENDMAC -#ifdef notdef -/* This is what the previous definition should be, but the hi-C compiler generates - a warning for each invocation */ -/* can be used on shared or boosted (write) locks */ -#define ReleaseSharedLock(lock)\ - ((lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK),\ - ((lock)->wait_states ?\ - Afs_Lock_ReleaseR(lock) : 0)) -#endif /* notdef */ - /* convert a write lock to a read lock */ #define ConvertWriteToReadLock(lock)\ BEGINMAC\ diff --git a/src/lwp/test/selserver.c b/src/lwp/test/selserver.c index a459ba94ce..c60b6e2051 100644 --- a/src/lwp/test/selserver.c +++ b/src/lwp/test/selserver.c @@ -322,13 +322,6 @@ handleRequest(char *arg) Log("Probed from client at %s\n", inet_ntoa(ch->ch_addr.sin_addr)); break; -#ifdef notdef - case SC_OOB: - nThreads--; - ch->ch_fd = 0; - ch->ch_state = CH_FREE; - return; -#endif case SC_WRITE: handleWrite(ch, &sc); break; diff --git a/src/platform/DARWIN/AFSPreference/Krb5Util.m b/src/platform/DARWIN/AFSPreference/Krb5Util.m index b6050d0fd7..d9cc88c453 100644 --- a/src/platform/DARWIN/AFSPreference/Krb5Util.m +++ b/src/platform/DARWIN/AFSPreference/Krb5Util.m @@ -176,13 +176,6 @@ KLPrincipal klprinc = nil; kstatus = KLRenewInitialTickets ( klprinc, inLoginOptions, nil, nil); #endif - -#if 0 - /* handoff to growl agent? */ - kstatus = KLTicketExpirationTime (nil, kerberosVersion_All, &expireStartTime); - expirationDate = [NSDate dateWithTimeIntervalSince1970:expireStartTime]; - BuildNotificationInfo(@"Ticket Renewed Unitl %@", expirationDate, callbackInfo->dcref, callbackInfo->regref, callbackInfo->icon); -#endif } } @catch (NSException * e) { diff --git a/src/platform/DARWIN/growlagent/main.m b/src/platform/DARWIN/growlagent/main.m index a39f77a2b6..89e848b79c 100644 --- a/src/platform/DARWIN/growlagent/main.m +++ b/src/platform/DARWIN/growlagent/main.m @@ -118,10 +118,6 @@ BuildNotificationInfo(char *recvbuf, CFNotificationCenterRef dcref, CFDictionary CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_CLICK_CONTEXT, clickContext); CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_TITLE, CFSTR("OpenAFS")/*title*/); //CFRelease(title); -#if 0 - /* if fetching ever provides more data we could use this */ - CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_PROGRESS, progressNumber); -#endif if (!strncmp(recvbuf, FETCHSTR, sizeof(FETCHSTR)-1)) { CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_DESCRIPTION, CFStringCreateWithCString(kCFAllocatorDefault, recvbuf+FETCHOFFT, kCFStringEncodingUTF8)); priority = -1; diff --git a/src/ptserver/ptclient.c b/src/ptserver/ptclient.c index ef613f0630..a368e61411 100644 --- a/src/ptserver/ptclient.c +++ b/src/ptserver/ptclient.c @@ -303,16 +303,6 @@ main(int argc, char **argv) printf("%s\n", pr_ErrorMsg(code)); if (code == PRSUCCESS) { PrintEntry(pos, &entry, /*indent */ 0); -#if 0 - printf("The contents of the entry for %d are:\n", entry.id); - printf("flags %d next %d\n", entry.flags, entry.next); - printf("Groups (or members) \n"); - for (i = 0; i < PRSIZE; i++) - printf("%d\n", entry.entries[i]); - printf("nextID %d nextname %d name %s\n", entry.nextID, - entry.nextName, entry.name); - printf("owner %d creator %d\n", entry.owner, entry.creator); -#endif } } else if (!strcmp(op, "add") || !strcmp(op, "au")) { /* scanf("%d %d",&id,&gid); */ diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index f6fb751e11..6b0277da3b 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -439,15 +439,6 @@ dumpEntry(struct rx_call *call, afs_int32 apos, struct prdebugentry *aentry, if (!AccessOK(tt, *cid, 0, PRP_STATUS_MEM, 0)) ABORT_WITH(tt, PRPERM); - /* Since prdebugentry is in the form of a prentry not a coentry, we will - * return the coentry slots in network order where the string is. */ -#if 0 - if (aentry->flags & PRCONT) { /* wrong type, get coentry instead */ - code = pr_ReadCoEntry(tt, 0, apos, aentry); - if (code) - ABORT_WITH(tt, code); - } -#endif code = ubik_EndTrans(tt); if (code) return code; diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index aa1f4152b4..2896faa30e 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -385,98 +385,6 @@ CreateUser(struct cmd_syndesc *as, void *arock) } -#ifdef notdef -static int -GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, struct namelist *lnames) -{ - afs_int32 code = 0; - int n = 0; - struct cmd_item *i; - int goodCount; - - if (!(as->parms[0].items || as->parms[1].items)) { - afs_com_err(whoami, 0, "must specify either a name or an id."); - return -1; - } - if (as->parms[0].items && as->parms[1].items) { - afs_com_err(whoami, 0, "can't specify both a name and id."); - return -1; - } - - goodCount = 0; - lids->idlist_len = 0; - lids->idlist_val = 0; - - if (as->parms[0].items) { /* name */ - struct namelist names; /* local copy, if not ret. names */ - struct namelist *nl; - - names.namelist_val = 0; /* so it gets freed later if needed */ - if (lnames) - nl = lnames; - else - nl = &names; - - n = 0; /* count names */ - for (i = as->parms[0].items; i; i = i->next) - n++; - nl->namelist_val = malloc(n * PR_MAXNAMELEN); - nl->namelist_len = n; - n = 0; - for (i = as->parms[0].items; i; i = i->next) - strncpy(nl->namelist_val[n++], i->data, PR_MAXNAMELEN); - - code = pr_NameToId(nl, lids); - if (code) - afs_com_err(whoami, code, "so couldn't look up names"); - else { - for (n = 0; n < lids->idlist_len; n++) { - if ((lids->idlist_val[n] == ANONYMOUSID)) { - afs_com_err(whoami, PRNOENT, "so couldn't look up id for %s", - nl->namelist_val[n]); - } else - goodCount++; - } - /* treat things as working if any of the lookups worked */ - if (goodCount == 0) - code = PRNOENT; - } - - if (names.namelist_val) - free(names.namelist_val); - } else if (as->parms[1].items) { /* id */ - n = 0; - for (i = as->parms[1].items; i; i = i->next) - n++; - lids->idlist_val = malloc(n * sizeof(afs_int32)); - lids->idlist_len = n; - n = 0; - for (i = as->parms[1].items; i; i = i->next) { - code = util_GetInt32(i->data, &lids->idlist_val[n]); - if (code) - afs_com_err(whoami, code = - PRNOENT, "because a bogus id '%s' was specified", - i->data); - n++; - } - if (!code && lnames) { - lnames->namelist_val = 0; - lnames->namelist_len = 0; - code = pr_IdToName(lids, lnames); - if (code) - afs_com_err(whoami, code, "translating ids"); - } - } - if (code) { - if (lids->idlist_val) - free(lids->idlist_val); - return -1; - } - return 0; -} -#endif - - static int GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, struct namelist *lnames) diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c index 3888718e23..eaaee48f14 100644 --- a/src/ptserver/testpt.c +++ b/src/ptserver/testpt.c @@ -445,18 +445,6 @@ TestManyMembers(struct cmd_syndesc *as, void *arock) if ((code == 0) && (callerId == ANONYMOUSID)) code = PRNOENT; } -#if 0 /* don't create user */ - if (code == PRNOENT) { - callerId = 0; - code = pr_CreateUser(callerName, &callerId); - if (code) { - afs_com_err(whoami, code, "can't create caller %s", callerName); - exit(5); - } - printf("Creating caller %s (%di)\n", callerName, callerId); - } - /* else */ -#endif if (code) { afs_com_err(whoami, code, "can't find caller %s", callerName); exit(6); diff --git a/src/rx/AIX/rx_knet.c b/src/rx/AIX/rx_knet.c index 6ac9cdffa8..54a6c85836 100644 --- a/src/rx/AIX/rx_knet.c +++ b/src/rx/AIX/rx_knet.c @@ -200,21 +200,6 @@ rxk_RX_input(struct mbuf *am) m_freem(am); return; } -#else -#ifdef notdef - { /* in_cksum() doesn't work correctly or the length is wrong? */ - int cksum; - int glockOwner = ISAFS_GLOCK(); - cksum = in_cksum(am, sizeof(struct ip) + tlen); - if (!glockOwner) - AFS_GLOCK(); - afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE, ICL_TYPE_STRING, - __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_INT32, - cksum); - if (!glockOwner) - AFS_GUNLOCK(); - } -#endif #endif } diff --git a/src/rx/FBSD/rx_knet.c b/src/rx/FBSD/rx_knet.c index 1e8a013c98..87561d30ff 100644 --- a/src/rx/FBSD/rx_knet.c +++ b/src/rx/FBSD/rx_knet.c @@ -197,11 +197,6 @@ rxk_init() last = inetdomain.dom_protoswNPROTOSW; for (tpro = inetdomain.dom_protosw; tpro < last; tpro++) if (tpro->pr_protocol == IPPROTO_UDP) { -#if 0 /* not exported */ - /* force UDP checksumming on for AFS */ - extern int udpcksum; - udpcksum = 1; -#endif memcpy(&parent_proto, tpro, sizeof(parent_proto)); tpro->pr_input = rxk_input; tpro->pr_fasttimo = rxk_fasttimo; diff --git a/src/rx/HPUX/rx_kmutex.h b/src/rx/HPUX/rx_kmutex.h index 89ebaf0232..0eeb79e68a 100644 --- a/src/rx/HPUX/rx_kmutex.h +++ b/src/rx/HPUX/rx_kmutex.h @@ -73,48 +73,6 @@ extern lock_t *rx_sleepLock; } while(0) -#if 0 -#define CV_WAIT(cv, lck) \ - do { \ - int code; \ - ksleep_prepare(); \ - MP_SPINLOCK(rx_sleepLock); \ - if (!b_owns_sema(lck)) \ - osi_Panic("mutex not held \n"); \ - b_vsema(lck); \ - code = ksleep_one(PCATCH | KERNEL_ADDRESS | KERN_SPINLOCK_OBJECT, \ - (cv), rx_sleepLock, 0); \ - if (code) { \ - if (code == EINTR) { /* lock still held */ \ - MP_SPINUNLOCK(rx_sleepLock); \ - } else if (code != -EINTR) { \ - osi_Panic("ksleep_one failed: code = %d \n", code); \ - } \ - } \ - b_psema(lck); /* grab the mutex again */ \ - } while(0) - -/* Wakes up a thread waiting on this condition */ -#define CV_SIGNAL(cv) \ - do { \ - int wo, code; \ - MP_SPINLOCK(rx_sleepLock); \ - if ((code = kwakeup_one(KERNEL_ADDRESS, (cv), WAKEUP_ONE, &wo)) < 0) \ - osi_Panic("kwakeup_one failed: code = %d \n", code); \ - MP_SPINUNLOCK(rx_sleepLock); \ - } while (0) - -/* Wakes up all threads waiting on this condition */ -#define CV_BROADCAST(cv) \ - do { \ - int wo, code; \ - MP_SPINLOCK(rx_sleepLock); \ - if ((code = kwakeup_one(KERNEL_ADDRESS, (cv), WAKEUP_ALL, &wo)) < 0) \ - osi_Panic("kwakeup_all failed: code = %d \n", code); \ - MP_SPINUNLOCK(rx_sleepLock); \ - } while (0) -#endif /* 0 */ - #define CV_DESTROY(a) /* We now use beta semaphores for mutexes */ diff --git a/src/rx/NBSD/rx_knet.c b/src/rx/NBSD/rx_knet.c index 6ee14101bb..4d6a205042 100644 --- a/src/rx/NBSD/rx_knet.c +++ b/src/rx/NBSD/rx_knet.c @@ -39,9 +39,6 @@ osi_NetReceive(osi_socket asocket, struct sockaddr_in *addr, u.uio_resid = *alength; UIO_SETUP_SYSSPACE(&u); u.uio_rw = UIO_READ; -#if 0 - u.uio_procp = NULL; -#endif if (glocked) AFS_GUNLOCK(); code = soreceive(asocket, (addr ? &nam : NULL), &u, NULL, NULL, NULL); @@ -113,9 +110,6 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, u.uio_resid = alength; UIO_SETUP_SYSSPACE(&u); u.uio_rw = UIO_WRITE; -#if 0 - u.uio_procp = NULL; -#endif nam = m_get(M_DONTWAIT, MT_SONAME); if (!nam) return ENOBUFS; diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h index c451f8087d..94269df7aa 100644 --- a/src/rx/rx_packet.h +++ b/src/rx/rx_packet.h @@ -72,7 +72,6 @@ * the MAX packet size will be the maximum receive size, but the maximum send * size will be larger than that. */ -#ifdef notdef /* some sample MTUs 4352 what FDDI(RFC1188) uses... Larger? 4096 VJ's recommendation for FDDI @@ -85,23 +84,6 @@ 9180 Classical IP over ATM (RFC2225) */ -/* * * * these are the old defines -*/ -#define RX_MAX_PACKET_SIZE (RX_MAX_DL_MTU -RX_IPUDP_SIZE) - -#define RX_MAX_PACKET_DATA_SIZE (RX_MAX_PACKET_SIZE-RX_HEADER_SIZE) -#ifdef AFS_HPUX_ENV -/* HPUX by default uses an 802.3 size, and it's not evident from SIOCGIFCONF */ -#define RX_LOCAL_PACKET_SIZE (1492 - RX_IPUDP_SIZE) -#define RX_REMOTE_PACKET_SIZE (1492 - RX_IPUDP_SIZE) -#else -#define RX_LOCAL_PACKET_SIZE RX_MAX_PACKET_SIZE /* For hosts on same net */ -#define RX_REMOTE_PACKET_SIZE RX_MAX_PACKET_SIZE /* see note above */ -#endif -#endif /* notdef */ - -/* These are the new, streamlined ones. - */ #define RX_HEADER_SIZE sizeof (struct rx_header) /* The minimum MTU for an IP network is 576 bytes including headers */ diff --git a/src/rxgen/rpc_cout.c b/src/rxgen/rpc_cout.c index 3ddb27aca9..b0a686fb8b 100644 --- a/src/rxgen/rpc_cout.c +++ b/src/rxgen/rpc_cout.c @@ -122,14 +122,7 @@ print_header(definition * def) f_print(fout, "bool_t\n"); f_print(fout, "xdr_%s(XDR *xdrs, ", def->def_name); f_print(fout, "%s ", def->def_name); -#if 0 - if (def->def_kind != DEF_TYPEDEF - || !isvectordef(def->def.ty.old_type, def->def.ty.rel)) { - f_print(fout, "*"); - } -#else f_print(fout, "*"); -#endif f_print(fout, "objp)\n"); f_print(fout, "{\n"); } diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index f5d7c70338..492bfb0853 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -1766,9 +1766,6 @@ ucs_ProcTail_setup(definition * defp, int split_flag) f_print(fout, "{\tafs_int32 rcode, code, newHost, thisHost, i, _ucount;\n"); f_print(fout, "\tint chaseCount, pass, needsync;\n"); -#if 0 /* goes with block below */ - f_print(fout, "\tint j, inlist;\n"); -#endif f_print(fout, "\tstruct rx_connection *tc;\n"); f_print(fout, "\tstruct rx_peer *rxp;\n"); f_print(fout, "\tshort origLevel;\n\n"); @@ -1779,17 +1776,6 @@ ucs_ProcTail_setup(definition * defp, int split_flag) f_print(fout, "\torigLevel = aclient->initializationState;\n"); f_print(fout, "\trcode = UNOSERVERS;\n"); f_print(fout, "\tchaseCount = needsync = 0;\n\n"); -#if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */ - f_print(fout, "\tinlist = 0;\n"); - f_print(fout, "\tLOCK_UCLNT_CACHE;\n"); - f_print(fout, "\tfor (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {\n"); - f_print(fout, "\t\tif (calls_needsync[j] == (int *)%s%s%s) {\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name); - f_print(fout, "\t\t\tinlist = needsync = 1;\n"); - f_print(fout, "\t\t\tbreak;\n"); - f_print(fout, "\t\t}\n"); - f_print(fout, "\t}\n"); - f_print(fout, "\tUNLOCK_UCLNT_CACHE;\n"); -#endif f_print(fout, "\t/* \n\t* First pass, we try all servers that are up.\n\t* Second pass, we try all servers.\n\t*/\n"); f_print(fout, "\tfor (pass = 0; pass < 2; pass++) { /*p */\n"); f_print(fout, "\t\t/* For each entry in our servers list */\n"); @@ -1876,15 +1862,6 @@ ucs_ProcTail_setup(definition * defp, int split_flag) f_print(fout, "\tdone:\n"); f_print(fout, "\tif (needsync) {\n"); -#if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */ - f_print(fout, "\t\tif (!inlist) { /* Remember proc call that needs sync site */\n"); - f_print(fout, "\t\t\tLOCK_UCLNT_CACHE;\n"); - f_print(fout, "\t\t\tcalls_needsync[synccount % SYNCCOUNT] = (int *)%s%s%s;\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name); - f_print(fout, "\t\t\tsynccount++;\n"); - f_print(fout, "\t\t\tUNLOCK_UCLNT_CACHE;\n"); - f_print(fout, "\t\t\tinlist = 1;\n"); - f_print(fout, "\t\t}\n"); -#endif f_print(fout, "\t\tif (!rcode) { /* Remember the sync site - cmd successful */\n"); f_print(fout, "\t\t\trxp = rx_PeerOf(aclient->conns[_ucount]);\n"); f_print(fout, "\t\t\taclient->syncSite = rx_HostOf(rxp);\n"); diff --git a/src/rxkad/bg-fcrypt.c b/src/rxkad/bg-fcrypt.c index 3a16582c40..c88dbd0031 100644 --- a/src/rxkad/bg-fcrypt.c +++ b/src/rxkad/bg-fcrypt.c @@ -109,17 +109,6 @@ #define EFF_NTOHL(x) ntohl(x) -#if 0 -#if defined(__GNUC__) && (defined(i386) || defined(__i386__)) -static inline afs_uint32 -bswap(afs_uint32 x) -{ - asm("bswap %0": "=r"(x):"0"(x)); - return x; -} -#endif -#endif - /* * Sboxes for Feistel network derived from * /afs/transarc.com/public/afsps/afs.rel31b.export-src/rxkad/sboxes.h @@ -469,15 +458,8 @@ fc_cbc_dec(const afs_uint32 * in, afs_uint32 * out, afs_int32 length, xor0 = in[0] ^ b8[0]; xor1 = in[1] ^ b8[1]; -#if 0 - if (length >= 8) - memcpy(out, b8, 8); - else - memcpy(out, b8, length); /* Don't write to much when length < 8 */ -#else /* If length < 8 we write to much, this is not always ok */ memcpy(out, b8, 8); -#endif out += 2; in += 2; } diff --git a/src/rxkad/fcrypt.c b/src/rxkad/fcrypt.c index a8876aa5f1..5488a0dd15 100644 --- a/src/rxkad/fcrypt.c +++ b/src/rxkad/fcrypt.c @@ -117,13 +117,8 @@ fc_ecb_encrypt(void * clear, void * cipher, #define Byte3 3 #endif -#if 0 - memcpy(&L, clear, sizeof(afs_int32)); - memcpy(&R, clear + 1, sizeof(afs_int32)); -#else L = ntohl(*((afs_uint32 *)clear)); R = ntohl(*((afs_uint32 *)clear + 1)); -#endif if (encrypt) { INC_RXKAD_STATS(fc_encrypts[ENCRYPT]); @@ -163,13 +158,8 @@ fc_ecb_encrypt(void * clear, void * cipher, L ^= P; } } -#if 0 - memcpy(cipher, &L, sizeof(afs_int32)); - memcpy(cipher + 1, &R, sizeof(afs_int32)); -#else *((afs_int32 *)cipher) = htonl(L); *((afs_int32 *)cipher + 1) = htonl(R); -#endif return 0; } diff --git a/src/rxkad/rxkad_convert.h b/src/rxkad/rxkad_convert.h index 8fba9bfb44..cb45ab1640 100644 --- a/src/rxkad/rxkad_convert.h +++ b/src/rxkad/rxkad_convert.h @@ -26,13 +26,6 @@ ktc_to_cblockptr(struct ktc_encryptionKey *key) { return (DES_cblock *)key; } -#if 0 -static_inline unsigned char * -cblockptr_to_cblock(DES_cblock *key) { - return (unsigned char *)key; -} -#endif - static_inline DES_cblock * charptr_to_cblock(char *key) { return (DES_cblock *)key; diff --git a/src/rxkad/test/stress_c.c b/src/rxkad/test/stress_c.c index e9d83b3211..d8c9c0ed75 100644 --- a/src/rxkad/test/stress_c.c +++ b/src/rxkad/test/stress_c.c @@ -419,25 +419,9 @@ RunLoadTest(struct clientParms *parms, struct rx_connection *conn) int b; kbps = (double)(parms->copiousCalls * n) / (interval * 1000.0); b = kbps + 0.5; -#if 0 - I just cannot get printing of floats to work on the pmax ! - !!!printf("%g %d %d %d\n", (float)kbps, b); - printf("%g %d %d %d\n", kbps, b); - fprintf(stdout, "%g %d %d\n", kbps, b); - { - char buf[100]; - buf[sizeof(buf) - 1] = 0; - sprintf(buf, "%g %d %d\n", kbps, b); - assert(buf[sizeof(buf) - 1] == 0); - printf("%s", buf); - } -#endif printf ("For %lu copious calls, %lu send + %lu recv = %lu bytes each: %d kbytes/sec\n", parms->copiousCalls, parms->sendLen, parms->recvLen, n, b); -#if 0 - printf("%g\n", kbps); -#endif } } return 0; @@ -1296,10 +1280,6 @@ rxkst_StartClient(struct clientParms *parms) if (parms->printStats) { rx_PrintStats(stdout); -#if 0 - /* use rxdebug style iteration here */ - rx_PrintPeerStats(stdout, rx_PeerOf(conn)); -#endif } rxs_Release(sc); diff --git a/src/rxkad/test/stress_s.c b/src/rxkad/test/stress_s.c index 17939f2c49..2617b5cb32 100644 --- a/src/rxkad/test/stress_s.c +++ b/src/rxkad/test/stress_s.c @@ -277,13 +277,7 @@ SRXKST_Copious(struct rx_call *call, u_long inlen, u_long insum, code = RXKST_BADINPUTSUM; goto done; } -#define BIG_PRIME 1257056893 /* 0x4AED2A7d */ -#if 0 -#define NextByte() ((b>24 ? ((seed = seed*BIG_PRIME + BIG_PRIME),b=0) : 0), \ - (b +=8), ((seed >> (b-8))&0xff)) -#else #define NextByte() (b+=3) -#endif b = 32; mysum = 0; diff --git a/src/rxkad/ticket5.c b/src/rxkad/ticket5.c index 04c54b1778..49a17320f2 100644 --- a/src/rxkad/ticket5.c +++ b/src/rxkad/ticket5.c @@ -394,13 +394,8 @@ tkt_DecodeTicket5(char *ticket, afs_int32 ticket_len, *start = decr_part.authtime; if (decr_part.starttime) *start = *decr_part.starttime; -#if 0 - if (*start - now > CLOCK_SKEW || decr_part.flags.invalid) - goto no_auth; -#else if (decr_part.flags.invalid) goto no_auth; -#endif if (now > decr_part.endtime) goto tkt_expired; *end = decr_part.endtime; diff --git a/src/scout/scout.c b/src/scout/scout.c index 064f625d74..132c872bb8 100644 --- a/src/scout/scout.c +++ b/src/scout/scout.c @@ -36,9 +36,6 @@ */ #define P_SERVER 0 #define P_BASE 1 -#if 0 -#define P_PACKAGE 2 -#endif /* 0 */ #define P_FREQ 2 #define P_HOST 3 #define P_ATTENTION 4 @@ -1653,9 +1650,6 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg) /* * Initialize the gtx package. */ -#if 0 - fprintf(stderr, "[%s:%s] Starting up gtx package\n", pn, rn); -#endif /* 0 */ scout_gwin = gtx_Init(0, /*Don't start up InputServer yet */ -1); /*Type of window package */ if (scout_gwin == NULL) { @@ -1897,21 +1891,6 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg) } /*Add lights in server records to display list */ -#if 0 - /* - * Set up the minimal keymap. - */ - code = keymap_BindToString(scout_frame->keymap, /*Ptr to keymap */ - "e", /*Key to bind */ - ExitCmd, /*Cmd to execute */ - NULL, /*Name */ - NULL); /*Ptr to rock */ - if (code) { - fprintf(stderr, "[%s] Can't bind key `e', code is %d\n", rn, code); - return (code); - } -#endif /* 0 */ - /* * Finish setting up the overall mini_screen structure. */ @@ -1930,9 +1909,6 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg) scout_probefreq, /*Probe frequency */ FS_Handler, /*Handler routine */ 0); /*Turn debugging output off */ -#if 0 - scout_debug); /*Turn debugging output off */ -#endif /* 0 */ if (code) { fprintf(stderr, "[%s] Error returned by fsprobe_Init: %d\n", rn, code); @@ -2205,29 +2181,7 @@ static int scoutInit(struct cmd_syndesc *as, void *arock) fprintf(scout_debugfd, "[%s] Writing to Scout debugging file '%s'\n", rn, debug_filename); } -#if 0 - wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data); -#endif /* 0 */ wpkg_to_use = 2; /*Always use curses for now */ -#if 0 - fprintf(stderr, "[%s:%s] Using graphics package %d: ", pn, rn, - wpkg_to_use); - switch (wpkg_to_use) { - case GATOR_WIN_CURSES: - fprintf(stderr, "curses\n"); - break; - case GATOR_WIN_DUMB: - fprintf(stderr, "dumb terminal\n"); - break; - case GATOR_WIN_X11: - fprintf(stderr, "X11\n"); - break; - default: - fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use); - scout_CleanExit(-1); - } /*end switch (wpkg_to_use) */ -#endif /* 0 */ - if (as->parms[P_FREQ].items != 0) scout_probefreq = atoi(as->parms[P_FREQ].items->data); else @@ -2322,10 +2276,6 @@ main(int argc, char **argv) "FileServer name(s) to monitor"); cmd_AddParm(ts, "-basename", CMD_SINGLE, CMD_OPTIONAL, "base server name"); -#if 0 - cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED, - "Graphics package to use"); -#endif /* 0 */ cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL, "poll frequency, in seconds"); cmd_AddParm(ts, "-host", CMD_FLAG, CMD_OPTIONAL, @@ -2343,10 +2293,6 @@ main(int argc, char **argv) */ code = cmd_Dispatch(argc, argv); if (code) { -#if 0 - fprintf(stderr, "[%s:%s] Call to cmd_Dispatch() failed; code is %d\n", - pn, rn, code); -#endif /* 0 */ scout_CleanExit(1); } else scout_CleanExit(0); diff --git a/src/sys/afssyscalls.c b/src/sys/afssyscalls.c index 712e68c897..8291a46c54 100644 --- a/src/sys/afssyscalls.c +++ b/src/sys/afssyscalls.c @@ -43,10 +43,6 @@ static void check_iops(int index, char *fun, char *file, int line); #pragma weak xiinc = iinc #pragma weak xidec = idec #pragma weak xiopen = iopen -#ifdef notdef -#pragma weak xiread = iread -#pragma weak xiwrite = iwrite -#endif int icreate(int dev, int near_inode, int param1, int param2, int param3, @@ -170,23 +166,6 @@ afs_init_kernel_config(int flag) } #endif -#ifdef notdef -/* iread and iwrite are deprecated interfaces. Use inode_read and inode_write instead. */ -int -iread(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf, - unsigned int count) -{ - return (syscall(AFS_IREAD, dev, inode, inode_p1, offset, cbuf, count)); -} - -int -iwrite(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf, - unsigned int count) -{ - return (syscall(AFS_IWRITE, dev, inode, inode_p1, offset, cbuf, count)); -} -#endif /* notdef */ - #else /* AFS_SGI_ENV */ #ifndef AFS_NAMEI_ENV @@ -250,39 +229,6 @@ idec(int dev, int inode, int inode_p1) } -#ifdef notdef -int -iread(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf, - unsigned int count) -{ - int errcode; - struct iparam iparams; - - iparams.param1 = inode_p1; - iparams.param2 = offset; - iparams.param3 = (long)cbuf; - iparams.param4 = count; - errcode = syscall(AFS_SYSCALL, AFSCALL_IREAD, dev, inode, &iparams); - return (errcode); -} - - -iwrite(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf, - unsigned int count) -{ - int errcode; - struct iparam iparams; - - iparams.param1 = inode_p1; - iparams.param2 = offset; - iparams.param3 = (long)cbuf; - iparams.param4 = count; - - errcode = syscall(AFS_SYSCALL, AFSCALL_IWRITE, dev, inode, &iparams); - return (errcode); -} -#endif - #endif /* AFS_NAMEI_ENV */ #endif /* !AFS_SGI_ENV */ diff --git a/src/tests/afscp.c b/src/tests/afscp.c index ff6498ed31..7e24bee2db 100644 --- a/src/tests/afscp.c +++ b/src/tests/afscp.c @@ -164,29 +164,7 @@ do_rx_Init(void) struct rx_securityClass * get_sc(char *cellname) { -#if 0 - char realm[REALM_SZ]; - CREDENTIALS c; -#endif - return rxnull_NewClientSecurityObject(); -#if 0 - - ucstring(realm, cellname, REALM_SZ); - - if (krb_get_cred("afs", "", realm, &c)) { - if (get_ad_tkt("afs", "", realm, DEFAULT_TKT_LIFE)) { - return NULL; - } else { - if (krb_get_cred("afs", "", realm, &c)) { - return NULL; - } - } - } - - return rxkad_NewClientSecurityObject(rxkad_clear, c.session, c.kvno, - c.ticket_st.length, c.ticket_st.dat); -#endif } static volatile int loop_stop = 1; diff --git a/src/tests/asu.c b/src/tests/asu.c index 6112100e9e..ddd532ddae 100644 --- a/src/tests/asu.c +++ b/src/tests/asu.c @@ -86,13 +86,6 @@ main(int argc, char **argv) setegid(gid); seteuid(uid); } -#if 0 - if (k_hasafs()) { - int ret = k_setpag(); - if (ret < 0) - warn("k_setpag"); - } -#endif execvp(prog, &argv[2]); diff --git a/src/tests/ga-test.c b/src/tests/ga-test.c index 03865fba93..f0b9099023 100644 --- a/src/tests/ga-test.c +++ b/src/tests/ga-test.c @@ -130,9 +130,6 @@ test_simple_strings(void) "--strings=foo", "--strings=bar", NULL}}, {AARG_GNUSTYLE, 5, {"strings", "-s", "foo", "-s", "bar", NULL}}, {AARG_AFSSTYLE, 4, {"strings", "-string", "foo", "bar", NULL}} -#if 0 - {AARG_AFSSTYLE, 3, {"strings", "foo", "bar", NULL}} -#endif }; struct agetargs args[] = { @@ -243,10 +240,6 @@ test_simple_flag(void) {AARG_GNUSTYLE, 2, {"flag", "-g", NULL}, GA_SUCCESS}, {AARG_AFSSTYLE, 2, {"flag", "--flag"}, GA_FAILURE}, {AARG_AFSSTYLE, 2, {"flag", "-flag", NULL}, GA_SUCCESS}, -#if 0 - /* XXX */ - {AARG_AFSSTYLE, 2, {"flag", "yes", NULL}, GA_SUCCESS}, -#endif {AARG_GNUSTYLE, 2, {"flag", "--no-flag", NULL}, GA_SUCCESS} }; diff --git a/src/tests/large-dir.c b/src/tests/large-dir.c index 04b215fc1a..98a59eef24 100644 --- a/src/tests/large-dir.c +++ b/src/tests/large-dir.c @@ -121,10 +121,6 @@ creat_files(const char *dirname, int count) closedir(d); if (stat(".", &sb) < 0) err(1, "stat ."); -#if 0 - if (sb.st_size != 2048) - errx(1, "size != 2048"); -#endif return 0; } diff --git a/src/tests/large-dir2.c b/src/tests/large-dir2.c index 6f53b85cdb..d2c2c84183 100644 --- a/src/tests/large-dir2.c +++ b/src/tests/large-dir2.c @@ -64,10 +64,6 @@ creat_files(const char *dirname, int count) err(1, "chdir %s", dirname); if (stat(".", &sb) < 0) err(1, "stat ."); -#if 0 - if (sb.st_size != 2048) - errx(1, "size != 2048"); -#endif for (i = 0; i < count; ++i) { char fname[256]; int len; diff --git a/src/tests/mmap-and-read.c b/src/tests/mmap-and-read.c index 39c7258c1a..8508625eea 100644 --- a/src/tests/mmap-and-read.c +++ b/src/tests/mmap-and-read.c @@ -89,11 +89,6 @@ generate_random_file(const char *filename, unsigned npages, unsigned pagesize, memcpy(fbuf, buf, sz); -#if 0 - if (msync(fbuf, sz, MS_SYNC)) - err(1, "msync"); -#endif - if (munmap(fbuf, sz) != 0) err(1, "munmap"); diff --git a/src/tests/rename-under-feet.c b/src/tests/rename-under-feet.c index 8604b2cb97..3b4d742680 100644 --- a/src/tests/rename-under-feet.c +++ b/src/tests/rename-under-feet.c @@ -102,10 +102,6 @@ child_chdir(const char *path) err(1, "write"); while (!term_sig) pause(); -#if 0 - if (getcwd(buf, sizeof(buf)) == NULL) - err(1, "getcwd"); -#endif fp = fdopen(4, "w"); if (fp != NULL) fprintf(fp, "child: cwd = %s\n", buf); diff --git a/src/tools/dumpscan/directory.c b/src/tools/dumpscan/directory.c index a3b9d3e0b7..586f544643 100644 --- a/src/tools/dumpscan/directory.c +++ b/src/tools/dumpscan/directory.c @@ -74,19 +74,6 @@ static int namehash(char *name, int buckets, int seed) return tval ? hval < 0 ? buckets - tval : tval : 0; } -#if 0 -static void fixup(char *name, int l) -{ - name += 16; - l -= 15; - - while (l-- > 0) { - name[0] = name[4]; - name++; - } -} -#endif - afs_uint32 parse_directory(XFILE *X, dump_parser *p, afs_vnode *v, afs_uint32 size, int toeof) { diff --git a/src/tools/dumpscan/dumptool.c b/src/tools/dumpscan/dumptool.c index 70b2ec708f..58d67e82be 100644 --- a/src/tools/dumpscan/dumptool.c +++ b/src/tools/dumpscan/dumptool.c @@ -1028,9 +1028,6 @@ ScanVnodes(FILE * f, VolumeDiskData * vol, int sizescan) fprintf(stderr, "failed readbystring for 'A'\n"); return -1; } -#if 0 - acl_NtohACL(VVnodeDiskACL(vnode)); -#endif break; #ifdef RESIDENCY case 'h': diff --git a/src/tools/dumpscan/intNN.h b/src/tools/dumpscan/intNN.h index b344a3552c..7163ee91db 100644 --- a/src/tools/dumpscan/intNN.h +++ b/src/tools/dumpscan/intNN.h @@ -31,13 +31,6 @@ /* intNN.h - Sized integer types */ #include -#if 0 -typedef short afs_int16; -typedef unsigned short afs_uint16; - -typedef long afs_int32; -typedef unsigned long afs_uint32; -#endif /* Support for 64-bit integers. diff --git a/src/tsalvaged/salvsync-debug.c b/src/tsalvaged/salvsync-debug.c index 3c0681d49a..b26355b71e 100644 --- a/src/tsalvaged/salvsync-debug.c +++ b/src/tsalvaged/salvsync-debug.c @@ -355,25 +355,6 @@ reason_code_to_string(afs_int32 reason) } } -#if 0 -static char * -program_type_to_string(afs_int32 type) -{ - switch ((ProgramType)type) { - case fileServer: - return "fileServer"; - case volumeUtility: - return "volumeUtility"; - case salvager: - return "salvager"; - case salvageServer: - return "salvageServer"; - default: - return "**UNKNOWN**"; - } -} -#endif - static char * state_code_to_string(afs_int32 state) { diff --git a/src/tsm41/aix_aklog.c b/src/tsm41/aix_aklog.c index 49d677afca..5486af5175 100644 --- a/src/tsm41/aix_aklog.c +++ b/src/tsm41/aix_aklog.c @@ -179,39 +179,6 @@ aklog_authenticate(char *userName, char *response, int *reenter, char **message) str); return AUTH_FAILURE; /* NOTFOUND? */ } - -#if 0 - /* - * Local hack - if the person has a file in their home - * directory called ".xlog", read that for a list of - * extra cells to authenticate to - */ - - if ((pwd = getpwuid(getuid())) != NULL) { - struct stat sbuf; - FILE *f; - char fcell[100], xlog_path[512]; - - strcpy(xlog_path, pwd->pw_dir); - strcat(xlog_path, "/.xlog"); - - if ((stat(xlog_path, &sbuf) == 0) && - ((f = fopen(xlog_path, "r")) != NULL)) { - - while (fgets(fcell, 100, f) != NULL) { - int auth_status; - - fcell[strlen(fcell) - 1] = '\0'; - - auth_status = auth_to_cell(context, userName, fcell, NULL); - if (status == AKLOG_SUCCESS) - status = auth_status; - else - status = AKLOG_SOMETHINGSWRONG; - } - } - } -#endif return AUTH_SUCCESS; } diff --git a/src/ubik/utst_server.c b/src/ubik/utst_server.c index fda298b803..7a1ae4db2e 100644 --- a/src/ubik/utst_server.c +++ b/src/ubik/utst_server.c @@ -318,9 +318,6 @@ main(int argc, char **argv) } sc[0] = rxnull_NewServerSecurityObject(); -#if 0 - sc[1] = rxvab_NewServerSecurityObject("applexx", 0); -#endif tservice = rx_NewService(0, USER_SERVICE_ID, "Sample", sc, 1 /*2 */ , SAMPLE_ExecuteRequest); if (tservice == (struct rx_service *)0) { diff --git a/src/uss/uss_common.c b/src/uss/uss_common.c index d547b47b70..adb6badad7 100644 --- a/src/uss/uss_common.c +++ b/src/uss/uss_common.c @@ -218,14 +218,8 @@ uss_common_FieldCp(char *a_to, char *a_from, char a_separator, */ *a_overflowP = 1; a_to--; -#if 0 - printf("*** Skipping overflow char '%c'\n", *(a_from - 1)); -#endif /* 0 */ while (*a_from != a_separator && *a_from != '\0' && *a_from != '\n') { -#if 0 - printf("*** Skipping overflow char '%c'\n", *a_from); -#endif /* 0 */ a_from++; } /*Skip over excess chars */ break; diff --git a/src/uss/uss_vol.c b/src/uss/uss_vol.c index c9c13941da..d114aa44cb 100644 --- a/src/uss/uss_vol.c +++ b/src/uss/uss_vol.c @@ -355,44 +355,6 @@ uss_vol_GetServer(char *a_name) } /*uss_vol_GetServer */ -/* XXX - This function is unused, and could be deleted */ -#if 0 -/*------------------------------------------------------------------------ - * static GetVolumeType - * - * Description: - * Translate the given char string representing a volume type to the - * numeric representation. - * - * Arguments: - * a_type : Char string volume type. - * - * Returns: - * One of ROVOL, RWVOL, BACKVOL, or -1 on failure. - * - * Environment: - * Nothing interesting. - * - * Side Effects: - * As advertised. - *------------------------------------------------------------------------*/ - -static afs_int32 -GetVolumeType(char *a_type) -{ /*GetVolumeType */ - - if (!strcmp(a_type, "ro")) - return (ROVOL); - else if (!strcmp(a_type, "rw")) - return (RWVOL); - else if (!strcmp(a_type, "bk")) - return (BACKVOL); - else - return (-1); - -} /*GetVolumeType */ -#endif - /*------------------------------------------------------------------------ * EXPORTED uss_Vol_GetPartitionID * diff --git a/src/uss/uss_vol.h b/src/uss/uss_vol.h index 83b0f707b3..08cf5a1248 100644 --- a/src/uss/uss_vol.h +++ b/src/uss/uss_vol.h @@ -103,19 +103,4 @@ extern afs_int32 uss_vol_GetVolInfoFromMountPoint(char *a_mountpoint); * Other error code if problem occurred in lower-level call. */ -#if 0 -extern afs_int32 uss_vol_DeleteMountPoint(); - /* - * Summary: - * Given a mountpoint, nuke it. - * - * Args: - * char *a_mountpoint : Name of the mountpoint. - * - * Returns: - * 0 if everything went well, - * 1 if there was a problem in the routine itself, or - * Other error code if problem occurred in lower-level call. - */ -#endif #endif /* _USS_VOL_H_ */ diff --git a/src/util/afs_lhash.c b/src/util/afs_lhash.c index 176fd246a3..90e39a0895 100644 --- a/src/util/afs_lhash.c +++ b/src/util/afs_lhash.c @@ -455,9 +455,6 @@ afs_lhash_enter(afs_lhash * lh, unsigned key, void *data) */ if (lh->ndata > LOAD_FACTOR * lh->ltable) { afs_lhash_expand(lh); -#if 0 - printf("lh->p = %d; lh->maxp = %d\n", lh->p, lh->maxp); -#endif } #ifdef CHECK_INVARIANTS assert(lh->ndata <= LOAD_FACTOR * lh->ltable); diff --git a/src/util/ktime.c b/src/util/ktime.c index 218c380b1b..4df420df3d 100644 --- a/src/util/ktime.c +++ b/src/util/ktime.c @@ -638,12 +638,6 @@ ktime_InterpretDate(struct ktime_date * akdate) temp = tresult + tbit; /* see if adding this bit keeps us < akdate */ tsp = localtime(&temp); tsp->tm_mon++; -#ifdef notdef - if (tsp->tm_mon == 0) { - tsp->tm_mon = 12; - tsp->tm_year--; - } -#endif if (KDateCmp(akdate, tsp) >= 0) { /* if temp still represents earlier than date than we're searching * for, add in bit as increment, otherwise use old value and look diff --git a/src/venus/fs.c b/src/venus/fs.c index 52b5df7803..630f44c66b 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -2988,10 +2988,6 @@ GetCellCmd(struct cmd_syndesc *as, void *arock) continue; } printf("Cell %s status: ", info.name); -#ifdef notdef - if (args.stat & 1) - printf("primary "); -#endif if (args.stat & 2) printf("no setuid allowed"); else @@ -3736,11 +3732,6 @@ main(int argc, char **argv) cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path"); cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_OPTIONAL, "disk space quota in 1K units"); -#ifdef notdef - cmd_AddParm(ts, "-min", CMD_SINGLE, CMD_OPTIONAL, - "disk space guaranteed"); - cmd_AddParm(ts, "-motd", CMD_SINGLE, CMD_OPTIONAL, "message of the day"); -#endif cmd_AddParm(ts, "-offlinemsg", CMD_SINGLE, CMD_OPTIONAL, "offline message"); cmd_CreateAlias(ts, "sv"); @@ -3835,9 +3826,6 @@ defect 3069 ts = cmd_CreateSyntax("setquota", SetQuotaCmd, NULL, 0, "set volume quota"); cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "dir/file path"); cmd_AddParm(ts, "-max", CMD_SINGLE, 0, "max quota in kbytes"); -#ifdef notdef - cmd_AddParm(ts, "-min", CMD_SINGLE, CMD_OPTIONAL, "min quota in kbytes"); -#endif cmd_CreateAlias(ts, "sq"); ts = cmd_CreateSyntax("newcell", NewCellCmd, NULL, 0, "configure new cell"); diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index ca25978d9c..38c1cc087e 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -753,10 +753,6 @@ icl_DumpKernel(FILE *outFilep, char *setname) /* print the record */ DisplayRecord(outFilep, &bufferp[ix], rlength); ix += rlength; -#ifdef notdef - /* obsolete: read entire buffer first */ - i += rlength; /* update cookie value, too */ -#endif } /* for loop displaying buffer */ } /* for loop over all logs */ diff --git a/src/venus/kdump.c b/src/venus/kdump.c index bb808807a2..c7ad4d261c 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -219,12 +219,6 @@ struct vnode foo; struct timezone { int a, b; }; -#if 0 /*ndef AFS_ALPHA_LINUX20_ENV */ -typedef struct timeval { - int tv_sec; - int tv_usec; -} timeval_t; /* Needed here since KERNEL defined. */ -#endif /*AFS_ALPHA_LINUX20_ENV */ #if defined(WORDS_BIGENDIAN) #define _LINUX_BYTEORDER_BIG_ENDIAN_H #else @@ -4297,162 +4291,3 @@ print_cmstats(struct afs_CMStats *cmp) } #endif -#if 0 -#define OffsetOf(s,mem) ((long)(&(((s *)0)->mem))) -#define SizeOf(s,mem) ((long)sizeof(((s *)0)->mem)) -#define values(s,mem) OffsetOf(s,mem), SizeOf(s,mem) - -print_struct_vcache_offsets() -{ - printf("struct vcache.v offset = %ld, size = %ld\n", - values(struct vcache, v)); - printf("struct vcache.vlruq offset = %ld, size = %ld\n", - values(struct vcache, vlruq)); - printf("struct vcache.nextfree offset = %ld, size = %ld\n", - values(struct vcache, nextfree)); - printf("struct vcache.hnext offset = %ld, size = %ld\n", - values(struct vcache, hnext)); - printf("struct vcache.fid offset = %ld, size = %ld\n", - values(struct vcache, fid)); - printf("struct vcache.m offset = %ld, size = %ld\n", - values(struct vcache, m)); - printf("struct vcache.lock offset = %ld, size = %ld\n", - values(struct vcache, lock)); - printf("struct vcache.parentVnode offset = %ld, size = %ld\n", - values(struct vcache, parentVnode)); - printf("struct vcache.parentUnique offset = %ld, size = %ld\n", - values(struct vcache, parentUnique)); - printf("struct vcache.mvid offset = %ld, size = %ld\n", - values(struct vcache, mvid)); - printf("struct vcache.linkData offset = %ld, size = %ld\n", - values(struct vcache, linkData)); - printf("struct vcache.flushDV offset = %ld, size = %ld\n", - values(struct vcache, flushDV)); - printf("struct vcache.mapDV offset = %ld, size = %ld\n", - values(struct vcache, mapDV)); - printf("struct vcache.truncPos offset = %ld, size = %ld\n", - values(struct vcache, truncPos)); - printf("struct vcache.callback offset = %ld, size = %ld\n", - values(struct vcache, callback)); - printf("struct vcache.cbExpires offset = %ld, size = %ld\n", - values(struct vcache, cbExpires)); - printf("struct vcache.callsort offset = %ld, size = %ld\n", - values(struct vcache, callsort)); - printf("struct vcache.Access offset = %ld, size = %ld\n", - values(struct vcache, Access)); - printf("struct vcache.anyAccess offset = %ld, size = %ld\n", - values(struct vcache, anyAccess)); - printf("struct vcache.last_looker offset = %ld, size = %ld\n", - values(struct vcache, last_looker)); - printf("struct vcache.activeV offset = %ld, size = %ld\n", - values(struct vcache, activeV)); - printf("struct vcache.slocks offset = %ld, size = %ld\n", - values(struct vcache, slocks)); - printf("struct vcache.opens offset = %ld, size = %ld\n", - values(struct vcache, opens)); - printf("struct vcache.execsOrWriters offset = %ld, size = %ld\n", - values(struct vcache, execsOrWriters)); - printf("struct vcache.flockCount offset = %ld, size = %ld\n", - values(struct vcache, flockCount)); - printf("struct vcache.mvstat offset = %ld, size = %ld\n", - values(struct vcache, mvstat)); - printf("struct vcache.states offset = %ld, size = %ld\n", - values(struct vcache, states)); - printf("struct vcache.quick offset = %ld, size = %ld\n", - values(struct vcache, quick)); - printf("struct vcache.symhintstamp offset = %ld, size = %ld\n", - values(struct vcache, symhintstamp)); - printf("struct vcache.h1 offset = %ld, size = %ld\n", - values(struct vcache, h1)); - printf("struct vcache.lastr offset = %ld, size = %ld\n", - values(struct vcache, lastr)); - printf("struct vcache.vc_rwlockid offset = %ld, size = %ld\n", - values(struct vcache, vc_rwlockid)); - printf("struct vcache.vc_locktrips offset = %ld, size = %ld\n", - values(struct vcache, vc_locktrips)); - printf("struct vcache.vc_rwlock offset = %ld, size = %ld\n", - values(struct vcache, vc_rwlock)); - printf("struct vcache.mapcnt offset = %ld, size = %ld\n", - values(struct vcache, mapcnt)); - printf("struct vcache.cred offset = %ld, size = %ld\n", - values(struct vcache, cred)); - printf("struct vcache.vc_bhv_desc offset = %ld, size = %ld\n", - values(struct vcache, vc_bhv_desc)); - printf("struct vcache.vc_error offset = %ld, size = %ld\n", - values(struct vcache, vc_error)); - printf("struct vcache.xlatordv offset = %ld, size = %ld\n", - values(struct vcache, xlatordv)); - printf("struct vcache.uncred offset = %ld, size = %ld\n", - values(struct vcache, uncred)); - printf("struct vcache.asynchrony offset = %ld, size = %ld\n", - values(struct vcache, asynchrony)); -} - -print_struct_vnode_offsets() -{ - printf("struct vnode.v_list offset = %ld, size = %ld\n", - values(struct vnode, v_list)); - printf("struct vnode.v_flag offset = %ld, size = %ld\n", - values(struct vnode, v_flag)); - printf("struct vnode.v_count offset = %ld, size = %ld\n", - values(struct vnode, v_count)); - printf("struct vnode.v_listid offset = %ld, size = %ld\n", - values(struct vnode, v_listid)); - printf("struct vnode.v_intpcount offset = %ld, size = %ld\n", - values(struct vnode, v_intpcount)); - printf("struct vnode.v_type offset = %ld, size = %ld\n", - values(struct vnode, v_type)); - printf("struct vnode.v_rdev offset = %ld, size = %ld\n", - values(struct vnode, v_rdev)); - printf("struct vnode.v_vfsmountedhere offset = %ld, size = %ld\n", - values(struct vnode, v_vfsmountedhere)); - printf("struct vnode.v_vfsp offset = %ld, size = %ld\n", - values(struct vnode, v_vfsp)); - printf("struct vnode.v_stream offset = %ld, size = %ld\n", - values(struct vnode, v_stream)); - printf("struct vnode.v_filocks offset = %ld, size = %ld\n", - values(struct vnode, v_filocks)); - printf("struct vnode.v_filocksem offset = %ld, size = %ld\n", - values(struct vnode, v_filocksem)); - printf("struct vnode.v_number offset = %ld, size = %ld\n", - values(struct vnode, v_number)); - printf("struct vnode.v_bh offset = %ld, size = %ld\n", - values(struct vnode, v_bh)); - printf("struct vnode.v_namecap offset = %ld, size = %ld\n", - values(struct vnode, v_namecap)); - printf("struct vnode.v_hashp offset = %ld, size = %ld\n", - values(struct vnode, v_hashp)); - printf("struct vnode.v_hashn offset = %ld, size = %ld\n", - values(struct vnode, v_hashn)); - printf("struct vnode.v_mreg offset = %ld, size = %ld\n", - values(struct vnode, v_mreg)); - printf("struct vnode.v_mregb offset = %ld, size = %ld\n", - values(struct vnode, v_mregb)); - printf("struct vnode.v_pgcnt offset = %ld, size = %ld\n", - values(struct vnode, v_pgcnt)); - printf("struct vnode.v_dpages offset = %ld, size = %ld\n", - values(struct vnode, v_dpages)); - printf("struct vnode.v_dpages_gen offset = %ld, size = %ld\n", - values(struct vnode, v_dpages_gen)); - printf("struct vnode.v_dbuf offset = %ld, size = %ld\n", - values(struct vnode, v_dbuf)); - printf("struct vnode.v_buf offset = %ld, size = %ld\n", - values(struct vnode, v_buf)); - printf("struct vnode.v_bufgen offset = %ld, size = %ld\n", - values(struct vnode, v_bufgen)); - printf("struct vnode.v_traceix offset = %ld, size = %ld\n", - values(struct vnode, v_traceix)); - printf("struct vnode.v_buf_lock offset = %ld, size = %ld\n", - values(struct vnode, v_buf_lock)); - printf("struct vnode.v_pc offset = %ld, size = %ld\n", - values(struct vnode, v_pc)); -#ifdef VNODE_TRACING - printf("struct vnode.v_trace offset = %ld, size = %ld\n", - values(struct vnode, v_trace)); -#endif -#ifdef CKPT - printf("struct vnode.v_ckpt offset = %ld, size = %ld\n", - values(struct vnode, v_ckpt)); -#endif -} -#endif diff --git a/src/venus/test/fulltest.c b/src/venus/test/fulltest.c index e3b6d9beb5..9018dcdf78 100644 --- a/src/venus/test/fulltest.c +++ b/src/venus/test/fulltest.c @@ -89,14 +89,6 @@ main(int argc, char **argv) printf("fchmod failed to set mode properly\n"); return -1; } -#if 0 - /* These appear to be defunct routines; - * I don't know what, if anything, replaced them */ - if (osi_ExclusiveLockNoBlock(fd1) < 0) - {perror("flock1");return -1;} - if (osi_UnLock(fd1) < 0) - {perror("flock/unlock");return -1;} -#endif /* How about shared lock portability? */ { diff --git a/src/vfsck/pass5.c b/src/vfsck/pass5.c index 0bcd157c90..8e6cd6d770 100644 --- a/src/vfsck/pass5.c +++ b/src/vfsck/pass5.c @@ -144,20 +144,8 @@ pass5() idesc[i].id_type = ADDR; memset(&cstotal, 0, sizeof(struct csum)); (void)time(&now); -#ifdef notdef - /* this is the original from UCB/McKusick, but it is clearly wrong. It is - * rounding the # of fragments to the next 1024 (in our case, with a 1K/8K file system), - * while instead it should be rounding to the next block. - * - * In addition, we should be sure that we allocate enough space, but that seems to be - * ensured by the fact that the bitmap is rounded up to the nearest short, and that there - * are never more than 16 frags per block. - */ - for (i = fs->fs_size; i < fragroundup(fs, fs->fs_size); i++) -#else c = 1 << fs->fs_fragshift; /* unit to which we want to round */ for (i = fs->fs_size; i < roundup(fs->fs_size, c); i++) -#endif setbmap(i); for (c = 0; c < fs->fs_ncg; c++) { getblk(&cgblk, cgtod(fs, c), fs->fs_cgsize); diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 9dcdd29395..5cc10cc3e4 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -5989,14 +5989,6 @@ SRXAFS_SetVolumeStatus(struct rx_call * acall, afs_int32 avolid, afs_int32 SRXAFS_GetRootVolume(struct rx_call * acall, char **VolumeName) { -#ifdef notdef - int fd; - int len; - char *temp; - struct rx_connection *tcon; - struct host *thost; - Error errorCode = 0; -#endif struct fsstats fsstats; fsstats_StartOp(&fsstats, FS_STATS_RPCIDX_GETROOTVOLUME); diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index a727274443..a3a7afb65d 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -95,121 +95,6 @@ main(int argc, char **argv) else printf("return code is %d\n", code); -#ifdef notdef - while (1) { - char line[500]; - int nargs; - - printf("fs> "); - if (fgets(line, 499, stdin) != NULL) { - char *oper; - char **argp = args; - GetArgs(line, argp, &nargs); - oper = &argp[0][0]; - ++argp, --nargs; - if (!strcmp(oper, "probe")) { - code = - ubik_Call(RXAFS_GetTime, cstruct, 0, &tv.tv_sec, - &tv.tv_usec); - printf("return code is %d\n", code); - if (!code) - printf("sec=%d\n", tv.tv_sec); - } else if (!strcmp(oper, "fsstats")) { - struct afsStatistics stats; - - code = ubik_AFS_GetStatistics(cstruct, 0, &stats); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "fd")) { - code = FetchData(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "fs")) { - code = FetchStatus(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "fa")) { - code = FetchACL(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "sd")) { - code = StoreData(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "ss")) { - code = StoreStatus(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "sa")) { - code = StoreACL(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "cf")) { - code = CreateFile(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "rf")) { - code = RemoveFile(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "rn")) { - code = Rename(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "sl")) { - code = Symlink(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "hl")) { - code = HardLink(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "md")) { - code = MakeDir(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "rd")) { - code = RemoveDir(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "rdd")) { - code = Readdir(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "mm")) { - code = MakeMountPoint(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "rt")) { - code = ReleaseTokens(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "bs")) { - code = BulkStatus(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "lk")) { - code = Lookup(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "gt")) { - code = GetToken(argp); - printf("return code is %d\n", code); - } else if (!strcmp(oper, "ka")) { - code = KeepAlive(argp); - printf("return code is %d\n", code); - } else if ((!strcmp(oper, "q")) || !strcmp(oper, "quit")) - exit(0); - else { - printf("Unknown oper! Available operations: \n\n"); - printf("fd \n"); - printf("fs \n"); - printf("fa \n"); - printf - ("sd [|-1] [|-1] [|-1] \n"); - printf - ("ss [|-1] [|-1] [|-1]\n"); - printf("sa \n"); - printf("rf \n"); - printf - ("cf [|-1] [|-1] [|-1]\n"); - printf - ("rn \n"); - printf - ("sl [|-1] [|-1] [|-1]\n"); - printf("hl \n"); - printf - ("md [|-1] [|-1] [|-1]\n"); - printf("rd \n"); - printf("rdd \n"); - printf("lk \n"); - printf("gt \n"); - printf("ka \n"); - } - } - } -#endif return 0; } @@ -231,730 +116,3 @@ GetArgs(char *line, char **args, int *nargs) line++; } } - -#ifdef notdef -afs_int32 -FetchData(char **argp) -{ - struct afsFetchStatus OutStatus; - struct afsToken Token; - struct afsVolSync tsync; - struct afsFid fid; - int vnode, unique, position, length; - int code; - struct rx_call *tcall; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - sscanf(&(*argp)[0], "%d", &position); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - tcall = rx_NewCall(cstruct->conns[0]); - code = StartAFS_FetchData(tcall, &fid, &hyp0, position, length, 0); - if (!code) { - code = FetchProc(tcall); - } - if (!code) { - code = EndAFS_FetchData(tcall, &OutStatus, &Token, &tsync); - } - code = rx_EndCall(tcall, code); - return code; -} - - -static afs_int32 -FetchProc(struct rx_call *acall) -{ - char *tbuffer; - afs_int32 tlen, length, code; - - code = rx_Read(acall, &length, sizeof(afs_int32)); - length = ntohl(length); - if (code != sizeof(afs_int32)) - return -1; - tbuffer = malloc(256); - while (length > 0) { - tlen = (length > 256 ? 256 : length); - code = rx_Read(acall, tbuffer, tlen); - if (code != tlen) { - free(tbuffer); - return -1; - } - length -= tlen; - } - free(tbuffer); - return 0; -} - - -afs_int32 -FetchStatus(char **argp) -{ - struct afsFetchStatus OutStatus; - struct afsToken Token; - struct afsVolSync tsync; - struct afsFid fid; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - code = - ubik_AFS_FetchStatus(cstruct, 0, &fid, &hyp0, 0, &OutStatus, - &Token, &tsync); - return (code); -} - - -afs_int32 -FetchACL(char **argp) -{ - struct afsFetchStatus OutStatus; - struct afsACL AccessList; - struct afsToken Token; - struct afsVolSync tsync; - struct afsFid fid; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - code = - ubik_AFS_FetchACL(cstruct, 0, &fid, &hyp0, 0, &AccessList, - &OutStatus, &tsync); - return (code); -} - - -afs_int32 -StoreData(char **argp) -{ - struct afsStoreStatus InStatus; - struct afsFetchStatus OutStatus; - struct afsVolSync tsync; - struct afsFid fid; - int vnode, unique, position, length, filelength; - int mode, owner, len; - int code; - char *string; - struct rx_call *tcall; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - sscanf(&(*argp)[0], "%d", &position); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - sscanf(&(*argp)[0], "%d", &filelength); - ++argp; - memset(&InStatus, 0, sizeof(struct afsStoreStatus)); - sscanf(&(*argp)[0], "%d", &mode); - ++argp; - sscanf(&(*argp)[0], "%d", &owner); - ++argp; - sscanf(&(*argp)[0], "%d", &len); - ++argp; - if (mode != -1) { - InStatus.mode = mode; - InStatus.mask |= AFS_SETMODE; - } - if (owner != -1) { - InStatus.owner = owner; - InStatus.mask |= AFS_SETOWNER; - } - if (length != -1) { - InStatus.length = length; - InStatus.mask |= AFS_SETLENGTH; - } - string = &argp[0][0]; - ++argp; - - tcall = rx_NewCall(cstruct->conns[0]); - code = - StartAFS_StoreData(tcall, &fid, &InStatus, position, length, - filelength, &hyp0, 0); - if (!code) { - code = StoreProc(tcall, string, length); - } - if (!code) { - code = EndAFS_StoreData(tcall, &OutStatus, &tsync); - } - code = rx_EndCall(tcall, code); - return (code); -} - - -static afs_int32 -StoreProc(struct rx_call *acall, char *string, int length) -{ - afs_int32 tlen, code; - - while (length > 0) { - tlen = (length > 256 ? 256 : length); - code = rx_Write(acall, string, tlen); - if (code != tlen) { - return -1; - } - length -= tlen; - } - return 0; -} - - -afs_int32 -StoreStatus(char **argp) -{ - struct afsStoreStatus InStatus; - struct afsFetchStatus OutStatus; - struct afsVolSync tsync; - struct afsFid fid; - int vnode, unique, mode, owner, length; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - memset(&InStatus, 0, sizeof(struct afsStoreStatus)); - sscanf(&(*argp)[0], "%d", &mode); - ++argp; - sscanf(&(*argp)[0], "%d", &owner); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - if (mode != -1) { - InStatus.mode = mode; - InStatus.mask |= AFS_SETMODE; - } - if (owner != -1) { - InStatus.owner = owner; - InStatus.mask |= AFS_SETOWNER; - } - if (length != -1) { - InStatus.length = length; - InStatus.mask |= AFS_SETLENGTH; - } - code = - ubik_AFS_StoreStatus(cstruct, 0, &fid, &InStatus, &hyp0, 0, - &OutStatus, &tsync); - return (code); -} - - -afs_int32 -StoreACL(char **argp) -{ - struct afsFetchStatus OutStatus; - struct afsACL AccessList; - struct afsToken Token; - struct afsVolSync tsync; - struct afsFid fid; - char *string; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - string = &argp[0][0]; - ++argp; - AccessList.afsACL_len = strlen(string) + 1; - AccessList.afsACL_val = string; - code = - ubik_AFS_StoreACL(cstruct, 0, &fid, &AccessList, &hyp0, 0, - &OutStatus, &tsync); - return (code); -} - - -afs_int32 -RemoveFile(char **argp) -{ - struct afsFetchStatus OutDirStatus, OutFidStatus; - struct afsVolSync tsync; - struct afsFidName nameFid; - struct afsFid fid, outFid; - char *name; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - memset(&nameFid, 0, sizeof(struct afsFidName)); - strcpy(nameFid.name, name); - code = - ubik_AFS_RemoveFile(cstruct, 0, &fid, &nameFid, &hyp0, 0, - &OutDirStatus, &OutFidStatus, &outFid, &tsync); - return (code); -} - - -afs_int32 -CreateFile(char **argp) -{ - struct afsFetchStatus OutDirStatus, OutFidStatus; - struct afsStoreStatus InStatus; - struct afsVolSync tsync; - struct afsFid fid, outFid; - struct afsToken Token; - char *name; - int vnode, unique, mode, owner, length; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - memset(&InStatus, 0, sizeof(struct afsStoreStatus)); - sscanf(&(*argp)[0], "%d", &mode); - ++argp; - sscanf(&(*argp)[0], "%d", &owner); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - if (mode != -1) { - InStatus.mode = mode; - InStatus.mask |= AFS_SETMODE; - } - if (owner != -1) { - InStatus.owner = owner; - InStatus.mask |= AFS_SETOWNER; - } - if (length != -1) { - InStatus.length = length; - InStatus.mask |= AFS_SETLENGTH; - } - code = - ubik_AFS_CreateFile(cstruct, 0, &fid, name, &InStatus, &hyp0, 0, - &outFid, &OutFidStatus, &OutDirStatus, &Token, &tsync); - return (code); -} - - -afs_int32 -Rename(char **argp) -{ - struct afsFetchStatus OutOldDirStatus, OutNewDirStatus; - struct afsFetchStatus OutOldFileStatus, OutNewFileStatus; - struct afsVolSync tsync; - struct afsFid OldDirFid, NewDirFid, OutOldFileFid, OutNewFileFid; - struct afsFidName OldName, NewName; - char *oname, *nname; - int ovnode, ounique, nvnode, nunique; - int code; - - sscanf(&(*argp)[0], "%d", &ovnode); - ++argp; - sscanf(&(*argp)[0], "%d", &ounique); - ++argp; - memset(&OldDirFid, 0, sizeof(struct afsFid)); - OldDirFid.Volume.low = 10; /* XXX */ - OldDirFid.Vnode = ovnode; - OldDirFid.Unique = ounique; - oname = &argp[0][0]; - ++argp; - memset(&OldName, 0, sizeof(struct afsFidName)); - strcpy(OldName.name, oname); - sscanf(&(*argp)[0], "%d", &nvnode); - ++argp; - sscanf(&(*argp)[0], "%d", &nunique); - ++argp; - memset(&NewDirFid, 0, sizeof(struct afsFid)); - NewDirFid.Volume.low = 10; /* XXX */ - NewDirFid.Vnode = nvnode; - NewDirFid.Unique = nunique; - nname = &argp[0][0]; - ++argp; - memset(&NewName, 0, sizeof(struct afsFidName)); - strcpy(NewName.name, nname); - code = - ubik_AFS_Rename(cstruct, 0, &OldDirFid, &OldName, &NewDirFid, - &NewName, &hyp0, 0, &OutOldDirStatus, &OutNewDirStatus, - &OutOldFileFid, &OutOldFileStatus, &OutNewFileFid, - &OutNewFileStatus, &tsync); - return (code); -} - - -afs_int32 -Symlink(char **argp) -{ - struct afsFetchStatus OutDirStatus, OutFidStatus; - struct afsStoreStatus InStatus; - struct afsVolSync tsync; - struct afsFid fid, outFid; - struct afsToken Token; - char *name, *linkcontents; - int vnode, unique, mode, owner, length; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - linkcontents = &argp[0][0]; - ++argp; - memset(&InStatus, 0, sizeof(struct afsStoreStatus)); - sscanf(&(*argp)[0], "%d", &mode); - ++argp; - sscanf(&(*argp)[0], "%d", &owner); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - if (mode != -1) { - InStatus.mode = mode; - InStatus.mask |= AFS_SETMODE; - } - if (owner != -1) { - InStatus.owner = owner; - InStatus.mask |= AFS_SETOWNER; - } - if (length != -1) { - InStatus.length = length; - InStatus.mask |= AFS_SETLENGTH; - } - code = - ubik_AFS_Symlink(cstruct, 0, &fid, name, linkcontents, - &InStatus, &hyp0, 0, &outFid, &OutFidStatus, &OutDirStatus, - &Token, &tsync); - return (code); -} - - -afs_int32 -HardLink(char **argp) -{ - struct afsFetchStatus OutDirStatus, OutFidStatus; - struct afsVolSync tsync; - struct afsFid fid, existingFid; - char *name; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&existingFid, 0, sizeof(struct afsFid)); - existingFid.Volume.low = 10; /* XXX */ - existingFid.Vnode = vnode; - existingFid.Unique = unique; - code = - ubik_AFS_HardLink(cstruct, 0, &fid, name, &existingFid, &hyp0, - 0, &OutFidStatus, &OutDirStatus, &tsync); - return (code); -} - - -afs_int32 -MakeDir(char **argp) -{ - struct afsFetchStatus OutDirStatus, OutFidStatus; - struct afsStoreStatus InStatus; - struct afsVolSync tsync; - struct afsFid fid, outFid; - struct afsToken Token; - char *name; - int vnode, unique, mode, owner, length; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - memset(&InStatus, 0, sizeof(struct afsStoreStatus)); - sscanf(&(*argp)[0], "%d", &mode); - ++argp; - sscanf(&(*argp)[0], "%d", &owner); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - if (mode != -1) { - InStatus.mode = mode; - InStatus.mask |= AFS_SETMODE; - } - if (owner != -1) { - InStatus.owner = owner; - InStatus.mask |= AFS_SETOWNER; - } - if (length != -1) { - InStatus.length = length; - InStatus.mask |= AFS_SETLENGTH; - } - code = - ubik_AFS_MakeDir(cstruct, 0, &fid, name, &InStatus, &hyp0, 0, - &outFid, &OutFidStatus, &OutDirStatus, &Token, &tsync); - return (code); -} - - -afs_int32 -RemoveDir(char **argp) -{ - struct afsFetchStatus OutDirStatus; - struct afsVolSync tsync; - struct afsFid fid, outFid; - struct afsFidName nameFid; - char *name; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - memset(&nameFid, 0, sizeof(struct afsFidName)); - strcpy(nameFid.name, name); - code = - ubik_AFS_RemoveDir(cstruct, 0, &fid, &nameFid, &hyp0, 0, - &OutDirStatus, &outFid, &tsync); - return (code); -} - - -afs_int32 -Readdir(char **argp) -{ - struct afsFetchStatus OutDirStatus; - struct afsVolSync tsync; - struct afsFid fid; - struct afsToken Token; - char *name; - struct rx_call *tcall; - int vnode, unique, offset, length, NextOffset; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - sscanf(&(*argp)[0], "%d", &offset); - ++argp; - sscanf(&(*argp)[0], "%d", &length); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - tcall = rx_NewCall(cstruct->conns[0]); - code = StartAFS_Readdir(tcall, &fid, offset, length, &hyp0, 0); - if (!code) { - code = FetchDir(tcall); - } - if (!code) { - code = - EndAFS_FetchData(tcall, &NextOffset, &OutDirStatus, &Token, - &tsync); - } - code = rx_EndCall(tcall, code); - return (code); -} - - -static afs_int32 -FetchDir(struct rx_call *acall) -{ - char *tbuffer; - afs_int32 tlen, length, code; - struct dirent *dp; - - - tbuffer = malloc(256); - while (1) { - code = rx_Read(acall, &length, sizeof(afs_int32)); - length = ntohl(length); - if (code != sizeof(afs_int32)) - return -1; - if (length == 0) - break; - tlen = (length > 8192 ? 8192 : length); - code = rx_Read(acall, tbuffer, tlen); - if (code != tlen) { - free(tbuffer); - return -1; - } - length -= tlen; - } - dp = (struct dirent *)dp; - free(tbuffer); - return 0; -} - - -afs_int32 -Lookup(char **argp) -{ - struct afsFetchStatus OutDirStatus, OutFidStatus; - struct afsVolSync tsync; - struct afsFid fid, outFid; - char *name; - int vnode, unique; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - name = &argp[0][0]; - ++argp; - code = - ubik_AFS_Lookup(cstruct, 0, &fid, name, &hyp0, 0, &outFid, - &OutFidStatus, &OutDirStatus, &tsync); - return (code); -} - - -afs_int32 -GetToken(char **argp) -{ - struct afsFetchStatus OutStatus; - struct afsVolSync tsync; - struct afsToken MinToken, RealToken; - struct afsFid fid; - int vnode, unique, tokenId; - int code; - - sscanf(&(*argp)[0], "%d", &vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &unique); - ++argp; - memset(&fid, 0, sizeof(struct afsFid)); - fid.Volume.low = 10; /* XXX */ - fid.Vnode = vnode; - fid.Unique = unique; - sscanf(&(*argp)[0], "%d", &tokenId); - ++argp; - memset(&MinToken, 0, sizeof(struct afsToken)); - MinToken.tokenID.low = tokenId; /* XXX */ - code = - ubik_AFS_GetToken(cstruct, 0, &fid, &MinToken, &hyp0, 0, - &RealToken, &OutStatus, &tsync); - return (code); -} - - -afs_int32 -MakeMountPoint(char **argp) -{ -} - - -afs_int32 -ReleaseTokens(char **argp) -{ -} - - -afs_int32 -BulkStatus(char **argp) -{ -} - -/* printf("ka \n"); */ -afs_int32 -KeepAlive(char **argp) -{ - struct afsBulkFEX fex; - afs_uint32 numExec, spare4; - struct afsFidExp fx; - int code; - - memset(&fx, 0, sizeof(struct afsFidExp)); - sscanf(&(*argp)[0], "%d", &fx.fid.Volume.low); - ++argp; - sscanf(&(*argp)[0], "%d", &fx.fid.Vnode); - ++argp; - sscanf(&(*argp)[0], "%d", &fx.fid.Unique); - ++argp; - sscanf(&(*argp)[0], "%d", &numExec); - ++argp; - sscanf(&(*argp)[0], "%d", &fx.keepAliveTime); - memset(&fex, 0, sizeof(struct afsBulkFEX)); - fex.afsBulkFEX_val = &fx; - fex.afsBulkFEX_len = 1; - code = - ubik_AFS_BulkKeepAlive(cstruct, 0, &fex, numExec, 0, 0, 0, - &spare4); - return (code); -} -#endif /* notdef */ diff --git a/src/viced/state_analyzer.c b/src/viced/state_analyzer.c index 6d8b2098a2..10974fd528 100644 --- a/src/viced/state_analyzer.c +++ b/src/viced/state_analyzer.c @@ -1844,33 +1844,6 @@ get_cb_entry(void) return 0; } -#if 0 -static int -find_he_by_index(afs_uint32 idx) -{ - int i; - - if (get_h_hdr()) { - return 1; - } - - for (i = 0; i < hdrs.h_hdr.records; i++) { - if (get_he(i)) { - fprintf(stderr, "error getting he %d\n", i); - return 1; - } - if (he_cursor.he.index == idx) - break; - } - - if (i < hdrs.h_hdr.records) { - dump_this_he(); - return 0; - } - return 1; -} -#endif - static int find_fe_by_index(afs_uint32 idx) { diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index 01e74a0fdb..75bf9362cd 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -1085,15 +1085,6 @@ ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile, } } for (p = inodes; p < einodes && i < e; i++, p++) { -#ifdef notdef - Log("Ino=%d, v1=%x, v2=%x, v3=%x, mode=%x size=%d, lcnt=%d\n", - i, p->di_vicep1, p->di_vicep2, p->di_vicep3, p->di_mode, - p->di_size, p->di_nlink); - printf - ("Ino=%d, v1=%x, v2=%x, v3=%x, mode=%x size=%d, lcnt=%d\n", - i, p->di_vicep1, p->di_vicep2, p->di_vicep3, p->di_mode, - p->di_size, p->di_nlink); -#endif #if defined(AFS_SUN5_ENV) /* if this is a pre-sol2.6 unconverted inode, bail out */ { diff --git a/src/vol/partition.c b/src/vol/partition.c index 215e935091..628de33943 100644 --- a/src/vol/partition.c +++ b/src/vol/partition.c @@ -1449,12 +1449,4 @@ AddPartitionToTable_r(struct DiskPartition64 *dp) DiskPartitionTable[dp->index] = dp; } -#if 0 -static void -DeletePartitionFromTable_r(struct DiskPartition64 *dp) -{ - opr_Assert(dp->index >= 0 && dp->index <= VOLMAXPARTS); - DiskPartitionTable[dp->index] = NULL; -} -#endif #endif /* AFS_DEMAND_ATTACH_FS */ diff --git a/src/vol/purge.c b/src/vol/purge.c index 77fe59ed44..16157b0de4 100644 --- a/src/vol/purge.c +++ b/src/vol/purge.c @@ -46,10 +46,6 @@ /* forward declarations */ static int ObliterateRegion(Volume * avp, VnodeClass aclass, StreamHandle_t * afile, afs_foff_t * aoffset); -#if 0 -static void PurgeIndex(Volume * vp, VnodeClass class); -static void PurgeHeader(Volume * vp); -#endif static void PurgeIndex_r(Volume * vp, VnodeClass class); static void PurgeHeader_r(Volume * vp); @@ -164,16 +160,6 @@ ObliterateRegion(Volume * avp, VnodeClass aclass, StreamHandle_t * afile, return -1; } -#if 0 -static void -PurgeIndex(Volume * vp, VnodeClass class) -{ - VOL_LOCK; - PurgeIndex_r(vp, class); - VOL_UNLOCK; -} -#endif - static void PurgeIndex_r(Volume * vp, VnodeClass class) { @@ -204,16 +190,6 @@ PurgeIndex_r(Volume * vp, VnodeClass class) FDH_CLOSE(fdP); } -#if 0 -static void -PurgeHeader(Volume * vp) -{ - VOL_LOCK; - PurgeHeader_r(vp); - VOL_UNLOCK; -} -#endif - static void PurgeHeader_r(Volume * vp) { diff --git a/src/vol/salvsync-server.c b/src/vol/salvsync-server.c index 63ed75e190..bd9f97424d 100644 --- a/src/vol/salvsync-server.c +++ b/src/vol/salvsync-server.c @@ -232,21 +232,6 @@ AddNodeToHash(struct SalvageQueueNode * node) SalvageHashTable[idx].len++; } -#if 0 -static void -DeleteNodeFromHash(struct SalvageQueueNode * node) -{ - int idx = VSHASH(node->command.sop.volume); - - if (queue_IsNotOnQueue(&node->hash_chain)) { - return; - } - - queue_Remove(&node->hash_chain); - SalvageHashTable[idx].len--; -} -#endif - void SALVSYNC_salvInit(void) { @@ -1085,25 +1070,6 @@ DeleteFromPendingQueue(struct SalvageQueueNode * node) } } -#if 0 -static struct SalvageQueueNode * -LookupPendingCommand(SALVSYNC_command_hdr * qry) -{ - struct SalvageQueueNode * np, * nnp; - - for (queue_Scan(&pendingQueue, np, nnp, SalvageQueueNode)) { - if ((np->command.sop.volume == qry->volume) && - !strncmp(np->command.sop.partName, qry->partName, - sizeof(qry->partName))) - break; - } - - if (queue_IsEnd(&pendingQueue, np)) - np = NULL; - return np; -} -#endif - static struct SalvageQueueNode * LookupPendingCommandByPid(int pid) { diff --git a/src/vol/volume.c b/src/vol/volume.c index a3b06628b1..d03d2fc339 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -155,9 +155,6 @@ static void ReleaseVolumeHeader(struct volHeader *hd); static void FreeVolumeHeader(Volume * vp); static void AddVolumeToHashTable(Volume * vp, VolumeId hashid); static void DeleteVolumeFromHashTable(Volume * vp); -#if 0 -static int VHold(Volume * vp); -#endif static int VHold_r(Volume * vp); static void VGetBitmap_r(Error * ec, Volume * vp, VnodeClass class); static void VReleaseVolumeHandles_r(Volume * vp); @@ -3749,18 +3746,6 @@ VOfflineTimeout(struct timespec *ats) #endif /* !AFS_PTHREAD_ENV */ -#if 0 -static int -VHold(Volume * vp) -{ - int retVal; - VOL_LOCK; - retVal = VHold_r(vp); - VOL_UNLOCK; - return retVal; -} -#endif - static afs_int32 VIsGoingOffline_r(struct Volume *vp) { @@ -4016,15 +4001,6 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, const struct timespec *timeout) { Volume *vp = hint; - /* pull this profiling/debugging code out of regular builds */ -#ifdef notdef -#define VGET_CTR_INC(x) x++ - unsigned short V0 = 0, V1 = 0, V2 = 0, V3 = 0, V5 = 0, V6 = - 0, V7 = 0, V8 = 0, V9 = 0; - unsigned short V10 = 0, V11 = 0, V12 = 0, V13 = 0, V14 = 0, V15 = 0; -#else -#define VGET_CTR_INC(x) -#endif #ifdef AFS_DEMAND_ATTACH_FS Volume *avp, * rvp = hint; #endif @@ -4053,7 +4029,6 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, *ec = 0; if (client_ec) *client_ec = 0; - VGET_CTR_INC(V0); vp = VLookupVolume_r(ec, volumeId, vp); if (*ec) { @@ -4070,9 +4045,7 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, #endif /* AFS_DEMAND_ATTACH_FS */ if (!vp) { - VGET_CTR_INC(V1); if (VInit < 2) { - VGET_CTR_INC(V2); /* Until we have reached an initialization level of 2 * we don't know whether this volume exists or not. * We can't sleep and retry later because before a volume @@ -4087,7 +4060,6 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, break; } - VGET_CTR_INC(V3); IncUInt64(&VStats.hdr_gets); #ifdef AFS_DEMAND_ATTACH_FS @@ -4223,7 +4195,6 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, LoadVolumeHeader(ec, vp); if (*ec) { - VGET_CTR_INC(V6); /* Only log the error if it was a totally unexpected error. Simply * a missing inode is likely to be caused by the volume being deleted */ if (errno != ENXIO || GetLogLevel() != 0) @@ -4243,21 +4214,17 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, break; } - VGET_CTR_INC(V7); if (vp->shuttingDown) { - VGET_CTR_INC(V8); *ec = VNOVOL; vp = NULL; break; } if (programType == fileServer) { - VGET_CTR_INC(V9); if (vp->goingOffline) { if (timeout && VTimedOut(timeout)) { /* we've timed out; don't wait for the vol */ } else { - VGET_CTR_INC(V10); #ifdef AFS_DEMAND_ATTACH_FS /* wait for the volume to go offline */ if (V_attachState(vp) == VOL_STATE_GOING_OFFLINE) { @@ -4275,21 +4242,15 @@ GetVolume(Error * ec, Error * client_ec, VolumeId volumeId, Volume * hint, } } if (vp->specialStatus) { - VGET_CTR_INC(V11); *ec = vp->specialStatus; } else if (V_inService(vp) == 0 || V_blessed(vp) == 0) { - VGET_CTR_INC(V12); *ec = VNOVOL; } else if (V_inUse(vp) == 0 || vp->goingOffline) { - VGET_CTR_INC(V13); *ec = VOFFLINE; - } else { - VGET_CTR_INC(V14); } } break; } - VGET_CTR_INC(V15); #ifdef AFS_DEMAND_ATTACH_FS /* if no error, bump nUsers */ @@ -4768,16 +4729,6 @@ VDetachVolume_r(Error * ec, Volume * vp) * which the file server would attempt to put on line */ FSYNC_VolOp(volume, tpartp->name, useDone, 0, NULL); - /* XXX this code path is only hit by volume utilities, thus - * V_BreakVolumeCallbacks will always be NULL. if we really - * want to break callbacks in this path we need to use FSYNC_VolOp() */ -#ifdef notdef - /* Dettaching it so break all callbacks on it */ - if (V_BreakVolumeCallbacks) { - Log("volume %u detached; breaking all call backs\n", volume); - (*V_BreakVolumeCallbacks) (volume); - } -#endif } #endif /* FSSYNC_BUILD_CLIENT */ } diff --git a/src/vol/volume.h b/src/vol/volume.h index f1739de4f4..d8d25a98ef 100644 --- a/src/vol/volume.h +++ b/src/vol/volume.h @@ -29,10 +29,7 @@ typedef bit32 FileOffset; /* Offset in this file */ #include "daemon_com.h" #include "fssync.h" -#if 0 -/** turn this on if you suspect a volume package locking bug */ -#define VOL_LOCK_DEBUG 1 -#endif +/** turn on VOL_LOCK_DEBUG if you suspect a volume package locking bug */ #ifdef VOL_LOCK_DEBUG #define VOL_LOCK_ASSERT_HELD \ diff --git a/src/volser/restorevol.c b/src/volser/restorevol.c index be26f65553..376255875c 100644 --- a/src/volser/restorevol.c +++ b/src/volser/restorevol.c @@ -362,19 +362,6 @@ struct vNode { afs_int32 modebits; afs_int32 parent; char acl[192]; -#ifdef notdef - struct acl_accessList { - int size; /*size of this access list in bytes, including MySize itself */ - int version; /*to deal with upward compatibility ; <= ACL_ACLVERSION */ - int total; - int positive; /* number of positive entries */ - int negative; /* number of minus entries */ - struct acl_accessEntry { - int id; /*internally-used ID of user or group */ - int rights; /*mask */ - } entries[100]; - } acl; -#endif afs_sfsize_t dataSize; }; @@ -923,10 +910,6 @@ WorkerBee(struct cmd_syndesc *as, void *arock) char *name = NULL; char *thisdir, *t; struct DumpHeader dh; /* Defined in dump.h */ -#if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */ - extern char *getwd(); -#define getcwd(x,y) getwd(x) -#endif thisdir = calloc(1, MAXPATHLEN+4); if (!thisdir) goto mem_error_exit; diff --git a/src/volser/vol-dump.c b/src/volser/vol-dump.c index 1efbbaf0a8..11a1437036 100644 --- a/src/volser/vol-dump.c +++ b/src/volser/vol-dump.c @@ -145,15 +145,6 @@ handleit(struct cmd_syndesc *as, void *arock) afs_int32 code; -#ifndef AFS_NT40_ENV -#if 0 - if (geteuid() != 0) { - fprintf(stderr, "voldump must be run as root; sorry\n"); - exit(1); - } -#endif -#endif - if ((ti = as->parms[0].items)) partName = ti->data; if ((ti = as->parms[1].items)) diff --git a/src/volser/vos.c b/src/volser/vos.c index 986a8ed7c7..ac0ca41522 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -2071,32 +2071,6 @@ CreateVolume(struct cmd_syndesc *as, void *arock) return 0; } -#if 0 -static afs_int32 -DeleteAll(struct nvldbentry *entry) -{ - int i; - afs_int32 error, code, curserver, curpart; - afs_uint32 volid; - - MapHostToNetwork(entry); - error = 0; - for (i = 0; i < entry->nServers; i++) { - curserver = entry->serverNumber[i]; - curpart = entry->serverPartition[i]; - if (entry->serverFlags[i] & VLSF_ROVOL) { - volid = entry->volumeId[ROVOL]; - } else { - volid = entry->volumeId[RWVOL]; - } - code = UV_DeleteVolume(curserver, curpart, volid); - if (code && !error) - error = code; - } - return error; -} -#endif - static int DeleteVolume(struct cmd_syndesc *as, void *arock) { @@ -2755,18 +2729,6 @@ CloneVolume(struct cmd_syndesc *as, void *arock) volname, VOLSER_OLDMAXVOLNAME - 1); return E2BIG; } -#if 0 - /* - * In order that you be able to make clones of RO or BK, this - * check must be omitted. - */ - if (!VolNameOK(volname)) { - fprintf(STDERR, - "Illegal volume name %s, should not end in .readonly or .backup\n", - volname); - return EINVAL; - } -#endif if (IsNumeric(volname)) { fprintf(STDERR, "Illegal volume name %s, should not be a number\n", @@ -6044,9 +6006,6 @@ main(int argc, char **argv) "initial quota (KB)"); cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "volume ID"); cmd_AddParm(ts, "-roid", CMD_SINGLE, CMD_OPTIONAL, "readonly volume ID"); -#ifdef notdef - cmd_AddParm(ts, "-minquota", CMD_SINGLE, CMD_OPTIONAL, ""); -#endif COMMONPARMS; ts = cmd_CreateSyntax("remove", DeleteVolume, NULL, 0, "delete a volume"); diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 87506f8b43..53e8190c56 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -159,11 +159,6 @@ do { \ /* Protos for static routines */ -#if 0 -static afs_int32 CheckAndDeleteVolume(struct rx_connection *aconn, - afs_int32 apart, afs_uint32 okvol, - afs_uint32 delvol); -#endif static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index, struct rx_connection **connPtr, afs_int32 * transPtr, afs_uint32 * crtimePtr, afs_uint32 * uptimePtr, @@ -485,57 +480,6 @@ AFSVolTransCreate_retry(struct rx_connection *z_conn, return code; } -#if 0 -/* if is allright(indicated by beibg able to - * start a transaction, delete the */ -static afs_int32 -CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart, - afs_uint32 okvol, afs_uint32 delvol) -{ - afs_int32 error, code, tid, rcode; - error = 0; - code = 0; - - if (okvol == 0) { - code = AFSVolTransCreate_retry(aconn, delvol, apart, ITOffline, &tid); - if (!error && code) - error = code; - code = AFSVolDeleteVolume(aconn, tid); - if (!error && code) - error = code; - code = AFSVolEndTrans(aconn, tid, &rcode); - if (!code) - code = rcode; - if (!error && code) - error = code; - return error; - } else { - code = AFSVolTransCreate_retry(aconn, okvol, apart, ITOffline, &tid); - if (!code) { - code = AFSVolEndTrans(aconn, tid, &rcode); - if (!code) - code = rcode; - if (!error && code) - error = code; - code = AFSVolTransCreate_retry(aconn, delvol, apart, ITOffline, &tid); - if (!error && code) - error = code; - code = AFSVolDeleteVolume(aconn, tid); - if (!error && code) - error = code; - code = AFSVolEndTrans(aconn, tid, &rcode); - if (!code) - code = rcode; - if (!error && code) - error = code; - } else - error = code; - return error; - } -} - -#endif - /* called by EmuerateEntry, show vldb entry in a reasonable format */ void SubEnumerateEntry(struct nvldbentry *entry) @@ -545,25 +489,6 @@ SubEnumerateEntry(struct nvldbentry *entry) int isMixed = 0; char hoststr[16]; -#ifdef notdef - fprintf(STDOUT, " readWriteID %-10u ", entry->volumeId[RWVOL]); - if (entry->flags & VLF_RWEXISTS) - fprintf(STDOUT, " valid \n"); - else - fprintf(STDOUT, " invalid \n"); - fprintf(STDOUT, " readOnlyID %-10u ", entry->volumeId[ROVOL]); - if (entry->flags & VLF_ROEXISTS) - fprintf(STDOUT, " valid \n"); - else - fprintf(STDOUT, " invalid \n"); - fprintf(STDOUT, " backUpID %-10u ", entry->volumeId[BACKVOL]); - if (entry->flags & VLF_BACKEXISTS) - fprintf(STDOUT, " valid \n"); - else - fprintf(STDOUT, " invalid \n"); - if ((entry->cloneId != 0) && (entry->flags & VLF_ROEXISTS)) - fprintf(STDOUT, " releaseClone %-10u \n", entry->cloneId); -#else if (entry->flags & VLF_RWEXISTS) fprintf(STDOUT, " RWrite: %-10u", entry->volumeId[RWVOL]); if (entry->flags & VLF_ROEXISTS) @@ -573,7 +498,6 @@ SubEnumerateEntry(struct nvldbentry *entry) if ((entry->cloneId != 0) && (entry->flags & VLF_ROEXISTS)) fprintf(STDOUT, " RClone: %-10lu", (unsigned long)entry->cloneId); fprintf(STDOUT, "\n"); -#endif fprintf(STDOUT, " number of sites -> %lu\n", (unsigned long)entry->nServers); for (i = 0; i < entry->nServers; i++) { @@ -868,13 +792,8 @@ UV_AddVLDBEntry(afs_uint32 aserver, afs_int32 apart, char *aname, entry.flags = VLF_RWEXISTS; /* this records that rw volume exists */ entry.serverFlags[0] = VLSF_RWVOL; /*this rep site has rw vol */ entry.volumeId[RWVOL] = aid; -#ifdef notdef - entry.volumeId[ROVOL] = anewid + 1; /* rw,ro, bk id are related in the default case */ - entry.volumeId[BACKVOL] = *anewid + 2; -#else entry.volumeId[ROVOL] = 0; entry.volumeId[BACKVOL] = 0; -#endif entry.cloneId = 0; /*map into right byte order, before passing to xdr, the stuff has to be in host * byte order. Xdr converts it into network order */ @@ -1978,21 +1897,6 @@ UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart, } /* or drop through */ } -#ifdef notdef - /* This is tricky. File server is very stupid, and if you mark the volume - * as VTOutOfService, it may mark the *good* instance (if you're moving - * between partitions on the same machine) as out of service. Since - * we're cleaning this code up in DEcorum, we're just going to kludge around - * it for now by removing this call. */ - /* already out of service, just zap it now */ - code = - AFSVolSetFlags(fromconn, fromtid, VTDeleteOnSalvage | VTOutOfService); - if (code) { - fprintf(STDERR, - "Failed to set the flags to make the old source volume offline\n"); - goto mfail; - } -#endif if (atoserver != afromserver) { /* set forwarding pointer for moved volumes */ VPRINT1("Setting forwarding pointer for volume %u ...", afromvol); diff --git a/tests/rpctestlib/rpc_test_procs.c b/tests/rpctestlib/rpc_test_procs.c index 7b70a861cc..586324207a 100644 --- a/tests/rpctestlib/rpc_test_procs.c +++ b/tests/rpctestlib/rpc_test_procs.c @@ -179,12 +179,7 @@ afs_int32 init_callback_service(rpc_test_request_ctx *ctx) afs_uuid_create(&(ctx->cb_listen_addr.uuid)); #if !defined(RPC_TEST_GLOBAL_RX_INIT) -#if 0 - code = rx_InitHost(ctx->cb_listen_addr.addr_in[0], - (int) htons(ctx->cb_port)); -#else code = rx_Init((int) htons(ctx->cb_port)); -#endif #endif /* RPC_TEST_GLOBAL_RX_INIT */ assert(pthread_attr_init(&tattr) == 0);