From 3828c257ae33306bbdd3c6db9381601fe5b1b110 Mon Sep 17 00:00:00 2001 From: Jim Rees Date: Tue, 14 Feb 2006 16:58:13 +0000 Subject: [PATCH] dead-code-and-prototyes-20060214 Remove dead code and add prototypes. --- src/viced/afsfileprocs.c | 148 +++------------------------------------ src/viced/callback.c | 2 - src/viced/host.h | 23 ++++++ 3 files changed, 31 insertions(+), 142 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index f24467968..a029d8ce0 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -42,10 +42,11 @@ RCSID #else #include #include -#include -#include #include #include +#include +#include +#include #ifdef HAVE_STRING_H #include @@ -1021,49 +1022,6 @@ RXStore_AccessList(Vnode * targetptr, struct AFSOpaque *AccessList) } /*RXStore_AccessList */ -static afs_int32 -Fetch_AccessList(Vnode * targetptr, Vnode * parentwhentargetnotdir, - struct AFSAccessList *AccessList) -{ - char *eACL; /* External access list placeholder */ - - assert(acl_Externalize - ((targetptr->disk.type == - vDirectory ? VVnodeACL(targetptr) : - VVnodeACL(parentwhentargetnotdir)), &eACL) == 0); - if ((strlen(eACL) + 1) > AccessList->MaxSeqLen) { - acl_FreeExternalACL(&eACL); - return (E2BIG); - } else { - strcpy((char *)(AccessList->SeqBody), (char *)eACL); - AccessList->SeqLen = strlen(eACL) + 1; - } - acl_FreeExternalACL(&eACL); - return (0); - -} /*Fetch_AccessList */ - -/* - * The Access List information is converted from its external form in the - * input AccessList structure to the internal representation and copied into - * the target dir's vnode storage. - */ -static afs_int32 -Store_AccessList(Vnode * targetptr, struct AFSAccessList *AccessList) -{ - struct acl_accessList *newACL; /* PlaceHolder for new access list */ - - if (acl_Internalize(AccessList->SeqBody, &newACL) != 0) - return (EINVAL); - if ((newACL->size + 4) > VAclSize(targetptr)) - return (E2BIG); - memcpy((char *)VVnodeACL(targetptr), (char *)newACL, (int)(newACL->size)); - acl_FreeACL(&newACL); - return (0); - -} /*Store_AccessList */ - - /* In our current implementation, each successive data store (new file * data version) creates a new inode. This function creates the new * inode, copies the old inode's contents to the new one, remove the old @@ -1810,80 +1768,6 @@ RXUpdate_VolumeStatus(Volume * volptr, AFSStoreVolumeStatus * StoreVolStatus, } /*RXUpdate_VolumeStatus */ -/* old interface */ -static afs_int32 -Update_VolumeStatus(Volume * volptr, VolumeStatus * StoreVolStatus, - struct BBS *Name, struct BBS *OfflineMsg, - struct BBS *Motd) -{ - Error errorCode = 0; - - if (StoreVolStatus->MinQuota > -1) - V_minquota(volptr) = StoreVolStatus->MinQuota; - if (StoreVolStatus->MaxQuota > -1) - V_maxquota(volptr) = StoreVolStatus->MaxQuota; - if (OfflineMsg->SeqLen > 1) - strcpy(V_offlineMessage(volptr), OfflineMsg->SeqBody); - if (Name->SeqLen > 1) - strcpy(V_name(volptr), Name->SeqBody); -#if OPENAFS_VOL_STATS - /* - * We don't overwrite the motd field, since it's now being used - * for stats - */ -#else - if (Motd->SeqLen > 1) - strcpy(V_motd(volptr), Motd->SeqBody); -#endif /* FS_STATS_DETAILED */ - VUpdateVolume(&errorCode, volptr); - return (errorCode); - -} /*Update_VolumeStatus */ - - -/* - * Get internal volume-related statistics from the Volume disk label - * structure and put it into the VolumeStatus structure, status; it's - * used by both SAFS_GetVolumeStatus and SAFS_SetVolumeStatus to return - * the volume status to the caller. - */ -static afs_int32 -GetVolumeStatus(VolumeStatus * status, struct BBS *name, struct BBS *offMsg, - struct BBS *motd, Volume * volptr) -{ - status->Vid = V_id(volptr); - status->ParentId = V_parentId(volptr); - status->Online = V_inUse(volptr); - status->InService = V_inService(volptr); - status->Blessed = V_blessed(volptr); - status->NeedsSalvage = V_needsSalvaged(volptr); - if (VolumeWriteable(volptr)) - status->Type = ReadWrite; - else - status->Type = ReadOnly; - status->MinQuota = V_minquota(volptr); - status->MaxQuota = V_maxquota(volptr); - status->BlocksInUse = V_diskused(volptr); - status->PartBlocksAvail = volptr->partition->free; - status->PartMaxBlocks = volptr->partition->totalUsable; - strncpy(name->SeqBody, V_name(volptr), (int)name->MaxSeqLen); - name->SeqLen = strlen(V_name(volptr)) + 1; - if (name->SeqLen > name->MaxSeqLen) - name->SeqLen = name->MaxSeqLen; - strncpy(offMsg->SeqBody, V_offlineMessage(volptr), (int)name->MaxSeqLen); - offMsg->SeqLen = strlen(V_offlineMessage(volptr)) + 1; - if (offMsg->SeqLen > offMsg->MaxSeqLen) - offMsg->SeqLen = offMsg->MaxSeqLen; -#ifdef notdef - /*Don't do anything with the motd field */ - strncpy(motd->SeqBody, nullString, (int)offMsg->MaxSeqLen); - motd->SeqLen = strlen(nullString) + 1; -#endif - if (motd->SeqLen > motd->MaxSeqLen) - motd->SeqLen = motd->MaxSeqLen; - -} /*GetVolumeStatus */ - static afs_int32 RXGetVolumeStatus(AFSFetchVolumeStatus * status, char **name, char **offMsg, char **motd, Volume * volptr) @@ -1960,26 +1844,6 @@ FileNameOK(register char *aname) } /*FileNameOK */ -/* Debugging tool to print Volume Statu's contents */ -static void -PrintVolumeStatus(VolumeStatus * status) -{ - ViceLog(5, ("Volume header contains:\n")); - ViceLog(5, - ("Vid = %u, Parent = %u, Online = %d, InService = %d, Blessed = %d, NeedsSalvage = %d\n", - status->Vid, status->ParentId, status->Online, status->InService, - status->Blessed, status->NeedsSalvage)); - ViceLog(5, - ("MinQuota = %d, MaxQuota = %d\n", status->MinQuota, - status->MaxQuota)); - ViceLog(5, - ("Type = %d, BlocksInUse = %d, PartBlocksAvail = %d, PartMaxBlocks = %d\n", - status->Type, status->BlocksInUse, status->PartBlocksAvail, - status->PartMaxBlocks)); - -} /*PrintVolumeStatus */ - - /* * This variant of symlink is expressly to support the AFS/DFS translator * and is not supported by the AFS fileserver. We just return EINVAL. @@ -2003,6 +1867,7 @@ SRXAFS_ResidencyCmd(struct rx_call * acall, struct AFSFid * Fid, return EINVAL; } +#ifdef AFS_NT40_ENV static struct afs_buffer { struct afs_buffer *next; } *freeBufferList = 0; @@ -2044,6 +1909,7 @@ AllocSendBuffer() return (char *)tp; } /*AllocSendBuffer */ +#endif /* AFS_NT40_ENV */ /* * This routine returns the status info associated with the targetptr vnode @@ -7416,12 +7282,14 @@ afs_int32 SRXAFS_CallBackRxConnAddr (struct rx_call * acall, afs_int32 *addr) { Error errorCode = 0; + struct rx_connection *tcon; +#ifdef __EXPERIMENTAL_CALLBACK_CONN_MOVING struct host *thost; struct client *tclient; static struct rx_securityClass *sc = 0; int i,j; - struct rx_connection *tcon; struct rx_connection *conn; +#endif if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon)) goto Bad_CallBackRxConnAddr1; diff --git a/src/viced/callback.c b/src/viced/callback.c index 45a9dbe47..bb6b1fbb7 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -2207,8 +2207,6 @@ MultiProbeAlternateAddress_r(struct host *host) * Uuid and fix the host tables. */ if (multi_error == 1) { - struct host * newhost; - /* remove the current alternate address from this host */ H_LOCK; for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) { diff --git a/src/viced/host.h b/src/viced/host.h index 73ee45be9..af25a1f49 100644 --- a/src/viced/host.h +++ b/src/viced/host.h @@ -198,6 +198,21 @@ extern int h_Lock_r(register struct host *host); ( h == hostList )? (hostList = h->next):0; extern int DeleteAllCallBacks_r(struct host *host, int deletefe); +extern int DeleteCallBack(struct host *host, AFSFid * fid); +extern int MultiProbeAlternateAddress_r(struct host *host); +extern int BreakDelayedCallBacks_r(struct host *host); +extern int AddCallBack1(struct host *host, AFSFid * fid, afs_uint32 * thead, int type, + int locked); +extern int BreakCallBack(struct host *xhost, AFSFid * fid, int flag); +extern int DeleteFileCallBacks(AFSFid * fid); +extern int CleanupTimedOutCallBacks(void); +extern int CleanupTimedOutCallBacks_r(void); +extern int MultiBreakCallBackAlternateAddress(struct host *host, struct AFSCBFids *afidp); +extern int MultiBreakCallBackAlternateAddress_r(struct host *host, + struct AFSCBFids *afidp); +extern int DumpCallBackState(void); +extern void ShutDownAndCore(int dopanic); + extern struct host *h_Alloc(register struct rx_connection *r_con); extern struct host *h_Alloc_r(register struct rx_connection *r_con); extern struct host *h_Lookup_r(afs_uint32 hostaddr, afs_uint32 hport, @@ -205,6 +220,7 @@ extern struct host *h_Lookup_r(afs_uint32 hostaddr, afs_uint32 hport, extern struct host *h_LookupUuid_r(afsUUID * uuidp); extern int h_FreeConnection(struct rx_connection *tcon); extern void h_Enumerate(int (*proc) (), char *param); +extern void h_Enumerate_r(int (*proc) (), struct host *enumstart, char *param); extern struct host *h_GetHost_r(struct rx_connection *tcon); extern struct client *h_FindClient_r(struct rx_connection *tcon); extern int h_ReleaseClient_r(struct client *client); @@ -216,7 +232,14 @@ extern void h_PrintClients(); extern void h_GetWorkStats(); extern void h_flushhostcps(register afs_uint32 hostaddr, register afs_uint32 hport); +extern void h_GetHostNetStats(afs_int32 * a_numHostsP, afs_int32 * a_sameNetOrSubnetP, + afs_int32 * a_diffSubnetP, afs_int32 * a_diffNetworkP); +extern int h_NBLock_r(register struct host *host); +extern void h_DumpHosts(); +extern void h_InitHostPackage(); +extern void h_CheckHosts(); struct Interface *MultiVerifyInterface_r(); +extern int initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf); struct host *(hosttableptrs[h_MAXHOSTTABLES]); /* Used by h_itoh */ #define h_htoi(host) ((host)->index) /* index isn't zeroed, no need to lock */ -- 2.39.5