mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
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 <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
parent
0d6a43e069
commit
339167ef1f
@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 __________________________________________________________________
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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:A<B, 0:A==B, 1:A>B
|
||||
}
|
||||
|
||||
return 0; // no differences before told to stop comparing, so A==B
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* REALLOC ____________________________________________________________________
|
||||
*
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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"
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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:
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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 /* {
|
||||
|
@ -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 */
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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)
|
||||
|
@ -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*/
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -27,10 +27,6 @@
|
||||
#include <afs/gtxwindows.h> /*Generic window package */
|
||||
#include <afs/gtxobjects.h> /*Object definitions */
|
||||
#include <afs/gtxkeymap.h>
|
||||
#if 0
|
||||
#include <afs/gtxtextcb.h> /*Text object circular buffer interface */
|
||||
#include <afs/gtxtextobj.h> /*Text object interface */
|
||||
#endif
|
||||
#include <afs/gtxlightobj.h> /*Light object interface */
|
||||
#include <afs/gtxcurseswin.h> /*Curses window package */
|
||||
#include <afs/gtxdumbwin.h> /*Dumb terminal window package */
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -1110,11 +1110,6 @@ ktc_curpag(void)
|
||||
* <mit-copyright.h>.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#include <sys/file.h>
|
||||
#include <krb.h>
|
||||
#endif
|
||||
|
||||
#define TOO_BIG -1
|
||||
#define TF_LCK_RETRY ((unsigned)2) /* seconds to sleep before
|
||||
* retry if ticket file is
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
|
@ -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 *
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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 */
|
||||
|
@ -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)))
|
||||
|
165
src/budb/procs.c
165
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)
|
||||
{
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -122,10 +122,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -126,10 +126,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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 */
|
||||
|
@ -120,10 +120,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -122,10 +122,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -132,10 +132,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -135,10 +135,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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 */
|
||||
|
@ -129,10 +129,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -133,10 +133,6 @@
|
||||
|
||||
#include <afs/afs_sysnames.h>
|
||||
|
||||
#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
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user