(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
}
/**
{
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
-
}
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;
// 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
//
{
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);
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);
// 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);
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
}
}
*
*/
-#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 __________________________________________________________________
bplus_build_time += (end.QuadPart - start.QuadPart);
-#if 0
- cm_BPlusDirEnumTest(scp, 1);
-#endif
return rc;
}
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
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)
}
#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.
*
}
}
-#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];
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
}
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);
}
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);
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;
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
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");
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");
/* 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(
{
}
-#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)
{
}
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);
}
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;
/* 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;
smb_FreeTran2Packet(outp);
return 0;
-#endif
}
/* TRANS2_QUERY_FILE_INFORMATION */
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");
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 */
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))
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 ____________________________________________________________________
*
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;
*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;
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;
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;
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);
}
#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,
argv[1], argv[2], argv[3]);
}
#endif
-#endif
#endif
#endif
-/* Does your compiler understand "void"? */
-#ifdef notdef
-#define void int
-#endif
-
/*
* A few checks to see that necessary definitions are included.
*/
* 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"
#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 */
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
(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,
*/
#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:
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));
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);
}
{
khm_int32 rv = KHM_ERROR_SUCCESS;
- /* we don't really do anything with this yet */
-#if 0
- switch(msg_subtype) {
- }
-#endif
-
return rv;
}
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;
}
{
#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 */
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);
}
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);
#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;
}
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);
}
#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
#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
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;
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();
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
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;
}
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 */
}
if (ap->a_runp != NULL)
*ap->a_runp = 0;
-#ifdef notyet
- if (ap->a_runb != NULL)
- *ap->a_runb = 0;
-#endif
return 0;
}
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();
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;
{
return EOPNOTSUPP;
}
-#endif
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,
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 /* {
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);
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.
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);
}
/* 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;
}
hashUnlock(hashTable[index].lock);
}
-#if 0
- if (!foundFlag)
- osi_Panic("afs: SEMA HashTable full\n");
-#endif
}
#endif /* AFS_SV_SEMA_HASH */
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 {
}
-#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;
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
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);
void
osi_DisableAtimes(struct vnode *avp)
{
-#if 0
- VTOI(avp)->i_flag &= ~IN_ACCESS;
-#endif
}
#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
{&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 */
#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);
}
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();
*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);
}
void
osi_DisableAtimes(struct vnode *avp)
{
-#if 0
- VTOI(avp)->i_flag &= ~IN_ACCESS;
-#endif
}
}
#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;
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)
if (!haveGlock)
AFS_GUNLOCK();
return code;
-#endif
}
#ifdef AFS_OBSD42_ENV
#define osi_vnhold(avc, r) do { VN_HOLD(AFSTOV(avc)); } while(0)
-#if 0
-#define afs_suser(x) suser(x)
-#endif
/*
* Global lock support.
*/
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)
}
-#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*/
afs_FlushReclaimedVcaches();
ReleaseWriteLock(&afs_xvcache);
afs_FlushActiveVcaches(1); /* keep flocks held & flush nfs writes */
-#if 0
- afs_StoreDirtyVcaches();
-#endif
last1MinCheck = now;
}
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);
} /* 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) {
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;
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;
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;
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) */
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.
*
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);
(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;
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) {
#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 */
/* 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
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,
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);
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,
* <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
}
}
-#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);
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) {
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");
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 *
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)
{
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
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.
}
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
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
(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,
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 */
}
-#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,
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)))
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)
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)
{
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 {
/* 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)
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)
{
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)
#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
#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
#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
#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
#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"
#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
#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 */
#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
#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
#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
#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 */
#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
#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 assistence in this matter. The hyper type is supposed to be compatible
* with the afsHyper type: the same macros will work on both. */
-#if 0
-
-typedef unsigned long afs_hyper_t;
-
-#define hcmp(a,b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
-#define hsame(a,b) ((a) == (b))
-#define hiszero(a) ((a) == 0)
-#define hfitsin32(a) ((a) & 0xffffffff00000000) == 0)
-#define hset(a,b) ((a) = (b))
-#define hzero(a) ((a) = 0)
-#define hones(a) ((a) = ~((unsigned long)0))
-#define hget32(i,a) ((i) = (unsigned int)(a))
-#define hget64(hi,lo,a) ((lo) = ((unsigned int)(a)), (hi) = ((a) & (0xffffffff00000000)))
-#define hset32(a,i) ((a) = ((unsigned int)(i)))
-#define hset64(a,hi,lo) ((a) = (((hi) << 32) | (lo)))
-#define hgetlo(a) ((a) & 0xffffffff)
-#define hgethi(a) (((unsigned int)(a)) >> 32)
-#define hadd(a,b) ((a) += (b))
-/* XXX */
-#define hadd32(a,b) ((a) += (b))
-#define hshlft(a,n) ((a)<<(n))
-
-#else /* 0*/
-
typedef struct afs_hyper_t { /* unsigned 64 bit integers */
unsigned int high;
unsigned int low;
(a).low += (int)(i))
#define hadd(a,b) (hadd32(a,(b).low), (a).high += (b).high)
-#endif /* 0 */
#if !defined(KERNEL) || defined(UKERNEL)
#ifndef AFS_NT40_ENV
sysconfig(SYS_KULOAD, &cload, sizeof(cload));
exit(1);
}
-#ifdef notdef
- printf("cfgafs -d 0x%x # to remove AFS\n", cload.kmid);
-#endif
strcpy(PidFile, file);
strcat(PidFile, ".kmid");
fp = fopen(PidFile, "w");
while (len >= left) {
fprintf(stderr, "cfgexport: Out of memory. Increase SYMBUFSIZE and recompile\n");
exit(1);
-#if 0
- /* Something is broken with this code, after being here
- cfgexport segfaults */
- export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
- if (!export_strings)
- error("no memory for EXPORT string table");
- *strp = export_strings;
- left += SYMBUFSIZE;
- prev = ""; /* lazy */
-#endif
}
strcpy(prev = *strp + offset, xstrings + xp->n_offset);
{
sym_t *sym;
int i, pri;
-#if 0
- static caddr_t *g_toc;
-#endif
if (!myg_toc) {
#ifdef __XCOFF64__
refresh();
standend();
-#if 0
- box addstr("Enter a string and a number: ");
- refresh();
- scanw(stdscr, "%s %d", str, &i);
- wprintw(stdscr, "String was '%s', number was %d\n", str, i);
- refresh();
-#endif /* 0 */
-
endwin();
} /*main */
/*Value for gwin w_type field*/
#define GATOR_WIN_X11 3
-/*Private data for a X11 gwin*/
-#if 0
-struct gator_X11gwin {
- WINDOW *wp; /*Window pointer */
- int charwidth; /*Character width in pixels */
- int charheight; /*Character height in pixels */
- char box_vertchar; /*Vertical char for boxing purposes */
- char box_horizchar; /*Horizontal char for boxing purposes */
-};
-#endif /* 0 */
-
/*X11 gwin's creation parameters*/
struct gator_X11gwin_params {
struct gwin_createparams gwin_params; /*Basic params for the window */
/*Value for gwin w_type field*/
#define GATOR_WIN_DUMB 1
-/*Private data for a dumb gwin*/
-#if 0
-struct gator_dumbgwin {
- WINDOW *wp; /*Window pointer */
- int charwidth; /*Character width in pixels */
- int charheight; /*Character height in pixels */
- char box_vertchar; /*Vertical char for boxing purposes */
- char box_horizchar; /*Horizontal char for boxing purposes */
-};
-#endif /* 0 */
-
/*Dumb gwin's creation parameters*/
struct gator_dumbgwin_params {
struct gwin_createparams gwin_params; /*Basic params for the window */
int code; /*Return code */
struct onode_initparams oi_params; /*Init params */
struct gwin_initparams wi_params; /*Window initialization params */
-#if 0
- /*We don't need these, do we? */
- struct gator_cursesgwin_params c_crparams; /*Curses window creation params */
- struct gator_dumbgwin_params d_crparams; /*Dumb terminal window creation params */
- struct gator_X11gwin_params x_crparams; /*X11 window creation params */
-#endif /* 0 */
struct gator_light_crparams light_crparams; /*Light creation params */
char helpstring1[128]; /*Help string to use */
char helpstring2[128]; /*Help string to use */
{
afs_int32 code;
-#ifdef notdef
- struct ktc_principal server;
-
- if (as->parms[0].items) {
- char *name = as->parms[0].items->data;
- code =
- ka_ParseLoginName(name, server.name, server.instance,
- server.cell);
- if (code) {
- afs_com_err(whoami, code, "couldn't interpret name '%s'", name);
- return code;
- }
- if (server.cell[0] == 0) {
- if (code = DefaultCell())
- return code;
- strcpy(server.cell, cell);
- } else {
- code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ );
- if (code) {
- afs_com_err(whoami, code, "Can't expand cell name");
- return code;
- }
- }
- code = ktc_ForgetToken(&server);
- if (code) {
- afs_com_err(whoami, code, "couldn't remove tokens for %s",
- PrintedPrincipal(&server));
- return code;
- }
- } else {
- if (!as->parms[1].items) {
- fprintf(stderr, "Must specify server name or -all\n");
- return KABADCMD;
- }
- code = ktc_ForgetAllTokens();
- if (code) {
- afs_com_err(whoami, code, "couldn't delete all tokens");
- return code;
- }
- }
-#endif
code = ktc_ForgetAllTokens();
if (code) {
afs_com_err(whoami, code, "couldn't delete all tokens");
ts = cmd_CreateSyntax("forgetticket", ForgetTicket, NULL, 0,
"delete user's tickets");
-#ifdef notdef
- cmd_AddParm(ts, "-name", CMD_SINGLE, (CMD_OPTIONAL | CMD_HIDE),
- "name of server");
-#endif
cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all tickets");
ts = cmd_CreateSyntax("listtickets", ListTickets, NULL, 0,
}
}
-/*
- * "setkey" routine (for backwards compatibility)
- */
-#if 0 /* static and doesn't appear to be referenced */
-STATIC int
-setkey(key)
- const char *key;
-{
- int i, j, k;
- C_block keyblock;
-
- for (i = 0; i < 8; i++) {
- k = 0;
- for (j = 0; j < 8; j++) {
- k <<= 1;
- k |= (unsigned char)*key++;
- }
- keyblock.b[i] = k;
- }
- return (des_setkey((char *)keyblock.b));
-}
-#endif
-
-#if 0
-/*
- * "encrypt" routine (for backwards compatibility)
- */
-int
-encrypt(block, flag)
- char *block;
- int flag;
-{
- int i, j, k;
- C_block cblock;
-
- for (i = 0; i < 8; i++) {
- k = 0;
- for (j = 0; j < 8; j++) {
- k <<= 1;
- k |= (unsigned char)*block++;
- }
- cblock.b[i] = k;
- }
- if (des_cipher((char *)&cblock, (char *)&cblock, 0L, (flag ? -1 : 1)))
- return (1);
- for (i = 7; i >= 0; i--) {
- k = cblock.b[i];
- for (j = 7; j >= 0; j--) {
- *--block = k & 01;
- k >>= 1;
- }
- }
- return (0);
-}
-#endif
-
#ifdef CRYPT_DEBUG
STATIC
prtab(char *s, unsigned char *t, int num_rows)
dynamic_statistics.string_checks++;
return code;
}
-
-#if 0
-static int
-string_legal(char *str, char *map)
-{
- int slen;
-
- slen = strlen(str);
- if (slen >= MAXKTCNAMELEN)
- return 0; /* with trailing null must fit in data base */
- return (slen == strspn(str, map)); /* strspn returns length(str) if all chars in map */
-}
-#endif
-
#endif /* EXPIREPW */
if (check_ka_skew(request.time, now, KTC_TIME_UNCERTAINTY)) {
-#if 0
- if (oanswer->MaxSeqLen < sizeof(afs_int32))
- code = KAANSWERTOOLONG;
- else { /* return our time if possible */
- oanswer->SeqLen = sizeof(afs_int32);
- request.time = htonl(now);
- memcpy(oanswer->SeqBody, &request.time, sizeof(afs_int32));
- }
-#endif
code = KACLOCKSKEW;
goto abort;
}
return code;
}
-#if 0
-static int
-password_ok(char *newpw, int *insist)
-{
- if (insist == 0) {
- /* see if it is reasonable, but don't get so obnoxious */
- /* FIXME: null pointer derefence!!! */
- (*insist)++; /* so we don't get called again */
- if (strlen(newpw) < 6)
- return 0;
- }
- return 1; /* lie about it */
-}
-#endif
-
static char rn[] = "kpasswd"; /* Routine name */
static int Pipe = 0; /* reading from a pipe */
memset(passwd, 0, sizeof(passwd));
code = ka_GetAdminToken(pw->pw_name, instance, realm, &key, ADMIN_LIFETIME, &token, /*!new */
0);
-#ifdef notdef
- /* the folks in testing really *hate* this message */
- if (code == 0) {
- fprintf(stderr,
- "Warning: only the first 8 characters of your old password were significant.\n");
- }
-#endif
if (code == 0) {
if (dess2k == -1)
dess2k = 0;
return 0;
}
-#if 0
-static void
-Print_afs_RPCStatsState_p(afs_RPCStatsState_p state, const char *prefix)
-{
- printf("%sThe rpc stats state is: ", prefix);
- switch (*state) {
- case AFS_RPC_STATS_DISABLED:
- printf("disabled\n");
- break;
- case AFS_RPC_STATS_ENABLED:
- printf("enabled\n");
- break;
- }
-}
-#endif
-
void
SetupBosAdminCmd(void)
{
return ntohl(addr);
}
-#if 0
-static void
-PrintMessage(vos_messageType_t type, char *message)
-{
- printf("%s\n", message);
-}
-#endif
-
int
DoVosBackupVolumeCreate(struct cmd_syndesc *as, void *arock)
{
#define ONERROR(ec, ep, es) if (ec) { fprintf(STDERR, (es), (ep)); error = (ec); goto rfail; }
#define ERROREXIT(ec) { error = (ec); goto rfail; }
-#if 0 /* doesn't appear to be used, why compile it */
-static int
-CloneVol(afs_cell_handle_p cellHandle, struct rx_connection *conn,
- afs_uint32 rwvid, afs_int32 part, afs_uint32 * rovidp, int nottemp,
- struct nvldbentry *entry, afs_int32 * vidCreateDate, afs_status_p st)
-{
- int rc = 0;
- afs_status_t tst = 0, etst = 0;
- afs_int32 rcode = 0, tid = 0;
- struct volser_status volstatus;
- char vname[64];
-
- /* Begin transaction on RW volume marking it busy (clients will wait) */
- tst = AFSVolTransCreate(conn, rwvid, part, ITBusy, &tid);
- if (tst) {
- goto fail_CloneVol;
- }
-
- /* Get the RO volume id. Allocate a new one if need to */
- *rovidp = entry->volumeId[ROVOL];
- if (*rovidp == INVALID_BID) {
- tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, rovidp);
- if (tst) {
- goto fail_CloneVol;
- }
-
- entry->volumeId[ROVOL] = *rovidp;
- }
-
- /* If we are creating the ro clone, what are we calling it.
- * Depends on whether its a temporary clone or not.
- */
- if (nottemp) {
- strcpy(vname, entry->name);
- strcat(vname, ".readonly");
- } else {
- strcpy(vname, "readonly-clone-temp"); /* Should be unique? */
- }
-
- /* Create the new clone. If it exists, then reclone it */
- tst = AFSVolClone(conn, tid, 0, readonlyVolume, vname, rovidp);
- if (tst == VVOLEXISTS) {
- tst = AFSVolReClone(conn, tid, *rovidp);
- if (tst) {
- goto fail_CloneVol;
- }
- }
- if (tst) {
- goto fail_CloneVol;
- }
-
- /* Bring the volume back on-line as soon as possible */
- if (nottemp) {
- afs_int32 fromtid = 0;
-
- /* Now bring the RO clone on-line */
- tst = AFSVolTransCreate(conn, *rovidp, part, ITOffline, &fromtid);
- if (tst) {
- goto fail_CloneVol;
- }
-
- tst = AFSVolSetFlags(conn, fromtid, 0);
- if (tst) {
- goto fail_CloneVol;
- }
-
- tst = AFSVolEndTrans(conn, fromtid, &rcode);
- fromtid = 0;
- if (!tst)
- tst = rcode;
- if (tst) {
- goto fail_CloneVol;
- }
- }
-
- /* Get the time the RW was created for return information */
- tst = AFSVolGetStatus(conn, tid, &volstatus);
- if (tst) {
- goto fail_CloneVol;
- }
- *vidCreateDate = volstatus.creationDate;
- rc = 1;
-
- fail_CloneVol:
-
- if (tid) {
- tst = AFSVolEndTrans(conn, tid, &rcode);
- tid = 0;
- if (!tst)
- tst = rcode;
- if (tst) {
- rc = 0;
- goto fail_CloneVol;
- }
- }
-
- if (st != NULL) {
- *st = tst;
- }
- return rc;
-}
-#endif
-
/* Get a "transaction" on this replica. Create the volume
* if necessary. Return the time from which a dump should
* be made (0 if it's a new volume)
LOCK_UNLOCK(lock); \
ENDMAC
-#ifdef notdef
-/* this is what UnboostSharedLock looked like before the hi-C compiler */
-/* this must only be called with a WRITE or boosted SHARED lock! */
-#define UnboostSharedLock(lock)\
- ((lock)->excl_locked = SHARED_LOCK,\
- ((lock)->wait_states ?\
- Afs_Lock_ReleaseR(lock) : 0))
-#endif /* notdef */
-
#define ReleaseReadLock(lock)\
BEGINMAC\
LOCK_LOCK(lock); \
ENDMAC
-#ifdef notdef
-/* This is what the previous definition should be, but the hi-C compiler generates
- a warning for each invocation */
-#define ReleaseReadLock(lock)\
- (!--(lock)->readers_reading && (lock)->wait_states ?\
- Afs_Lock_ReleaseW(lock) :\
- 0)
-#endif /* notdef */
-
#define ReleaseWriteLock(lock)\
BEGINMAC\
LOCK_LOCK(lock); \
LOCK_UNLOCK(lock); \
ENDMAC
-#ifdef notdef
-/* This is what the previous definition should be, but the hi-C compiler generates
- a warning for each invocation */
-#define ReleaseWriteLock(lock)\
- ((lock)->excl_locked &= ~WRITE_LOCK,\
- ((lock)->wait_states ?\
- Afs_Lock_ReleaseR(lock) : 0))
-#endif /* notdef */
-
/* can be used on shared or boosted (write) locks */
#define ReleaseSharedLock(lock)\
BEGINMAC\
LOCK_UNLOCK(lock); \
ENDMAC
-#ifdef notdef
-/* This is what the previous definition should be, but the hi-C compiler generates
- a warning for each invocation */
-/* can be used on shared or boosted (write) locks */
-#define ReleaseSharedLock(lock)\
- ((lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK),\
- ((lock)->wait_states ?\
- Afs_Lock_ReleaseR(lock) : 0))
-#endif /* notdef */
-
/* convert a write lock to a read lock */
#define ConvertWriteToReadLock(lock)\
BEGINMAC\
Log("Probed from client at %s\n",
inet_ntoa(ch->ch_addr.sin_addr));
break;
-#ifdef notdef
- case SC_OOB:
- nThreads--;
- ch->ch_fd = 0;
- ch->ch_state = CH_FREE;
- return;
-#endif
case SC_WRITE:
handleWrite(ch, &sc);
break;
KLPrincipal klprinc = nil;
kstatus = KLRenewInitialTickets ( klprinc, inLoginOptions, nil, nil);
#endif
-
-#if 0
- /* handoff to growl agent? */
- kstatus = KLTicketExpirationTime (nil, kerberosVersion_All, &expireStartTime);
- expirationDate = [NSDate dateWithTimeIntervalSince1970:expireStartTime];
- BuildNotificationInfo(@"Ticket Renewed Unitl %@", expirationDate, callbackInfo->dcref, callbackInfo->regref, callbackInfo->icon);
-#endif
}
}
@catch (NSException * e) {
CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_CLICK_CONTEXT, clickContext);
CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_TITLE, CFSTR("OpenAFS")/*title*/);
//CFRelease(title);
-#if 0
- /* if fetching ever provides more data we could use this */
- CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_PROGRESS, progressNumber);
-#endif
if (!strncmp(recvbuf, FETCHSTR, sizeof(FETCHSTR)-1)) {
CFDictionarySetValue(notificationInfo, GROWL_NOTIFICATION_DESCRIPTION, CFStringCreateWithCString(kCFAllocatorDefault, recvbuf+FETCHOFFT, kCFStringEncodingUTF8));
priority = -1;
printf("%s\n", pr_ErrorMsg(code));
if (code == PRSUCCESS) {
PrintEntry(pos, &entry, /*indent */ 0);
-#if 0
- printf("The contents of the entry for %d are:\n", entry.id);
- printf("flags %d next %d\n", entry.flags, entry.next);
- printf("Groups (or members) \n");
- for (i = 0; i < PRSIZE; i++)
- printf("%d\n", entry.entries[i]);
- printf("nextID %d nextname %d name %s\n", entry.nextID,
- entry.nextName, entry.name);
- printf("owner %d creator %d\n", entry.owner, entry.creator);
-#endif
}
} else if (!strcmp(op, "add") || !strcmp(op, "au")) {
/* scanf("%d %d",&id,&gid); */
if (!AccessOK(tt, *cid, 0, PRP_STATUS_MEM, 0))
ABORT_WITH(tt, PRPERM);
- /* Since prdebugentry is in the form of a prentry not a coentry, we will
- * return the coentry slots in network order where the string is. */
-#if 0
- if (aentry->flags & PRCONT) { /* wrong type, get coentry instead */
- code = pr_ReadCoEntry(tt, 0, apos, aentry);
- if (code)
- ABORT_WITH(tt, code);
- }
-#endif
code = ubik_EndTrans(tt);
if (code)
return code;
}
-#ifdef notdef
-static int
-GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, struct namelist *lnames)
-{
- afs_int32 code = 0;
- int n = 0;
- struct cmd_item *i;
- int goodCount;
-
- if (!(as->parms[0].items || as->parms[1].items)) {
- afs_com_err(whoami, 0, "must specify either a name or an id.");
- return -1;
- }
- if (as->parms[0].items && as->parms[1].items) {
- afs_com_err(whoami, 0, "can't specify both a name and id.");
- return -1;
- }
-
- goodCount = 0;
- lids->idlist_len = 0;
- lids->idlist_val = 0;
-
- if (as->parms[0].items) { /* name */
- struct namelist names; /* local copy, if not ret. names */
- struct namelist *nl;
-
- names.namelist_val = 0; /* so it gets freed later if needed */
- if (lnames)
- nl = lnames;
- else
- nl = &names;
-
- n = 0; /* count names */
- for (i = as->parms[0].items; i; i = i->next)
- n++;
- nl->namelist_val = malloc(n * PR_MAXNAMELEN);
- nl->namelist_len = n;
- n = 0;
- for (i = as->parms[0].items; i; i = i->next)
- strncpy(nl->namelist_val[n++], i->data, PR_MAXNAMELEN);
-
- code = pr_NameToId(nl, lids);
- if (code)
- afs_com_err(whoami, code, "so couldn't look up names");
- else {
- for (n = 0; n < lids->idlist_len; n++) {
- if ((lids->idlist_val[n] == ANONYMOUSID)) {
- afs_com_err(whoami, PRNOENT, "so couldn't look up id for %s",
- nl->namelist_val[n]);
- } else
- goodCount++;
- }
- /* treat things as working if any of the lookups worked */
- if (goodCount == 0)
- code = PRNOENT;
- }
-
- if (names.namelist_val)
- free(names.namelist_val);
- } else if (as->parms[1].items) { /* id */
- n = 0;
- for (i = as->parms[1].items; i; i = i->next)
- n++;
- lids->idlist_val = malloc(n * sizeof(afs_int32));
- lids->idlist_len = n;
- n = 0;
- for (i = as->parms[1].items; i; i = i->next) {
- code = util_GetInt32(i->data, &lids->idlist_val[n]);
- if (code)
- afs_com_err(whoami, code =
- PRNOENT, "because a bogus id '%s' was specified",
- i->data);
- n++;
- }
- if (!code && lnames) {
- lnames->namelist_val = 0;
- lnames->namelist_len = 0;
- code = pr_IdToName(lids, lnames);
- if (code)
- afs_com_err(whoami, code, "translating ids");
- }
- }
- if (code) {
- if (lids->idlist_val)
- free(lids->idlist_val);
- return -1;
- }
- return 0;
-}
-#endif
-
-
static int
GetNameOrId(struct cmd_syndesc *as, struct idlist *lids,
struct namelist *lnames)
if ((code == 0) && (callerId == ANONYMOUSID))
code = PRNOENT;
}
-#if 0 /* don't create user */
- if (code == PRNOENT) {
- callerId = 0;
- code = pr_CreateUser(callerName, &callerId);
- if (code) {
- afs_com_err(whoami, code, "can't create caller %s", callerName);
- exit(5);
- }
- printf("Creating caller %s (%di)\n", callerName, callerId);
- }
- /* else */
-#endif
if (code) {
afs_com_err(whoami, code, "can't find caller %s", callerName);
exit(6);
m_freem(am);
return;
}
-#else
-#ifdef notdef
- { /* in_cksum() doesn't work correctly or the length is wrong? */
- int cksum;
- int glockOwner = ISAFS_GLOCK();
- cksum = in_cksum(am, sizeof(struct ip) + tlen);
- if (!glockOwner)
- AFS_GLOCK();
- afs_Trace3(afs_iclSetp, CM_TRACE_WASHERE, ICL_TYPE_STRING,
- __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_INT32,
- cksum);
- if (!glockOwner)
- AFS_GUNLOCK();
- }
-#endif
#endif
}
last = inetdomain.dom_protoswNPROTOSW;
for (tpro = inetdomain.dom_protosw; tpro < last; tpro++)
if (tpro->pr_protocol == IPPROTO_UDP) {
-#if 0 /* not exported */
- /* force UDP checksumming on for AFS */
- extern int udpcksum;
- udpcksum = 1;
-#endif
memcpy(&parent_proto, tpro, sizeof(parent_proto));
tpro->pr_input = rxk_input;
tpro->pr_fasttimo = rxk_fasttimo;
} while(0)
-#if 0
-#define CV_WAIT(cv, lck) \
- do { \
- int code; \
- ksleep_prepare(); \
- MP_SPINLOCK(rx_sleepLock); \
- if (!b_owns_sema(lck)) \
- osi_Panic("mutex not held \n"); \
- b_vsema(lck); \
- code = ksleep_one(PCATCH | KERNEL_ADDRESS | KERN_SPINLOCK_OBJECT, \
- (cv), rx_sleepLock, 0); \
- if (code) { \
- if (code == EINTR) { /* lock still held */ \
- MP_SPINUNLOCK(rx_sleepLock); \
- } else if (code != -EINTR) { \
- osi_Panic("ksleep_one failed: code = %d \n", code); \
- } \
- } \
- b_psema(lck); /* grab the mutex again */ \
- } while(0)
-
-/* Wakes up a thread waiting on this condition */
-#define CV_SIGNAL(cv) \
- do { \
- int wo, code; \
- MP_SPINLOCK(rx_sleepLock); \
- if ((code = kwakeup_one(KERNEL_ADDRESS, (cv), WAKEUP_ONE, &wo)) < 0) \
- osi_Panic("kwakeup_one failed: code = %d \n", code); \
- MP_SPINUNLOCK(rx_sleepLock); \
- } while (0)
-
-/* Wakes up all threads waiting on this condition */
-#define CV_BROADCAST(cv) \
- do { \
- int wo, code; \
- MP_SPINLOCK(rx_sleepLock); \
- if ((code = kwakeup_one(KERNEL_ADDRESS, (cv), WAKEUP_ALL, &wo)) < 0) \
- osi_Panic("kwakeup_all failed: code = %d \n", code); \
- MP_SPINUNLOCK(rx_sleepLock); \
- } while (0)
-#endif /* 0 */
-
#define CV_DESTROY(a)
/* We now use beta semaphores for mutexes */
u.uio_resid = *alength;
UIO_SETUP_SYSSPACE(&u);
u.uio_rw = UIO_READ;
-#if 0
- u.uio_procp = NULL;
-#endif
if (glocked)
AFS_GUNLOCK();
code = soreceive(asocket, (addr ? &nam : NULL), &u, NULL, NULL, NULL);
u.uio_resid = alength;
UIO_SETUP_SYSSPACE(&u);
u.uio_rw = UIO_WRITE;
-#if 0
- u.uio_procp = NULL;
-#endif
nam = m_get(M_DONTWAIT, MT_SONAME);
if (!nam)
return ENOBUFS;
* the MAX packet size will be the maximum receive size, but the maximum send
* size will be larger than that. */
-#ifdef notdef
/* some sample MTUs
4352 what FDDI(RFC1188) uses... Larger?
4096 VJ's recommendation for FDDI
9180 Classical IP over ATM (RFC2225)
*/
-/* * * * these are the old defines
-*/
-#define RX_MAX_PACKET_SIZE (RX_MAX_DL_MTU -RX_IPUDP_SIZE)
-
-#define RX_MAX_PACKET_DATA_SIZE (RX_MAX_PACKET_SIZE-RX_HEADER_SIZE)
-#ifdef AFS_HPUX_ENV
-/* HPUX by default uses an 802.3 size, and it's not evident from SIOCGIFCONF */
-#define RX_LOCAL_PACKET_SIZE (1492 - RX_IPUDP_SIZE)
-#define RX_REMOTE_PACKET_SIZE (1492 - RX_IPUDP_SIZE)
-#else
-#define RX_LOCAL_PACKET_SIZE RX_MAX_PACKET_SIZE /* For hosts on same net */
-#define RX_REMOTE_PACKET_SIZE RX_MAX_PACKET_SIZE /* see note above */
-#endif
-#endif /* notdef */
-
-/* These are the new, streamlined ones.
- */
#define RX_HEADER_SIZE sizeof (struct rx_header)
/* The minimum MTU for an IP network is 576 bytes including headers */
f_print(fout, "bool_t\n");
f_print(fout, "xdr_%s(XDR *xdrs, ", def->def_name);
f_print(fout, "%s ", def->def_name);
-#if 0
- if (def->def_kind != DEF_TYPEDEF
- || !isvectordef(def->def.ty.old_type, def->def.ty.rel)) {
- f_print(fout, "*");
- }
-#else
f_print(fout, "*");
-#endif
f_print(fout, "objp)\n");
f_print(fout, "{\n");
}
f_print(fout, "{\tafs_int32 rcode, code, newHost, thisHost, i, _ucount;\n");
f_print(fout, "\tint chaseCount, pass, needsync;\n");
-#if 0 /* goes with block below */
- f_print(fout, "\tint j, inlist;\n");
-#endif
f_print(fout, "\tstruct rx_connection *tc;\n");
f_print(fout, "\tstruct rx_peer *rxp;\n");
f_print(fout, "\tshort origLevel;\n\n");
f_print(fout, "\torigLevel = aclient->initializationState;\n");
f_print(fout, "\trcode = UNOSERVERS;\n");
f_print(fout, "\tchaseCount = needsync = 0;\n\n");
-#if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */
- f_print(fout, "\tinlist = 0;\n");
- f_print(fout, "\tLOCK_UCLNT_CACHE;\n");
- f_print(fout, "\tfor (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {\n");
- f_print(fout, "\t\tif (calls_needsync[j] == (int *)%s%s%s) {\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
- f_print(fout, "\t\t\tinlist = needsync = 1;\n");
- f_print(fout, "\t\t\tbreak;\n");
- f_print(fout, "\t\t}\n");
- f_print(fout, "\t}\n");
- f_print(fout, "\tUNLOCK_UCLNT_CACHE;\n");
-#endif
f_print(fout, "\t/* \n\t* First pass, we try all servers that are up.\n\t* Second pass, we try all servers.\n\t*/\n");
f_print(fout, "\tfor (pass = 0; pass < 2; pass++) { /*p */\n");
f_print(fout, "\t\t/* For each entry in our servers list */\n");
f_print(fout, "\tdone:\n");
f_print(fout, "\tif (needsync) {\n");
-#if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */
- f_print(fout, "\t\tif (!inlist) { /* Remember proc call that needs sync site */\n");
- f_print(fout, "\t\t\tLOCK_UCLNT_CACHE;\n");
- f_print(fout, "\t\t\tcalls_needsync[synccount % SYNCCOUNT] = (int *)%s%s%s;\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
- f_print(fout, "\t\t\tsynccount++;\n");
- f_print(fout, "\t\t\tUNLOCK_UCLNT_CACHE;\n");
- f_print(fout, "\t\t\tinlist = 1;\n");
- f_print(fout, "\t\t}\n");
-#endif
f_print(fout, "\t\tif (!rcode) { /* Remember the sync site - cmd successful */\n");
f_print(fout, "\t\t\trxp = rx_PeerOf(aclient->conns[_ucount]);\n");
f_print(fout, "\t\t\taclient->syncSite = rx_HostOf(rxp);\n");
#define EFF_NTOHL(x) ntohl(x)
-#if 0
-#if defined(__GNUC__) && (defined(i386) || defined(__i386__))
-static inline afs_uint32
-bswap(afs_uint32 x)
-{
- asm("bswap %0": "=r"(x):"0"(x));
- return x;
-}
-#endif
-#endif
-
/*
* Sboxes for Feistel network derived from
* /afs/transarc.com/public/afsps/afs.rel31b.export-src/rxkad/sboxes.h
xor0 = in[0] ^ b8[0];
xor1 = in[1] ^ b8[1];
-#if 0
- if (length >= 8)
- memcpy(out, b8, 8);
- else
- memcpy(out, b8, length); /* Don't write to much when length < 8 */
-#else
/* If length < 8 we write to much, this is not always ok */
memcpy(out, b8, 8);
-#endif
out += 2;
in += 2;
}
#define Byte3 3
#endif
-#if 0
- memcpy(&L, clear, sizeof(afs_int32));
- memcpy(&R, clear + 1, sizeof(afs_int32));
-#else
L = ntohl(*((afs_uint32 *)clear));
R = ntohl(*((afs_uint32 *)clear + 1));
-#endif
if (encrypt) {
INC_RXKAD_STATS(fc_encrypts[ENCRYPT]);
L ^= P;
}
}
-#if 0
- memcpy(cipher, &L, sizeof(afs_int32));
- memcpy(cipher + 1, &R, sizeof(afs_int32));
-#else
*((afs_int32 *)cipher) = htonl(L);
*((afs_int32 *)cipher + 1) = htonl(R);
-#endif
return 0;
}
return (DES_cblock *)key;
}
-#if 0
-static_inline unsigned char *
-cblockptr_to_cblock(DES_cblock *key) {
- return (unsigned char *)key;
-}
-#endif
-
static_inline DES_cblock *
charptr_to_cblock(char *key) {
return (DES_cblock *)key;
int b;
kbps = (double)(parms->copiousCalls * n) / (interval * 1000.0);
b = kbps + 0.5;
-#if 0
- I just cannot get printing of floats to work on the pmax !
- !!!printf("%g %d %d %d\n", (float)kbps, b);
- printf("%g %d %d %d\n", kbps, b);
- fprintf(stdout, "%g %d %d\n", kbps, b);
- {
- char buf[100];
- buf[sizeof(buf) - 1] = 0;
- sprintf(buf, "%g %d %d\n", kbps, b);
- assert(buf[sizeof(buf) - 1] == 0);
- printf("%s", buf);
- }
-#endif
printf
("For %lu copious calls, %lu send + %lu recv = %lu bytes each: %d kbytes/sec\n",
parms->copiousCalls, parms->sendLen, parms->recvLen, n, b);
-#if 0
- printf("%g\n", kbps);
-#endif
}
}
return 0;
if (parms->printStats) {
rx_PrintStats(stdout);
-#if 0
- /* use rxdebug style iteration here */
- rx_PrintPeerStats(stdout, rx_PeerOf(conn));
-#endif
}
rxs_Release(sc);
code = RXKST_BADINPUTSUM;
goto done;
}
-#define BIG_PRIME 1257056893 /* 0x4AED2A7d */
-#if 0
-#define NextByte() ((b>24 ? ((seed = seed*BIG_PRIME + BIG_PRIME),b=0) : 0), \
- (b +=8), ((seed >> (b-8))&0xff))
-#else
#define NextByte() (b+=3)
-#endif
b = 32;
mysum = 0;
*start = decr_part.authtime;
if (decr_part.starttime)
*start = *decr_part.starttime;
-#if 0
- if (*start - now > CLOCK_SKEW || decr_part.flags.invalid)
- goto no_auth;
-#else
if (decr_part.flags.invalid)
goto no_auth;
-#endif
if (now > decr_part.endtime)
goto tkt_expired;
*end = decr_part.endtime;
*/
#define P_SERVER 0
#define P_BASE 1
-#if 0
-#define P_PACKAGE 2
-#endif /* 0 */
#define P_FREQ 2
#define P_HOST 3
#define P_ATTENTION 4
/*
* Initialize the gtx package.
*/
-#if 0
- fprintf(stderr, "[%s:%s] Starting up gtx package\n", pn, rn);
-#endif /* 0 */
scout_gwin = gtx_Init(0, /*Don't start up InputServer yet */
-1); /*Type of window package */
if (scout_gwin == NULL) {
} /*Add lights in server records to display list */
-#if 0
- /*
- * Set up the minimal keymap.
- */
- code = keymap_BindToString(scout_frame->keymap, /*Ptr to keymap */
- "e", /*Key to bind */
- ExitCmd, /*Cmd to execute */
- NULL, /*Name */
- NULL); /*Ptr to rock */
- if (code) {
- fprintf(stderr, "[%s] Can't bind key `e', code is %d\n", rn, code);
- return (code);
- }
-#endif /* 0 */
-
/*
* Finish setting up the overall mini_screen structure.
*/
scout_probefreq, /*Probe frequency */
FS_Handler, /*Handler routine */
0); /*Turn debugging output off */
-#if 0
- scout_debug); /*Turn debugging output off */
-#endif /* 0 */
if (code) {
fprintf(stderr, "[%s] Error returned by fsprobe_Init: %d\n", rn,
code);
fprintf(scout_debugfd, "[%s] Writing to Scout debugging file '%s'\n",
rn, debug_filename);
}
-#if 0
- wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data);
-#endif /* 0 */
wpkg_to_use = 2; /*Always use curses for now */
-#if 0
- fprintf(stderr, "[%s:%s] Using graphics package %d: ", pn, rn,
- wpkg_to_use);
- switch (wpkg_to_use) {
- case GATOR_WIN_CURSES:
- fprintf(stderr, "curses\n");
- break;
- case GATOR_WIN_DUMB:
- fprintf(stderr, "dumb terminal\n");
- break;
- case GATOR_WIN_X11:
- fprintf(stderr, "X11\n");
- break;
- default:
- fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use);
- scout_CleanExit(-1);
- } /*end switch (wpkg_to_use) */
-#endif /* 0 */
-
if (as->parms[P_FREQ].items != 0)
scout_probefreq = atoi(as->parms[P_FREQ].items->data);
else
"FileServer name(s) to monitor");
cmd_AddParm(ts, "-basename", CMD_SINGLE, CMD_OPTIONAL,
"base server name");
-#if 0
- cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
- "Graphics package to use");
-#endif /* 0 */
cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
"poll frequency, in seconds");
cmd_AddParm(ts, "-host", CMD_FLAG, CMD_OPTIONAL,
*/
code = cmd_Dispatch(argc, argv);
if (code) {
-#if 0
- fprintf(stderr, "[%s:%s] Call to cmd_Dispatch() failed; code is %d\n",
- pn, rn, code);
-#endif /* 0 */
scout_CleanExit(1);
} else
scout_CleanExit(0);
#pragma weak xiinc = iinc
#pragma weak xidec = idec
#pragma weak xiopen = iopen
-#ifdef notdef
-#pragma weak xiread = iread
-#pragma weak xiwrite = iwrite
-#endif
int
icreate(int dev, int near_inode, int param1, int param2, int param3,
}
#endif
-#ifdef notdef
-/* iread and iwrite are deprecated interfaces. Use inode_read and inode_write instead. */
-int
-iread(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf,
- unsigned int count)
-{
- return (syscall(AFS_IREAD, dev, inode, inode_p1, offset, cbuf, count));
-}
-
-int
-iwrite(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf,
- unsigned int count)
-{
- return (syscall(AFS_IWRITE, dev, inode, inode_p1, offset, cbuf, count));
-}
-#endif /* notdef */
-
#else /* AFS_SGI_ENV */
#ifndef AFS_NAMEI_ENV
}
-#ifdef notdef
-int
-iread(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf,
- unsigned int count)
-{
- int errcode;
- struct iparam iparams;
-
- iparams.param1 = inode_p1;
- iparams.param2 = offset;
- iparams.param3 = (long)cbuf;
- iparams.param4 = count;
- errcode = syscall(AFS_SYSCALL, AFSCALL_IREAD, dev, inode, &iparams);
- return (errcode);
-}
-
-
-iwrite(int dev, int inode, int inode_p1, unsigned int offset, char *cbuf,
- unsigned int count)
-{
- int errcode;
- struct iparam iparams;
-
- iparams.param1 = inode_p1;
- iparams.param2 = offset;
- iparams.param3 = (long)cbuf;
- iparams.param4 = count;
-
- errcode = syscall(AFS_SYSCALL, AFSCALL_IWRITE, dev, inode, &iparams);
- return (errcode);
-}
-#endif
-
#endif /* AFS_NAMEI_ENV */
#endif /* !AFS_SGI_ENV */
struct rx_securityClass *
get_sc(char *cellname)
{
-#if 0
- char realm[REALM_SZ];
- CREDENTIALS c;
-#endif
-
return rxnull_NewClientSecurityObject();
-#if 0
-
- ucstring(realm, cellname, REALM_SZ);
-
- if (krb_get_cred("afs", "", realm, &c)) {
- if (get_ad_tkt("afs", "", realm, DEFAULT_TKT_LIFE)) {
- return NULL;
- } else {
- if (krb_get_cred("afs", "", realm, &c)) {
- return NULL;
- }
- }
- }
-
- return rxkad_NewClientSecurityObject(rxkad_clear, c.session, c.kvno,
- c.ticket_st.length, c.ticket_st.dat);
-#endif
}
static volatile int loop_stop = 1;
setegid(gid);
seteuid(uid);
}
-#if 0
- if (k_hasafs()) {
- int ret = k_setpag();
- if (ret < 0)
- warn("k_setpag");
- }
-#endif
execvp(prog, &argv[2]);
"--strings=foo", "--strings=bar", NULL}},
{AARG_GNUSTYLE, 5, {"strings", "-s", "foo", "-s", "bar", NULL}},
{AARG_AFSSTYLE, 4, {"strings", "-string", "foo", "bar", NULL}}
-#if 0
- {AARG_AFSSTYLE, 3, {"strings", "foo", "bar", NULL}}
-#endif
};
struct agetargs args[] = {
{AARG_GNUSTYLE, 2, {"flag", "-g", NULL}, GA_SUCCESS},
{AARG_AFSSTYLE, 2, {"flag", "--flag"}, GA_FAILURE},
{AARG_AFSSTYLE, 2, {"flag", "-flag", NULL}, GA_SUCCESS},
-#if 0
- /* XXX */
- {AARG_AFSSTYLE, 2, {"flag", "yes", NULL}, GA_SUCCESS},
-#endif
{AARG_GNUSTYLE, 2, {"flag", "--no-flag", NULL}, GA_SUCCESS}
};
closedir(d);
if (stat(".", &sb) < 0)
err(1, "stat .");
-#if 0
- if (sb.st_size != 2048)
- errx(1, "size != 2048");
-#endif
return 0;
}
err(1, "chdir %s", dirname);
if (stat(".", &sb) < 0)
err(1, "stat .");
-#if 0
- if (sb.st_size != 2048)
- errx(1, "size != 2048");
-#endif
for (i = 0; i < count; ++i) {
char fname[256];
int len;
memcpy(fbuf, buf, sz);
-#if 0
- if (msync(fbuf, sz, MS_SYNC))
- err(1, "msync");
-#endif
-
if (munmap(fbuf, sz) != 0)
err(1, "munmap");
err(1, "write");
while (!term_sig)
pause();
-#if 0
- if (getcwd(buf, sizeof(buf)) == NULL)
- err(1, "getcwd");
-#endif
fp = fdopen(4, "w");
if (fp != NULL)
fprintf(fp, "child: cwd = %s\n", buf);
return tval ? hval < 0 ? buckets - tval : tval : 0;
}
-#if 0
-static void fixup(char *name, int l)
-{
- name += 16;
- l -= 15;
-
- while (l-- > 0) {
- name[0] = name[4];
- name++;
- }
-}
-#endif
-
afs_uint32 parse_directory(XFILE *X, dump_parser *p, afs_vnode *v,
afs_uint32 size, int toeof)
{
fprintf(stderr, "failed readbystring for 'A'\n");
return -1;
}
-#if 0
- acl_NtohACL(VVnodeDiskACL(vnode));
-#endif
break;
#ifdef RESIDENCY
case 'h':
/* intNN.h - Sized integer types */
#include <afs/stds.h>
-#if 0
-typedef short afs_int16;
-typedef unsigned short afs_uint16;
-
-typedef long afs_int32;
-typedef unsigned long afs_uint32;
-#endif
/* Support for 64-bit integers.
}
}
-#if 0
-static char *
-program_type_to_string(afs_int32 type)
-{
- switch ((ProgramType)type) {
- case fileServer:
- return "fileServer";
- case volumeUtility:
- return "volumeUtility";
- case salvager:
- return "salvager";
- case salvageServer:
- return "salvageServer";
- default:
- return "**UNKNOWN**";
- }
-}
-#endif
-
static char *
state_code_to_string(afs_int32 state)
{
str);
return AUTH_FAILURE; /* NOTFOUND? */
}
-
-#if 0
- /*
- * Local hack - if the person has a file in their home
- * directory called ".xlog", read that for a list of
- * extra cells to authenticate to
- */
-
- if ((pwd = getpwuid(getuid())) != NULL) {
- struct stat sbuf;
- FILE *f;
- char fcell[100], xlog_path[512];
-
- strcpy(xlog_path, pwd->pw_dir);
- strcat(xlog_path, "/.xlog");
-
- if ((stat(xlog_path, &sbuf) == 0) &&
- ((f = fopen(xlog_path, "r")) != NULL)) {
-
- while (fgets(fcell, 100, f) != NULL) {
- int auth_status;
-
- fcell[strlen(fcell) - 1] = '\0';
-
- auth_status = auth_to_cell(context, userName, fcell, NULL);
- if (status == AKLOG_SUCCESS)
- status = auth_status;
- else
- status = AKLOG_SOMETHINGSWRONG;
- }
- }
- }
-#endif
return AUTH_SUCCESS;
}
}
sc[0] = rxnull_NewServerSecurityObject();
-#if 0
- sc[1] = rxvab_NewServerSecurityObject("applexx", 0);
-#endif
tservice = rx_NewService(0, USER_SERVICE_ID, "Sample", sc, 1 /*2 */ ,
SAMPLE_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
*/
*a_overflowP = 1;
a_to--;
-#if 0
- printf("*** Skipping overflow char '%c'\n", *(a_from - 1));
-#endif /* 0 */
while (*a_from != a_separator && *a_from != '\0'
&& *a_from != '\n') {
-#if 0
- printf("*** Skipping overflow char '%c'\n", *a_from);
-#endif /* 0 */
a_from++;
} /*Skip over excess chars */
break;
} /*uss_vol_GetServer */
-/* XXX - This function is unused, and could be deleted */
-#if 0
-/*------------------------------------------------------------------------
- * static GetVolumeType
- *
- * Description:
- * Translate the given char string representing a volume type to the
- * numeric representation.
- *
- * Arguments:
- * a_type : Char string volume type.
- *
- * Returns:
- * One of ROVOL, RWVOL, BACKVOL, or -1 on failure.
- *
- * Environment:
- * Nothing interesting.
- *
- * Side Effects:
- * As advertised.
- *------------------------------------------------------------------------*/
-
-static afs_int32
-GetVolumeType(char *a_type)
-{ /*GetVolumeType */
-
- if (!strcmp(a_type, "ro"))
- return (ROVOL);
- else if (!strcmp(a_type, "rw"))
- return (RWVOL);
- else if (!strcmp(a_type, "bk"))
- return (BACKVOL);
- else
- return (-1);
-
-} /*GetVolumeType */
-#endif
-
/*------------------------------------------------------------------------
* EXPORTED uss_Vol_GetPartitionID
*
* Other error code if problem occurred in lower-level call.
*/
-#if 0
-extern afs_int32 uss_vol_DeleteMountPoint();
- /*
- * Summary:
- * Given a mountpoint, nuke it.
- *
- * Args:
- * char *a_mountpoint : Name of the mountpoint.
- *
- * Returns:
- * 0 if everything went well,
- * 1 if there was a problem in the routine itself, or
- * Other error code if problem occurred in lower-level call.
- */
-#endif
#endif /* _USS_VOL_H_ */
*/
if (lh->ndata > LOAD_FACTOR * lh->ltable) {
afs_lhash_expand(lh);
-#if 0
- printf("lh->p = %d; lh->maxp = %d\n", lh->p, lh->maxp);
-#endif
}
#ifdef CHECK_INVARIANTS
assert(lh->ndata <= LOAD_FACTOR * lh->ltable);
temp = tresult + tbit; /* see if adding this bit keeps us < akdate */
tsp = localtime(&temp);
tsp->tm_mon++;
-#ifdef notdef
- if (tsp->tm_mon == 0) {
- tsp->tm_mon = 12;
- tsp->tm_year--;
- }
-#endif
if (KDateCmp(akdate, tsp) >= 0) {
/* if temp still represents earlier than date than we're searching
* for, add in bit as increment, otherwise use old value and look
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
cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_OPTIONAL,
"disk space quota in 1K units");
-#ifdef notdef
- cmd_AddParm(ts, "-min", CMD_SINGLE, CMD_OPTIONAL,
- "disk space guaranteed");
- cmd_AddParm(ts, "-motd", CMD_SINGLE, CMD_OPTIONAL, "message of the day");
-#endif
cmd_AddParm(ts, "-offlinemsg", CMD_SINGLE, CMD_OPTIONAL,
"offline message");
cmd_CreateAlias(ts, "sv");
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");
/* print the record */
DisplayRecord(outFilep, &bufferp[ix], rlength);
ix += rlength;
-#ifdef notdef
- /* obsolete: read entire buffer first */
- i += rlength; /* update cookie value, too */
-#endif
} /* for loop displaying buffer */
} /* for loop over all logs */
struct timezone {
int a, b;
};
-#if 0 /*ndef AFS_ALPHA_LINUX20_ENV */
-typedef struct timeval {
- int tv_sec;
- int tv_usec;
-} timeval_t; /* Needed here since KERNEL defined. */
-#endif /*AFS_ALPHA_LINUX20_ENV */
#if defined(WORDS_BIGENDIAN)
#define _LINUX_BYTEORDER_BIG_ENDIAN_H
#else
}
#endif
-#if 0
-#define OffsetOf(s,mem) ((long)(&(((s *)0)->mem)))
-#define SizeOf(s,mem) ((long)sizeof(((s *)0)->mem))
-#define values(s,mem) OffsetOf(s,mem), SizeOf(s,mem)
-
-print_struct_vcache_offsets()
-{
- printf("struct vcache.v offset = %ld, size = %ld\n",
- values(struct vcache, v));
- printf("struct vcache.vlruq offset = %ld, size = %ld\n",
- values(struct vcache, vlruq));
- printf("struct vcache.nextfree offset = %ld, size = %ld\n",
- values(struct vcache, nextfree));
- printf("struct vcache.hnext offset = %ld, size = %ld\n",
- values(struct vcache, hnext));
- printf("struct vcache.fid offset = %ld, size = %ld\n",
- values(struct vcache, fid));
- printf("struct vcache.m offset = %ld, size = %ld\n",
- values(struct vcache, m));
- printf("struct vcache.lock offset = %ld, size = %ld\n",
- values(struct vcache, lock));
- printf("struct vcache.parentVnode offset = %ld, size = %ld\n",
- values(struct vcache, parentVnode));
- printf("struct vcache.parentUnique offset = %ld, size = %ld\n",
- values(struct vcache, parentUnique));
- printf("struct vcache.mvid offset = %ld, size = %ld\n",
- values(struct vcache, mvid));
- printf("struct vcache.linkData offset = %ld, size = %ld\n",
- values(struct vcache, linkData));
- printf("struct vcache.flushDV offset = %ld, size = %ld\n",
- values(struct vcache, flushDV));
- printf("struct vcache.mapDV offset = %ld, size = %ld\n",
- values(struct vcache, mapDV));
- printf("struct vcache.truncPos offset = %ld, size = %ld\n",
- values(struct vcache, truncPos));
- printf("struct vcache.callback offset = %ld, size = %ld\n",
- values(struct vcache, callback));
- printf("struct vcache.cbExpires offset = %ld, size = %ld\n",
- values(struct vcache, cbExpires));
- printf("struct vcache.callsort offset = %ld, size = %ld\n",
- values(struct vcache, callsort));
- printf("struct vcache.Access offset = %ld, size = %ld\n",
- values(struct vcache, Access));
- printf("struct vcache.anyAccess offset = %ld, size = %ld\n",
- values(struct vcache, anyAccess));
- printf("struct vcache.last_looker offset = %ld, size = %ld\n",
- values(struct vcache, last_looker));
- printf("struct vcache.activeV offset = %ld, size = %ld\n",
- values(struct vcache, activeV));
- printf("struct vcache.slocks offset = %ld, size = %ld\n",
- values(struct vcache, slocks));
- printf("struct vcache.opens offset = %ld, size = %ld\n",
- values(struct vcache, opens));
- printf("struct vcache.execsOrWriters offset = %ld, size = %ld\n",
- values(struct vcache, execsOrWriters));
- printf("struct vcache.flockCount offset = %ld, size = %ld\n",
- values(struct vcache, flockCount));
- printf("struct vcache.mvstat offset = %ld, size = %ld\n",
- values(struct vcache, mvstat));
- printf("struct vcache.states offset = %ld, size = %ld\n",
- values(struct vcache, states));
- printf("struct vcache.quick offset = %ld, size = %ld\n",
- values(struct vcache, quick));
- printf("struct vcache.symhintstamp offset = %ld, size = %ld\n",
- values(struct vcache, symhintstamp));
- printf("struct vcache.h1 offset = %ld, size = %ld\n",
- values(struct vcache, h1));
- printf("struct vcache.lastr offset = %ld, size = %ld\n",
- values(struct vcache, lastr));
- printf("struct vcache.vc_rwlockid offset = %ld, size = %ld\n",
- values(struct vcache, vc_rwlockid));
- printf("struct vcache.vc_locktrips offset = %ld, size = %ld\n",
- values(struct vcache, vc_locktrips));
- printf("struct vcache.vc_rwlock offset = %ld, size = %ld\n",
- values(struct vcache, vc_rwlock));
- printf("struct vcache.mapcnt offset = %ld, size = %ld\n",
- values(struct vcache, mapcnt));
- printf("struct vcache.cred offset = %ld, size = %ld\n",
- values(struct vcache, cred));
- printf("struct vcache.vc_bhv_desc offset = %ld, size = %ld\n",
- values(struct vcache, vc_bhv_desc));
- printf("struct vcache.vc_error offset = %ld, size = %ld\n",
- values(struct vcache, vc_error));
- printf("struct vcache.xlatordv offset = %ld, size = %ld\n",
- values(struct vcache, xlatordv));
- printf("struct vcache.uncred offset = %ld, size = %ld\n",
- values(struct vcache, uncred));
- printf("struct vcache.asynchrony offset = %ld, size = %ld\n",
- values(struct vcache, asynchrony));
-}
-
-print_struct_vnode_offsets()
-{
- printf("struct vnode.v_list offset = %ld, size = %ld\n",
- values(struct vnode, v_list));
- printf("struct vnode.v_flag offset = %ld, size = %ld\n",
- values(struct vnode, v_flag));
- printf("struct vnode.v_count offset = %ld, size = %ld\n",
- values(struct vnode, v_count));
- printf("struct vnode.v_listid offset = %ld, size = %ld\n",
- values(struct vnode, v_listid));
- printf("struct vnode.v_intpcount offset = %ld, size = %ld\n",
- values(struct vnode, v_intpcount));
- printf("struct vnode.v_type offset = %ld, size = %ld\n",
- values(struct vnode, v_type));
- printf("struct vnode.v_rdev offset = %ld, size = %ld\n",
- values(struct vnode, v_rdev));
- printf("struct vnode.v_vfsmountedhere offset = %ld, size = %ld\n",
- values(struct vnode, v_vfsmountedhere));
- printf("struct vnode.v_vfsp offset = %ld, size = %ld\n",
- values(struct vnode, v_vfsp));
- printf("struct vnode.v_stream offset = %ld, size = %ld\n",
- values(struct vnode, v_stream));
- printf("struct vnode.v_filocks offset = %ld, size = %ld\n",
- values(struct vnode, v_filocks));
- printf("struct vnode.v_filocksem offset = %ld, size = %ld\n",
- values(struct vnode, v_filocksem));
- printf("struct vnode.v_number offset = %ld, size = %ld\n",
- values(struct vnode, v_number));
- printf("struct vnode.v_bh offset = %ld, size = %ld\n",
- values(struct vnode, v_bh));
- printf("struct vnode.v_namecap offset = %ld, size = %ld\n",
- values(struct vnode, v_namecap));
- printf("struct vnode.v_hashp offset = %ld, size = %ld\n",
- values(struct vnode, v_hashp));
- printf("struct vnode.v_hashn offset = %ld, size = %ld\n",
- values(struct vnode, v_hashn));
- printf("struct vnode.v_mreg offset = %ld, size = %ld\n",
- values(struct vnode, v_mreg));
- printf("struct vnode.v_mregb offset = %ld, size = %ld\n",
- values(struct vnode, v_mregb));
- printf("struct vnode.v_pgcnt offset = %ld, size = %ld\n",
- values(struct vnode, v_pgcnt));
- printf("struct vnode.v_dpages offset = %ld, size = %ld\n",
- values(struct vnode, v_dpages));
- printf("struct vnode.v_dpages_gen offset = %ld, size = %ld\n",
- values(struct vnode, v_dpages_gen));
- printf("struct vnode.v_dbuf offset = %ld, size = %ld\n",
- values(struct vnode, v_dbuf));
- printf("struct vnode.v_buf offset = %ld, size = %ld\n",
- values(struct vnode, v_buf));
- printf("struct vnode.v_bufgen offset = %ld, size = %ld\n",
- values(struct vnode, v_bufgen));
- printf("struct vnode.v_traceix offset = %ld, size = %ld\n",
- values(struct vnode, v_traceix));
- printf("struct vnode.v_buf_lock offset = %ld, size = %ld\n",
- values(struct vnode, v_buf_lock));
- printf("struct vnode.v_pc offset = %ld, size = %ld\n",
- values(struct vnode, v_pc));
-#ifdef VNODE_TRACING
- printf("struct vnode.v_trace offset = %ld, size = %ld\n",
- values(struct vnode, v_trace));
-#endif
-#ifdef CKPT
- printf("struct vnode.v_ckpt offset = %ld, size = %ld\n",
- values(struct vnode, v_ckpt));
-#endif
-}
-#endif
printf("fchmod failed to set mode properly\n");
return -1;
}
-#if 0
- /* These appear to be defunct routines;
- * I don't know what, if anything, replaced them */
- if (osi_ExclusiveLockNoBlock(fd1) < 0)
- {perror("flock1");return -1;}
- if (osi_UnLock(fd1) < 0)
- {perror("flock/unlock");return -1;}
-#endif
/* How about shared lock portability? */
{
idesc[i].id_type = ADDR;
memset(&cstotal, 0, sizeof(struct csum));
(void)time(&now);
-#ifdef notdef
- /* this is the original from UCB/McKusick, but it is clearly wrong. It is
- * rounding the # of fragments to the next 1024 (in our case, with a 1K/8K file system),
- * while instead it should be rounding to the next block.
- *
- * In addition, we should be sure that we allocate enough space, but that seems to be
- * ensured by the fact that the bitmap is rounded up to the nearest short, and that there
- * are never more than 16 frags per block.
- */
- for (i = fs->fs_size; i < fragroundup(fs, fs->fs_size); i++)
-#else
c = 1 << fs->fs_fragshift; /* unit to which we want to round */
for (i = fs->fs_size; i < roundup(fs->fs_size, c); i++)
-#endif
setbmap(i);
for (c = 0; c < fs->fs_ncg; c++) {
getblk(&cgblk, cgtod(fs, c), fs->fs_cgsize);
afs_int32
SRXAFS_GetRootVolume(struct rx_call * acall, char **VolumeName)
{
-#ifdef notdef
- int fd;
- int len;
- char *temp;
- struct rx_connection *tcon;
- struct host *thost;
- Error errorCode = 0;
-#endif
struct fsstats fsstats;
fsstats_StartOp(&fsstats, FS_STATS_RPCIDX_GETROOTVOLUME);
else
printf("return code is %d\n", code);
-#ifdef notdef
- while (1) {
- char line[500];
- int nargs;
-
- printf("fs> ");
- if (fgets(line, 499, stdin) != NULL) {
- char *oper;
- char **argp = args;
- GetArgs(line, argp, &nargs);
- oper = &argp[0][0];
- ++argp, --nargs;
- if (!strcmp(oper, "probe")) {
- code =
- ubik_Call(RXAFS_GetTime, cstruct, 0, &tv.tv_sec,
- &tv.tv_usec);
- printf("return code is %d\n", code);
- if (!code)
- printf("sec=%d\n", tv.tv_sec);
- } else if (!strcmp(oper, "fsstats")) {
- struct afsStatistics stats;
-
- code = ubik_AFS_GetStatistics(cstruct, 0, &stats);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "fd")) {
- code = FetchData(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "fs")) {
- code = FetchStatus(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "fa")) {
- code = FetchACL(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "sd")) {
- code = StoreData(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "ss")) {
- code = StoreStatus(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "sa")) {
- code = StoreACL(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "cf")) {
- code = CreateFile(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "rf")) {
- code = RemoveFile(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "rn")) {
- code = Rename(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "sl")) {
- code = Symlink(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "hl")) {
- code = HardLink(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "md")) {
- code = MakeDir(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "rd")) {
- code = RemoveDir(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "rdd")) {
- code = Readdir(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "mm")) {
- code = MakeMountPoint(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "rt")) {
- code = ReleaseTokens(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "bs")) {
- code = BulkStatus(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "lk")) {
- code = Lookup(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "gt")) {
- code = GetToken(argp);
- printf("return code is %d\n", code);
- } else if (!strcmp(oper, "ka")) {
- code = KeepAlive(argp);
- printf("return code is %d\n", code);
- } else if ((!strcmp(oper, "q")) || !strcmp(oper, "quit"))
- exit(0);
- else {
- printf("Unknown oper! Available operations: \n\n");
- printf("fd <vnode> <unique> <pos> <len>\n");
- printf("fs <vnode> <unique>\n");
- printf("fa <vnode> <unique>\n");
- printf
- ("sd <vnode> <unique> <pos> <len> <flen> [<mode>|-1] [<owner>|-1] [<length>|-1] <string>\n");
- printf
- ("ss <vnode> <unique> [<mode>|-1] [<owner>|-1] [<length>|-1]\n");
- printf("sa <vnode> <unique> <string>\n");
- printf("rf <vnode> <unique> <name>\n");
- printf
- ("cf <vnode> <unique> <name> [<mode>|-1] [<owner>|-1] [<length>|-1]\n");
- printf
- ("rn <ovnode> <ounique> <oname> <nvnode> <nunique> <nname>\n");
- printf
- ("sl <vnode> <unique> <name> <contents> [<mode>|-1] [<owner>|-1] [<length>|-1]\n");
- printf("hl <dvnode> <dunique> <name> <evnode> <eunique>\n");
- printf
- ("md <vnode> <unique> <name> [<mode>|-1] [<owner>|-1] [<length>|-1]\n");
- printf("rd <vnode> <unique> <name>\n");
- printf("rdd <vnode> <unique> <pos> <len>\n");
- printf("lk <vnode> <unique> <name>\n");
- printf("gt <vnode> <unique> <tokenID>\n");
- printf("ka <vol.l> <vnode> <unique> <isExec> <kaTime>\n");
- }
- }
- }
-#endif
return 0;
}
line++;
}
}
-
-#ifdef notdef
-afs_int32
-FetchData(char **argp)
-{
- struct afsFetchStatus OutStatus;
- struct afsToken Token;
- struct afsVolSync tsync;
- struct afsFid fid;
- int vnode, unique, position, length;
- int code;
- struct rx_call *tcall;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- sscanf(&(*argp)[0], "%d", &position);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- tcall = rx_NewCall(cstruct->conns[0]);
- code = StartAFS_FetchData(tcall, &fid, &hyp0, position, length, 0);
- if (!code) {
- code = FetchProc(tcall);
- }
- if (!code) {
- code = EndAFS_FetchData(tcall, &OutStatus, &Token, &tsync);
- }
- code = rx_EndCall(tcall, code);
- return code;
-}
-
-
-static afs_int32
-FetchProc(struct rx_call *acall)
-{
- char *tbuffer;
- afs_int32 tlen, length, code;
-
- code = rx_Read(acall, &length, sizeof(afs_int32));
- length = ntohl(length);
- if (code != sizeof(afs_int32))
- return -1;
- tbuffer = malloc(256);
- while (length > 0) {
- tlen = (length > 256 ? 256 : length);
- code = rx_Read(acall, tbuffer, tlen);
- if (code != tlen) {
- free(tbuffer);
- return -1;
- }
- length -= tlen;
- }
- free(tbuffer);
- return 0;
-}
-
-
-afs_int32
-FetchStatus(char **argp)
-{
- struct afsFetchStatus OutStatus;
- struct afsToken Token;
- struct afsVolSync tsync;
- struct afsFid fid;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- code =
- ubik_AFS_FetchStatus(cstruct, 0, &fid, &hyp0, 0, &OutStatus,
- &Token, &tsync);
- return (code);
-}
-
-
-afs_int32
-FetchACL(char **argp)
-{
- struct afsFetchStatus OutStatus;
- struct afsACL AccessList;
- struct afsToken Token;
- struct afsVolSync tsync;
- struct afsFid fid;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- code =
- ubik_AFS_FetchACL(cstruct, 0, &fid, &hyp0, 0, &AccessList,
- &OutStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-StoreData(char **argp)
-{
- struct afsStoreStatus InStatus;
- struct afsFetchStatus OutStatus;
- struct afsVolSync tsync;
- struct afsFid fid;
- int vnode, unique, position, length, filelength;
- int mode, owner, len;
- int code;
- char *string;
- struct rx_call *tcall;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- sscanf(&(*argp)[0], "%d", &position);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- sscanf(&(*argp)[0], "%d", &filelength);
- ++argp;
- memset(&InStatus, 0, sizeof(struct afsStoreStatus));
- sscanf(&(*argp)[0], "%d", &mode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &owner);
- ++argp;
- sscanf(&(*argp)[0], "%d", &len);
- ++argp;
- if (mode != -1) {
- InStatus.mode = mode;
- InStatus.mask |= AFS_SETMODE;
- }
- if (owner != -1) {
- InStatus.owner = owner;
- InStatus.mask |= AFS_SETOWNER;
- }
- if (length != -1) {
- InStatus.length = length;
- InStatus.mask |= AFS_SETLENGTH;
- }
- string = &argp[0][0];
- ++argp;
-
- tcall = rx_NewCall(cstruct->conns[0]);
- code =
- StartAFS_StoreData(tcall, &fid, &InStatus, position, length,
- filelength, &hyp0, 0);
- if (!code) {
- code = StoreProc(tcall, string, length);
- }
- if (!code) {
- code = EndAFS_StoreData(tcall, &OutStatus, &tsync);
- }
- code = rx_EndCall(tcall, code);
- return (code);
-}
-
-
-static afs_int32
-StoreProc(struct rx_call *acall, char *string, int length)
-{
- afs_int32 tlen, code;
-
- while (length > 0) {
- tlen = (length > 256 ? 256 : length);
- code = rx_Write(acall, string, tlen);
- if (code != tlen) {
- return -1;
- }
- length -= tlen;
- }
- return 0;
-}
-
-
-afs_int32
-StoreStatus(char **argp)
-{
- struct afsStoreStatus InStatus;
- struct afsFetchStatus OutStatus;
- struct afsVolSync tsync;
- struct afsFid fid;
- int vnode, unique, mode, owner, length;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- memset(&InStatus, 0, sizeof(struct afsStoreStatus));
- sscanf(&(*argp)[0], "%d", &mode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &owner);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- if (mode != -1) {
- InStatus.mode = mode;
- InStatus.mask |= AFS_SETMODE;
- }
- if (owner != -1) {
- InStatus.owner = owner;
- InStatus.mask |= AFS_SETOWNER;
- }
- if (length != -1) {
- InStatus.length = length;
- InStatus.mask |= AFS_SETLENGTH;
- }
- code =
- ubik_AFS_StoreStatus(cstruct, 0, &fid, &InStatus, &hyp0, 0,
- &OutStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-StoreACL(char **argp)
-{
- struct afsFetchStatus OutStatus;
- struct afsACL AccessList;
- struct afsToken Token;
- struct afsVolSync tsync;
- struct afsFid fid;
- char *string;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- string = &argp[0][0];
- ++argp;
- AccessList.afsACL_len = strlen(string) + 1;
- AccessList.afsACL_val = string;
- code =
- ubik_AFS_StoreACL(cstruct, 0, &fid, &AccessList, &hyp0, 0,
- &OutStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-RemoveFile(char **argp)
-{
- struct afsFetchStatus OutDirStatus, OutFidStatus;
- struct afsVolSync tsync;
- struct afsFidName nameFid;
- struct afsFid fid, outFid;
- char *name;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- memset(&nameFid, 0, sizeof(struct afsFidName));
- strcpy(nameFid.name, name);
- code =
- ubik_AFS_RemoveFile(cstruct, 0, &fid, &nameFid, &hyp0, 0,
- &OutDirStatus, &OutFidStatus, &outFid, &tsync);
- return (code);
-}
-
-
-afs_int32
-CreateFile(char **argp)
-{
- struct afsFetchStatus OutDirStatus, OutFidStatus;
- struct afsStoreStatus InStatus;
- struct afsVolSync tsync;
- struct afsFid fid, outFid;
- struct afsToken Token;
- char *name;
- int vnode, unique, mode, owner, length;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- memset(&InStatus, 0, sizeof(struct afsStoreStatus));
- sscanf(&(*argp)[0], "%d", &mode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &owner);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- if (mode != -1) {
- InStatus.mode = mode;
- InStatus.mask |= AFS_SETMODE;
- }
- if (owner != -1) {
- InStatus.owner = owner;
- InStatus.mask |= AFS_SETOWNER;
- }
- if (length != -1) {
- InStatus.length = length;
- InStatus.mask |= AFS_SETLENGTH;
- }
- code =
- ubik_AFS_CreateFile(cstruct, 0, &fid, name, &InStatus, &hyp0, 0,
- &outFid, &OutFidStatus, &OutDirStatus, &Token, &tsync);
- return (code);
-}
-
-
-afs_int32
-Rename(char **argp)
-{
- struct afsFetchStatus OutOldDirStatus, OutNewDirStatus;
- struct afsFetchStatus OutOldFileStatus, OutNewFileStatus;
- struct afsVolSync tsync;
- struct afsFid OldDirFid, NewDirFid, OutOldFileFid, OutNewFileFid;
- struct afsFidName OldName, NewName;
- char *oname, *nname;
- int ovnode, ounique, nvnode, nunique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &ovnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &ounique);
- ++argp;
- memset(&OldDirFid, 0, sizeof(struct afsFid));
- OldDirFid.Volume.low = 10; /* XXX */
- OldDirFid.Vnode = ovnode;
- OldDirFid.Unique = ounique;
- oname = &argp[0][0];
- ++argp;
- memset(&OldName, 0, sizeof(struct afsFidName));
- strcpy(OldName.name, oname);
- sscanf(&(*argp)[0], "%d", &nvnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &nunique);
- ++argp;
- memset(&NewDirFid, 0, sizeof(struct afsFid));
- NewDirFid.Volume.low = 10; /* XXX */
- NewDirFid.Vnode = nvnode;
- NewDirFid.Unique = nunique;
- nname = &argp[0][0];
- ++argp;
- memset(&NewName, 0, sizeof(struct afsFidName));
- strcpy(NewName.name, nname);
- code =
- ubik_AFS_Rename(cstruct, 0, &OldDirFid, &OldName, &NewDirFid,
- &NewName, &hyp0, 0, &OutOldDirStatus, &OutNewDirStatus,
- &OutOldFileFid, &OutOldFileStatus, &OutNewFileFid,
- &OutNewFileStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-Symlink(char **argp)
-{
- struct afsFetchStatus OutDirStatus, OutFidStatus;
- struct afsStoreStatus InStatus;
- struct afsVolSync tsync;
- struct afsFid fid, outFid;
- struct afsToken Token;
- char *name, *linkcontents;
- int vnode, unique, mode, owner, length;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- linkcontents = &argp[0][0];
- ++argp;
- memset(&InStatus, 0, sizeof(struct afsStoreStatus));
- sscanf(&(*argp)[0], "%d", &mode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &owner);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- if (mode != -1) {
- InStatus.mode = mode;
- InStatus.mask |= AFS_SETMODE;
- }
- if (owner != -1) {
- InStatus.owner = owner;
- InStatus.mask |= AFS_SETOWNER;
- }
- if (length != -1) {
- InStatus.length = length;
- InStatus.mask |= AFS_SETLENGTH;
- }
- code =
- ubik_AFS_Symlink(cstruct, 0, &fid, name, linkcontents,
- &InStatus, &hyp0, 0, &outFid, &OutFidStatus, &OutDirStatus,
- &Token, &tsync);
- return (code);
-}
-
-
-afs_int32
-HardLink(char **argp)
-{
- struct afsFetchStatus OutDirStatus, OutFidStatus;
- struct afsVolSync tsync;
- struct afsFid fid, existingFid;
- char *name;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&existingFid, 0, sizeof(struct afsFid));
- existingFid.Volume.low = 10; /* XXX */
- existingFid.Vnode = vnode;
- existingFid.Unique = unique;
- code =
- ubik_AFS_HardLink(cstruct, 0, &fid, name, &existingFid, &hyp0,
- 0, &OutFidStatus, &OutDirStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-MakeDir(char **argp)
-{
- struct afsFetchStatus OutDirStatus, OutFidStatus;
- struct afsStoreStatus InStatus;
- struct afsVolSync tsync;
- struct afsFid fid, outFid;
- struct afsToken Token;
- char *name;
- int vnode, unique, mode, owner, length;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- memset(&InStatus, 0, sizeof(struct afsStoreStatus));
- sscanf(&(*argp)[0], "%d", &mode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &owner);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- if (mode != -1) {
- InStatus.mode = mode;
- InStatus.mask |= AFS_SETMODE;
- }
- if (owner != -1) {
- InStatus.owner = owner;
- InStatus.mask |= AFS_SETOWNER;
- }
- if (length != -1) {
- InStatus.length = length;
- InStatus.mask |= AFS_SETLENGTH;
- }
- code =
- ubik_AFS_MakeDir(cstruct, 0, &fid, name, &InStatus, &hyp0, 0,
- &outFid, &OutFidStatus, &OutDirStatus, &Token, &tsync);
- return (code);
-}
-
-
-afs_int32
-RemoveDir(char **argp)
-{
- struct afsFetchStatus OutDirStatus;
- struct afsVolSync tsync;
- struct afsFid fid, outFid;
- struct afsFidName nameFid;
- char *name;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- memset(&nameFid, 0, sizeof(struct afsFidName));
- strcpy(nameFid.name, name);
- code =
- ubik_AFS_RemoveDir(cstruct, 0, &fid, &nameFid, &hyp0, 0,
- &OutDirStatus, &outFid, &tsync);
- return (code);
-}
-
-
-afs_int32
-Readdir(char **argp)
-{
- struct afsFetchStatus OutDirStatus;
- struct afsVolSync tsync;
- struct afsFid fid;
- struct afsToken Token;
- char *name;
- struct rx_call *tcall;
- int vnode, unique, offset, length, NextOffset;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- sscanf(&(*argp)[0], "%d", &offset);
- ++argp;
- sscanf(&(*argp)[0], "%d", &length);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- tcall = rx_NewCall(cstruct->conns[0]);
- code = StartAFS_Readdir(tcall, &fid, offset, length, &hyp0, 0);
- if (!code) {
- code = FetchDir(tcall);
- }
- if (!code) {
- code =
- EndAFS_FetchData(tcall, &NextOffset, &OutDirStatus, &Token,
- &tsync);
- }
- code = rx_EndCall(tcall, code);
- return (code);
-}
-
-
-static afs_int32
-FetchDir(struct rx_call *acall)
-{
- char *tbuffer;
- afs_int32 tlen, length, code;
- struct dirent *dp;
-
-
- tbuffer = malloc(256);
- while (1) {
- code = rx_Read(acall, &length, sizeof(afs_int32));
- length = ntohl(length);
- if (code != sizeof(afs_int32))
- return -1;
- if (length == 0)
- break;
- tlen = (length > 8192 ? 8192 : length);
- code = rx_Read(acall, tbuffer, tlen);
- if (code != tlen) {
- free(tbuffer);
- return -1;
- }
- length -= tlen;
- }
- dp = (struct dirent *)dp;
- free(tbuffer);
- return 0;
-}
-
-
-afs_int32
-Lookup(char **argp)
-{
- struct afsFetchStatus OutDirStatus, OutFidStatus;
- struct afsVolSync tsync;
- struct afsFid fid, outFid;
- char *name;
- int vnode, unique;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- name = &argp[0][0];
- ++argp;
- code =
- ubik_AFS_Lookup(cstruct, 0, &fid, name, &hyp0, 0, &outFid,
- &OutFidStatus, &OutDirStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-GetToken(char **argp)
-{
- struct afsFetchStatus OutStatus;
- struct afsVolSync tsync;
- struct afsToken MinToken, RealToken;
- struct afsFid fid;
- int vnode, unique, tokenId;
- int code;
-
- sscanf(&(*argp)[0], "%d", &vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &unique);
- ++argp;
- memset(&fid, 0, sizeof(struct afsFid));
- fid.Volume.low = 10; /* XXX */
- fid.Vnode = vnode;
- fid.Unique = unique;
- sscanf(&(*argp)[0], "%d", &tokenId);
- ++argp;
- memset(&MinToken, 0, sizeof(struct afsToken));
- MinToken.tokenID.low = tokenId; /* XXX */
- code =
- ubik_AFS_GetToken(cstruct, 0, &fid, &MinToken, &hyp0, 0,
- &RealToken, &OutStatus, &tsync);
- return (code);
-}
-
-
-afs_int32
-MakeMountPoint(char **argp)
-{
-}
-
-
-afs_int32
-ReleaseTokens(char **argp)
-{
-}
-
-
-afs_int32
-BulkStatus(char **argp)
-{
-}
-
-/* printf("ka <vol.l> <vnode> <unique> <isExec> <kaTime>\n"); */
-afs_int32
-KeepAlive(char **argp)
-{
- struct afsBulkFEX fex;
- afs_uint32 numExec, spare4;
- struct afsFidExp fx;
- int code;
-
- memset(&fx, 0, sizeof(struct afsFidExp));
- sscanf(&(*argp)[0], "%d", &fx.fid.Volume.low);
- ++argp;
- sscanf(&(*argp)[0], "%d", &fx.fid.Vnode);
- ++argp;
- sscanf(&(*argp)[0], "%d", &fx.fid.Unique);
- ++argp;
- sscanf(&(*argp)[0], "%d", &numExec);
- ++argp;
- sscanf(&(*argp)[0], "%d", &fx.keepAliveTime);
- memset(&fex, 0, sizeof(struct afsBulkFEX));
- fex.afsBulkFEX_val = &fx;
- fex.afsBulkFEX_len = 1;
- code =
- ubik_AFS_BulkKeepAlive(cstruct, 0, &fex, numExec, 0, 0, 0,
- &spare4);
- return (code);
-}
-#endif /* notdef */
return 0;
}
-#if 0
-static int
-find_he_by_index(afs_uint32 idx)
-{
- int i;
-
- if (get_h_hdr()) {
- return 1;
- }
-
- for (i = 0; i < hdrs.h_hdr.records; i++) {
- if (get_he(i)) {
- fprintf(stderr, "error getting he %d\n", i);
- return 1;
- }
- if (he_cursor.he.index == idx)
- break;
- }
-
- if (i < hdrs.h_hdr.records) {
- dump_this_he();
- return 0;
- }
- return 1;
-}
-#endif
-
static int
find_fe_by_index(afs_uint32 idx)
{
}
}
for (p = inodes; p < einodes && i < e; i++, p++) {
-#ifdef notdef
- Log("Ino=%d, v1=%x, v2=%x, v3=%x, mode=%x size=%d, lcnt=%d\n",
- i, p->di_vicep1, p->di_vicep2, p->di_vicep3, p->di_mode,
- p->di_size, p->di_nlink);
- printf
- ("Ino=%d, v1=%x, v2=%x, v3=%x, mode=%x size=%d, lcnt=%d\n",
- i, p->di_vicep1, p->di_vicep2, p->di_vicep3, p->di_mode,
- p->di_size, p->di_nlink);
-#endif
#if defined(AFS_SUN5_ENV)
/* if this is a pre-sol2.6 unconverted inode, bail out */
{
DiskPartitionTable[dp->index] = dp;
}
-#if 0
-static void
-DeletePartitionFromTable_r(struct DiskPartition64 *dp)
-{
- opr_Assert(dp->index >= 0 && dp->index <= VOLMAXPARTS);
- DiskPartitionTable[dp->index] = NULL;
-}
-#endif
#endif /* AFS_DEMAND_ATTACH_FS */
/* forward declarations */
static int ObliterateRegion(Volume * avp, VnodeClass aclass, StreamHandle_t * afile,
afs_foff_t * aoffset);
-#if 0
-static void PurgeIndex(Volume * vp, VnodeClass class);
-static void PurgeHeader(Volume * vp);
-#endif
static void PurgeIndex_r(Volume * vp, VnodeClass class);
static void PurgeHeader_r(Volume * vp);
return -1;
}
-#if 0
-static void
-PurgeIndex(Volume * vp, VnodeClass class)
-{
- VOL_LOCK;
- PurgeIndex_r(vp, class);
- VOL_UNLOCK;
-}
-#endif
-
static void
PurgeIndex_r(Volume * vp, VnodeClass class)
{
FDH_CLOSE(fdP);
}
-#if 0
-static void
-PurgeHeader(Volume * vp)
-{
- VOL_LOCK;
- PurgeHeader_r(vp);
- VOL_UNLOCK;
-}
-#endif
-
static void
PurgeHeader_r(Volume * vp)
{
SalvageHashTable[idx].len++;
}
-#if 0
-static void
-DeleteNodeFromHash(struct SalvageQueueNode * node)
-{
- int idx = VSHASH(node->command.sop.volume);
-
- if (queue_IsNotOnQueue(&node->hash_chain)) {
- return;
- }
-
- queue_Remove(&node->hash_chain);
- SalvageHashTable[idx].len--;
-}
-#endif
-
void
SALVSYNC_salvInit(void)
{
}
}
-#if 0
-static struct SalvageQueueNode *
-LookupPendingCommand(SALVSYNC_command_hdr * qry)
-{
- struct SalvageQueueNode * np, * nnp;
-
- for (queue_Scan(&pendingQueue, np, nnp, SalvageQueueNode)) {
- if ((np->command.sop.volume == qry->volume) &&
- !strncmp(np->command.sop.partName, qry->partName,
- sizeof(qry->partName)))
- break;
- }
-
- if (queue_IsEnd(&pendingQueue, np))
- np = NULL;
- return np;
-}
-#endif
-
static struct SalvageQueueNode *
LookupPendingCommandByPid(int pid)
{
static void FreeVolumeHeader(Volume * vp);
static void AddVolumeToHashTable(Volume * vp, VolumeId hashid);
static void DeleteVolumeFromHashTable(Volume * vp);
-#if 0
-static int VHold(Volume * vp);
-#endif
static int VHold_r(Volume * vp);
static void VGetBitmap_r(Error * ec, Volume * vp, VnodeClass class);
static void VReleaseVolumeHandles_r(Volume * vp);
#endif /* !AFS_PTHREAD_ENV */
-#if 0
-static int
-VHold(Volume * vp)
-{
- int retVal;
- VOL_LOCK;
- retVal = VHold_r(vp);
- VOL_UNLOCK;
- return retVal;
-}
-#endif
-
static afs_int32
VIsGoingOffline_r(struct Volume *vp)
{
const struct timespec *timeout)
{
Volume *vp = hint;
- /* pull this profiling/debugging code out of regular builds */
-#ifdef notdef
-#define VGET_CTR_INC(x) x++
- unsigned short V0 = 0, V1 = 0, V2 = 0, V3 = 0, V5 = 0, V6 =
- 0, V7 = 0, V8 = 0, V9 = 0;
- unsigned short V10 = 0, V11 = 0, V12 = 0, V13 = 0, V14 = 0, V15 = 0;
-#else
-#define VGET_CTR_INC(x)
-#endif
#ifdef AFS_DEMAND_ATTACH_FS
Volume *avp, * rvp = hint;
#endif
*ec = 0;
if (client_ec)
*client_ec = 0;
- VGET_CTR_INC(V0);
vp = VLookupVolume_r(ec, volumeId, vp);
if (*ec) {
#endif /* AFS_DEMAND_ATTACH_FS */
if (!vp) {
- VGET_CTR_INC(V1);
if (VInit < 2) {
- VGET_CTR_INC(V2);
/* Until we have reached an initialization level of 2
* we don't know whether this volume exists or not.
* We can't sleep and retry later because before a volume
break;
}
- VGET_CTR_INC(V3);
IncUInt64(&VStats.hdr_gets);
#ifdef AFS_DEMAND_ATTACH_FS
LoadVolumeHeader(ec, vp);
if (*ec) {
- VGET_CTR_INC(V6);
/* Only log the error if it was a totally unexpected error. Simply
* a missing inode is likely to be caused by the volume being deleted */
if (errno != ENXIO || GetLogLevel() != 0)
break;
}
- VGET_CTR_INC(V7);
if (vp->shuttingDown) {
- VGET_CTR_INC(V8);
*ec = VNOVOL;
vp = NULL;
break;
}
if (programType == fileServer) {
- VGET_CTR_INC(V9);
if (vp->goingOffline) {
if (timeout && VTimedOut(timeout)) {
/* we've timed out; don't wait for the vol */
} else {
- VGET_CTR_INC(V10);
#ifdef AFS_DEMAND_ATTACH_FS
/* wait for the volume to go offline */
if (V_attachState(vp) == VOL_STATE_GOING_OFFLINE) {
}
}
if (vp->specialStatus) {
- VGET_CTR_INC(V11);
*ec = vp->specialStatus;
} else if (V_inService(vp) == 0 || V_blessed(vp) == 0) {
- VGET_CTR_INC(V12);
*ec = VNOVOL;
} else if (V_inUse(vp) == 0 || vp->goingOffline) {
- VGET_CTR_INC(V13);
*ec = VOFFLINE;
- } else {
- VGET_CTR_INC(V14);
}
}
break;
}
- VGET_CTR_INC(V15);
#ifdef AFS_DEMAND_ATTACH_FS
/* if no error, bump nUsers */
* which the file server would attempt to put on line
*/
FSYNC_VolOp(volume, tpartp->name, useDone, 0, NULL);
- /* XXX this code path is only hit by volume utilities, thus
- * V_BreakVolumeCallbacks will always be NULL. if we really
- * want to break callbacks in this path we need to use FSYNC_VolOp() */
-#ifdef notdef
- /* Dettaching it so break all callbacks on it */
- if (V_BreakVolumeCallbacks) {
- Log("volume %u detached; breaking all call backs\n", volume);
- (*V_BreakVolumeCallbacks) (volume);
- }
-#endif
}
#endif /* FSSYNC_BUILD_CLIENT */
}
#include "daemon_com.h"
#include "fssync.h"
-#if 0
-/** turn this on if you suspect a volume package locking bug */
-#define VOL_LOCK_DEBUG 1
-#endif
+/** turn on VOL_LOCK_DEBUG if you suspect a volume package locking bug */
#ifdef VOL_LOCK_DEBUG
#define VOL_LOCK_ASSERT_HELD \
afs_int32 modebits;
afs_int32 parent;
char acl[192];
-#ifdef notdef
- struct acl_accessList {
- int size; /*size of this access list in bytes, including MySize itself */
- int version; /*to deal with upward compatibility ; <= ACL_ACLVERSION */
- int total;
- int positive; /* number of positive entries */
- int negative; /* number of minus entries */
- struct acl_accessEntry {
- int id; /*internally-used ID of user or group */
- int rights; /*mask */
- } entries[100];
- } acl;
-#endif
afs_sfsize_t dataSize;
};
char *name = NULL;
char *thisdir, *t;
struct DumpHeader dh; /* Defined in dump.h */
-#if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */
- extern char *getwd();
-#define getcwd(x,y) getwd(x)
-#endif
thisdir = calloc(1, MAXPATHLEN+4);
if (!thisdir)
goto mem_error_exit;
afs_int32 code;
-#ifndef AFS_NT40_ENV
-#if 0
- if (geteuid() != 0) {
- fprintf(stderr, "voldump must be run as root; sorry\n");
- exit(1);
- }
-#endif
-#endif
-
if ((ti = as->parms[0].items))
partName = ti->data;
if ((ti = as->parms[1].items))
return 0;
}
-#if 0
-static afs_int32
-DeleteAll(struct nvldbentry *entry)
-{
- int i;
- afs_int32 error, code, curserver, curpart;
- afs_uint32 volid;
-
- MapHostToNetwork(entry);
- error = 0;
- for (i = 0; i < entry->nServers; i++) {
- curserver = entry->serverNumber[i];
- curpart = entry->serverPartition[i];
- if (entry->serverFlags[i] & VLSF_ROVOL) {
- volid = entry->volumeId[ROVOL];
- } else {
- volid = entry->volumeId[RWVOL];
- }
- code = UV_DeleteVolume(curserver, curpart, volid);
- if (code && !error)
- error = code;
- }
- return error;
-}
-#endif
-
static int
DeleteVolume(struct cmd_syndesc *as, void *arock)
{
volname, VOLSER_OLDMAXVOLNAME - 1);
return E2BIG;
}
-#if 0
- /*
- * In order that you be able to make clones of RO or BK, this
- * check must be omitted.
- */
- if (!VolNameOK(volname)) {
- fprintf(STDERR,
- "Illegal volume name %s, should not end in .readonly or .backup\n",
- volname);
- return EINVAL;
- }
-#endif
if (IsNumeric(volname)) {
fprintf(STDERR,
"Illegal volume name %s, should not be a number\n",
"initial quota (KB)");
cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "volume ID");
cmd_AddParm(ts, "-roid", CMD_SINGLE, CMD_OPTIONAL, "readonly volume ID");
-#ifdef notdef
- cmd_AddParm(ts, "-minquota", CMD_SINGLE, CMD_OPTIONAL, "");
-#endif
COMMONPARMS;
ts = cmd_CreateSyntax("remove", DeleteVolume, NULL, 0, "delete a volume");
/* Protos for static routines */
-#if 0
-static afs_int32 CheckAndDeleteVolume(struct rx_connection *aconn,
- afs_int32 apart, afs_uint32 okvol,
- afs_uint32 delvol);
-#endif
static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
struct rx_connection **connPtr, afs_int32 * transPtr,
afs_uint32 * crtimePtr, afs_uint32 * uptimePtr,
return code;
}
-#if 0
-/* if <okvol> is allright(indicated by beibg able to
- * start a transaction, delete the <delvol> */
-static afs_int32
-CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart,
- afs_uint32 okvol, afs_uint32 delvol)
-{
- afs_int32 error, code, tid, rcode;
- error = 0;
- code = 0;
-
- if (okvol == 0) {
- code = AFSVolTransCreate_retry(aconn, delvol, apart, ITOffline, &tid);
- if (!error && code)
- error = code;
- code = AFSVolDeleteVolume(aconn, tid);
- if (!error && code)
- error = code;
- code = AFSVolEndTrans(aconn, tid, &rcode);
- if (!code)
- code = rcode;
- if (!error && code)
- error = code;
- return error;
- } else {
- code = AFSVolTransCreate_retry(aconn, okvol, apart, ITOffline, &tid);
- if (!code) {
- code = AFSVolEndTrans(aconn, tid, &rcode);
- if (!code)
- code = rcode;
- if (!error && code)
- error = code;
- code = AFSVolTransCreate_retry(aconn, delvol, apart, ITOffline, &tid);
- if (!error && code)
- error = code;
- code = AFSVolDeleteVolume(aconn, tid);
- if (!error && code)
- error = code;
- code = AFSVolEndTrans(aconn, tid, &rcode);
- if (!code)
- code = rcode;
- if (!error && code)
- error = code;
- } else
- error = code;
- return error;
- }
-}
-
-#endif
-
/* called by EmuerateEntry, show vldb entry in a reasonable format */
void
SubEnumerateEntry(struct nvldbentry *entry)
int isMixed = 0;
char hoststr[16];
-#ifdef notdef
- fprintf(STDOUT, " readWriteID %-10u ", entry->volumeId[RWVOL]);
- if (entry->flags & VLF_RWEXISTS)
- fprintf(STDOUT, " valid \n");
- else
- fprintf(STDOUT, " invalid \n");
- fprintf(STDOUT, " readOnlyID %-10u ", entry->volumeId[ROVOL]);
- if (entry->flags & VLF_ROEXISTS)
- fprintf(STDOUT, " valid \n");
- else
- fprintf(STDOUT, " invalid \n");
- fprintf(STDOUT, " backUpID %-10u ", entry->volumeId[BACKVOL]);
- if (entry->flags & VLF_BACKEXISTS)
- fprintf(STDOUT, " valid \n");
- else
- fprintf(STDOUT, " invalid \n");
- if ((entry->cloneId != 0) && (entry->flags & VLF_ROEXISTS))
- fprintf(STDOUT, " releaseClone %-10u \n", entry->cloneId);
-#else
if (entry->flags & VLF_RWEXISTS)
fprintf(STDOUT, " RWrite: %-10u", entry->volumeId[RWVOL]);
if (entry->flags & VLF_ROEXISTS)
if ((entry->cloneId != 0) && (entry->flags & VLF_ROEXISTS))
fprintf(STDOUT, " RClone: %-10lu", (unsigned long)entry->cloneId);
fprintf(STDOUT, "\n");
-#endif
fprintf(STDOUT, " number of sites -> %lu\n",
(unsigned long)entry->nServers);
for (i = 0; i < entry->nServers; i++) {
entry.flags = VLF_RWEXISTS; /* this records that rw volume exists */
entry.serverFlags[0] = VLSF_RWVOL; /*this rep site has rw vol */
entry.volumeId[RWVOL] = aid;
-#ifdef notdef
- entry.volumeId[ROVOL] = anewid + 1; /* rw,ro, bk id are related in the default case */
- entry.volumeId[BACKVOL] = *anewid + 2;
-#else
entry.volumeId[ROVOL] = 0;
entry.volumeId[BACKVOL] = 0;
-#endif
entry.cloneId = 0;
/*map into right byte order, before passing to xdr, the stuff has to be in host
* byte order. Xdr converts it into network order */
}
/* or drop through */
}
-#ifdef notdef
- /* This is tricky. File server is very stupid, and if you mark the volume
- * as VTOutOfService, it may mark the *good* instance (if you're moving
- * between partitions on the same machine) as out of service. Since
- * we're cleaning this code up in DEcorum, we're just going to kludge around
- * it for now by removing this call. */
- /* already out of service, just zap it now */
- code =
- AFSVolSetFlags(fromconn, fromtid, VTDeleteOnSalvage | VTOutOfService);
- if (code) {
- fprintf(STDERR,
- "Failed to set the flags to make the old source volume offline\n");
- goto mfail;
- }
-#endif
if (atoserver != afromserver) {
/* set forwarding pointer for moved volumes */
VPRINT1("Setting forwarding pointer for volume %u ...", afromvol);
afs_uuid_create(&(ctx->cb_listen_addr.uuid));
#if !defined(RPC_TEST_GLOBAL_RX_INIT)
-#if 0
- code = rx_InitHost(ctx->cb_listen_addr.addr_in[0],
- (int) htons(ctx->cb_port));
-#else
code = rx_Init((int) htons(ctx->cb_port));
-#endif
#endif /* RPC_TEST_GLOBAL_RX_INIT */
assert(pthread_attr_init(&tattr) == 0);