Index: openafs/src/WINNT/afsd/NTMakefile
diff -c openafs/src/WINNT/afsd/NTMakefile:1.27.2.10 openafs/src/WINNT/afsd/NTMakefile:1.27.2.12
*** openafs/src/WINNT/afsd/NTMakefile:1.27.2.10 Sun Oct 2 02:08:55 2005
--- openafs/src/WINNT/afsd/NTMakefile Sat Oct 29 16:15:07 2005
***************
*** 131,136 ****
--- 131,139 ----
CMDBGOBJS=$(OUT)\cmdebug.obj
+ $(CMDBGOBJS): $(AFSROOT)\src\venus\cmdebug.c
+ $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
+
SLOBJS=$(OUT)\symlink.obj $(OUT)\fs_utils.obj
ILIBDIR = $(DESTDIR)\lib
Index: openafs/src/WINNT/afsd/afsd_service.c
diff -c openafs/src/WINNT/afsd/afsd_service.c:1.28.2.16 openafs/src/WINNT/afsd/afsd_service.c:1.28.2.17
*** openafs/src/WINNT/afsd/afsd_service.c:1.28.2.16 Wed May 18 18:57:08 2005
--- openafs/src/WINNT/afsd/afsd_service.c Tue Nov 8 22:05:33 2005
***************
*** 1351,1356 ****
--- 1351,1361 ----
RpcShutdown();
+ cm_ReleaseAllLocks();
+
+ rx_Finalize();
+ afsi_log("rx finalization complete");
+
cm_ShutdownMappedMemory();
#ifdef REGISTER_POWER_NOTIFICATIONS
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.8.2.16 openafs/src/WINNT/afsd/afskfw.c:1.8.2.17
*** openafs/src/WINNT/afsd/afskfw.c:1.8.2.16 Mon Oct 10 18:22:40 2005
--- openafs/src/WINNT/afsd/afskfw.c Wed Nov 30 01:40:53 2005
***************
*** 3073,3083 ****
}
strcpy(aclient.instance, "");
! if ( strcmp(realm_of_cell, creds.realm) )
! {
! strncat(aclient.name, "@", MAXKTCNAMELEN - 1);
! strncpy(aclient.name, creds.realm, MAXKTCREALMLEN - 1);
! }
aclient.name[MAXKTCREALMLEN-1] = '\0';
strcpy(aclient.cell, CellName);
--- 3073,3080 ----
}
strcpy(aclient.instance, "");
! strncat(aclient.name, "@", MAXKTCNAMELEN - 1);
! strncat(aclient.name, creds.realm, MAXKTCREALMLEN - 1);
aclient.name[MAXKTCREALMLEN-1] = '\0';
strcpy(aclient.cell, CellName);
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.25.2.16 openafs/src/WINNT/afsd/cm_conn.c:1.25.2.17
*** openafs/src/WINNT/afsd/cm_conn.c:1.25.2.16 Thu Oct 6 22:11:17 2005
--- openafs/src/WINNT/afsd/cm_conn.c Mon Nov 21 19:30:01 2005
***************
*** 401,406 ****
--- 401,425 ----
}
if ( timeLeft > 2 )
retry = 1;
+ } else if ( errorCode == VNOVNODE ) {
+ if ( fidp ) {
+ cm_scache_t * scp;
+ osi_Log4(afsd_logp, "cm_Analyze passed VNOVNODE cell %u vol %u vn %u uniq %u.",
+ fidp->cell, fidp->volume, fidp->vnode, fidp->unique);
+ #ifdef VNOVNODE_FLUSH_VOLUME
+ cm_FlushVolume(userp, reqp, fidp->cell, fidp->volume);
+ #else /* VNOVNODE_FLUSH_FILE */
+ if (!cm_GetSCache(fidp, &scp, userp, reqp)) {
+ cm_FlushFile(scp, userp, reqp);
+ #ifdef VNOVNODE_FLUSH_PARENT
+ cm_FlushParent(scp, userp, reqp);
+ #endif /* VNOVNODE_FLUSH_PARENT */
+ cm_ReleaseSCache(scp);
+ }
+ #endif /* VNODE_FLUSH_xxxx */
+ } else {
+ osi_Log0(afsd_logp, "cm_Analyze passed VNOVNODE unknown fid.");
+ }
}
/* RX codes */
***************
*** 430,435 ****
--- 449,455 ----
lock_ObtainMutex(&serverp->mx);
serverp->flags |= CM_SERVERFLAG_DOWN;
lock_ReleaseMutex(&serverp->mx);
+ cm_ForceNewConnections(serverp);
if ( timeLeft > 2 )
retry = 1;
}
***************
*** 696,702 ****
tcp->refCount = 1;
lock_ReleaseMutex(&tcp->mx);
} else {
! if ((tcp->ucgen < ucellp->gen) ||
(tcp->cryptlevel != (cryptall ? (ucellp->flags & CM_UCELLFLAG_RXKAD ? rxkad_crypt : rxkad_clear) : rxkad_clear)))
{
if (tcp->ucgen < ucellp->gen)
--- 716,723 ----
tcp->refCount = 1;
lock_ReleaseMutex(&tcp->mx);
} else {
! if ((tcp->flags & CM_CONN_FLAG_FORCE_NEW) ||
! (tcp->ucgen < ucellp->gen) ||
(tcp->cryptlevel != (cryptall ? (ucellp->flags & CM_UCELLFLAG_RXKAD ? rxkad_crypt : rxkad_clear) : rxkad_clear)))
{
if (tcp->ucgen < ucellp->gen)
***************
*** 704,709 ****
--- 725,731 ----
else
osi_Log0(afsd_logp, "cm_ConnByServer replace connection due to crypt change");
lock_ObtainMutex(&tcp->mx);
+ tcp->flags &= ~CM_CONN_FLAG_FORCE_NEW;
rx_DestroyConnection(tcp->callp);
cm_NewRXConnection(tcp, ucellp, serverp);
lock_ReleaseMutex(&tcp->mx);
***************
*** 749,751 ****
--- 771,785 ----
return rxconn;
}
+ void cm_ForceNewConnections(cm_server_t *serverp)
+ {
+ cm_conn_t *tcp;
+
+ lock_ObtainWrite(&cm_connLock);
+ for (tcp = serverp->connsp; tcp; tcp=tcp->nextp) {
+ lock_ObtainMutex(&tcp->mx);
+ tcp->flags |= CM_CONN_FLAG_FORCE_NEW;
+ lock_ReleaseMutex(&tcp->mx);
+ }
+ lock_ReleaseWrite(&cm_connLock);
+ }
Index: openafs/src/WINNT/afsd/cm_conn.h
diff -c openafs/src/WINNT/afsd/cm_conn.h:1.8.2.2 openafs/src/WINNT/afsd/cm_conn.h:1.8.2.3
*** openafs/src/WINNT/afsd/cm_conn.h:1.8.2.2 Sun Jun 5 02:45:31 2005
--- openafs/src/WINNT/afsd/cm_conn.h Mon Nov 21 19:30:01 2005
***************
*** 29,34 ****
--- 29,36 ----
int cryptlevel; /* encrytion status */
} cm_conn_t;
+ #define CM_CONN_FLAG_FORCE_NEW 1
+
/* structure used for tracking RPC progress */
typedef struct cm_req {
DWORD startTime; /* Quit before RDR times us out */
***************
*** 115,118 ****
--- 117,122 ----
extern struct rx_connection * cm_GetRxConn(cm_conn_t *connp);
+ extern void cm_ForceNewConnections(cm_server_t *serverp);
+
#endif /* __CM_CONN_H_ENV__ */
Index: openafs/src/WINNT/afsd/cm_daemon.c
diff -c openafs/src/WINNT/afsd/cm_daemon.c:1.4.2.8 openafs/src/WINNT/afsd/cm_daemon.c:1.4.2.9
*** openafs/src/WINNT/afsd/cm_daemon.c:1.4.2.8 Tue Oct 18 16:51:01 2005
--- openafs/src/WINNT/afsd/cm_daemon.c Sat Oct 29 16:15:07 2005
***************
*** 27,33 ****
#include "afsd.h"
#include "afsicf.h"
! long cm_daemonCheckInterval = 30;
long cm_daemonTokenCheckInterval = 180;
osi_rwlock_t cm_daemonLock;
--- 27,38 ----
#include "afsd.h"
#include "afsicf.h"
! /* in seconds */
! long cm_daemonCheckDownInterval = 180;
! long cm_daemonCheckUpInterval = 600;
! long cm_daemonCheckVolInterval = 3600;
! long cm_daemonCheckCBInterval = 60;
! long cm_daemonCheckLockInterval = 60;
long cm_daemonTokenCheckInterval = 180;
osi_rwlock_t cm_daemonLock;
***************
*** 204,214 ****
srand(ntohl(code));
now = osi_Time();
! lastVolCheck = now - 1800 + (rand() % 3600);
! lastCBExpirationCheck = now - 60 + (rand() % 60);
! lastLockCheck = now - 60 + (rand() % 60);
! lastDownServerCheck = now - cm_daemonCheckInterval/2 + (rand() % cm_daemonCheckInterval);
! lastUpServerCheck = now - 1800 + (rand() % 3600);
lastTokenCacheCheck = now - cm_daemonTokenCheckInterval/2 + (rand() % cm_daemonTokenCheckInterval);
while (daemon_ShutdownFlag == 0) {
--- 209,219 ----
srand(ntohl(code));
now = osi_Time();
! lastVolCheck = now - cm_daemonCheckVolInterval/2 + (rand() % cm_daemonCheckVolInterval);
! lastCBExpirationCheck = now - cm_daemonCheckCBInterval/2 + (rand() % cm_daemonCheckCBInterval);
! lastLockCheck = now - cm_daemonCheckLockInterval/2 + (rand() % cm_daemonCheckLockInterval);
! lastDownServerCheck = now - cm_daemonCheckDownInterval/2 + (rand() % cm_daemonCheckDownInterval);
! lastUpServerCheck = now - cm_daemonCheckUpInterval/2 + (rand() % cm_daemonCheckUpInterval);
lastTokenCacheCheck = now - cm_daemonTokenCheckInterval/2 + (rand() % cm_daemonTokenCheckInterval);
while (daemon_ShutdownFlag == 0) {
***************
*** 241,247 ****
now = osi_Time();
/* check down servers */
! if (now > lastDownServerCheck + cm_daemonCheckInterval) {
lastDownServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckDownServers");
cm_CheckServers(CM_FLAG_CHECKDOWNSERVERS, NULL);
--- 246,252 ----
now = osi_Time();
/* check down servers */
! if (now > lastDownServerCheck + cm_daemonCheckDownInterval) {
lastDownServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckDownServers");
cm_CheckServers(CM_FLAG_CHECKDOWNSERVERS, NULL);
***************
*** 249,274 ****
}
/* check up servers */
! if (now > lastUpServerCheck + 3600) {
lastUpServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckUpServers");
cm_CheckServers(CM_FLAG_CHECKUPSERVERS, NULL);
now = osi_Time();
}
! if (now > lastVolCheck + 3600) {
lastVolCheck = now;
cm_CheckVolumes();
now = osi_Time();
}
! if (now > lastCBExpirationCheck + 60) {
lastCBExpirationCheck = now;
cm_CheckCBExpiration();
now = osi_Time();
}
! if (now > lastLockCheck + 60) {
lastLockCheck = now;
cm_CheckLocks();
now = osi_Time();
--- 254,279 ----
}
/* check up servers */
! if (now > lastUpServerCheck + cm_daemonCheckUpInterval) {
lastUpServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckUpServers");
cm_CheckServers(CM_FLAG_CHECKUPSERVERS, NULL);
now = osi_Time();
}
! if (now > lastVolCheck + cm_daemonCheckVolInterval) {
lastVolCheck = now;
cm_CheckVolumes();
now = osi_Time();
}
! if (now > lastCBExpirationCheck + cm_daemonCheckCBInterval) {
lastCBExpirationCheck = now;
cm_CheckCBExpiration();
now = osi_Time();
}
! if (now > lastLockCheck + cm_daemonCheckLockInterval) {
lastLockCheck = now;
cm_CheckLocks();
now = osi_Time();
Index: openafs/src/WINNT/afsd/cm_daemon.h
diff -c openafs/src/WINNT/afsd/cm_daemon.h:1.2.20.1 openafs/src/WINNT/afsd/cm_daemon.h:1.2.20.2
*** openafs/src/WINNT/afsd/cm_daemon.h:1.2.20.1 Fri Mar 11 01:58:41 2005
--- openafs/src/WINNT/afsd/cm_daemon.h Sat Oct 29 16:15:07 2005
***************
*** 11,17 ****
#define __CM_DAEMON_H_ENV_ 1
/* externs */
! extern long cm_daemonCheckInterval;
extern osi_rwlock_t cm_daemonLock;
--- 11,22 ----
#define __CM_DAEMON_H_ENV_ 1
/* externs */
! extern long cm_daemonCheckDownInterval;
! extern long cm_daemonCheckUpInterval;
! extern long cm_daemonCheckVolInterval;
! extern long cm_daemonCheckCBInterval;
! extern long cm_daemonCheckLockInterval;
! extern long cm_daemonTokenCheckInterval;
extern osi_rwlock_t cm_daemonLock;
Index: openafs/src/WINNT/afsd/cm_dcache.c
diff -c openafs/src/WINNT/afsd/cm_dcache.c:1.11.2.15 openafs/src/WINNT/afsd/cm_dcache.c:1.11.2.16
*** openafs/src/WINNT/afsd/cm_dcache.c:1.11.2.15 Fri Oct 7 23:51:26 2005
--- openafs/src/WINNT/afsd/cm_dcache.c Mon Nov 21 19:30:01 2005
***************
*** 1368,1374 ****
if (code == 0)
code = EndRXAFS_FetchData(callp, &afsStatus, &callback, &volSync);
else
! osi_Log0(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error");
code = rx_EndCall(callp, code);
if (code == RXKADUNKNOWNKEY)
osi_Log0(afsd_logp, "CALL EndCall returns RXKADUNKNOWNKEY");
--- 1368,1374 ----
if (code == 0)
code = EndRXAFS_FetchData(callp, &afsStatus, &callback, &volSync);
else
! osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error %d", code);
code = rx_EndCall(callp, code);
if (code == RXKADUNKNOWNKEY)
osi_Log0(afsd_logp, "CALL EndCall returns RXKADUNKNOWNKEY");
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.19 openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.21
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.19 Mon Oct 3 23:17:28 2005
--- openafs/src/WINNT/afsd/cm_ioctl.c Mon Nov 21 19:30:01 2005
***************
*** 75,80 ****
--- 75,84 ----
cm_dnlcPurgedp(scp);
cm_dnlcPurgevp(scp);
cm_FreeAllACLEnts(scp);
+
+ /* Force mount points and symlinks to be re-evaluated */
+ scp->mountPointStringp[0] = '\0';
+
lock_ReleaseMutex(&scp->mx);
lock_ReleaseWrite(&scp->bufCreateLock);
***************
*** 82,87 ****
--- 86,148 ----
return code;
}
+ long cm_FlushParent(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp)
+ {
+ long code = 0;
+ int i;
+ cm_fid_t parent_fid;
+
+ lock_ObtainWrite(&cm_scacheLock);
+ cm_HoldSCacheNoLock(scp);
+ parent_fid = scp->fid;
+ parent_fid.vnode = scp->parentVnode;
+ parent_fid.unique = scp->parentUnique;
+ cm_ReleaseSCacheNoLock(scp);
+
+ for (i=0; inextp) {
+ if (cm_FidCmp(&scp->fid, &parent_fid)) {
+ cm_HoldSCacheNoLock(scp);
+ lock_ReleaseWrite(&cm_scacheLock);
+
+ /* now flush the file */
+ code = cm_FlushFile(scp, userp, reqp);
+ lock_ObtainWrite(&cm_scacheLock);
+ cm_ReleaseSCacheNoLock(scp);
+ }
+ }
+ }
+ lock_ReleaseWrite(&cm_scacheLock);
+
+ return code;
+ }
+
+
+ long cm_FlushVolume(cm_user_t *userp, cm_req_t *reqp, afs_uint32 cell, afs_uint32 volume)
+ {
+ long code = 0;
+ cm_scache_t *scp;
+ int i;
+
+ lock_ObtainWrite(&cm_scacheLock);
+ for (i=0; inextp) {
+ if (scp->fid.volume == volume && scp->fid.cell == cell) {
+ cm_HoldSCacheNoLock(scp);
+ lock_ReleaseWrite(&cm_scacheLock);
+
+ /* now flush the file */
+ code = cm_FlushFile(scp, userp, reqp);
+ lock_ObtainWrite(&cm_scacheLock);
+ cm_ReleaseSCacheNoLock(scp);
+ }
+ }
+ }
+ lock_ReleaseWrite(&cm_scacheLock);
+
+ return code;
+ }
+
/*
* cm_ResetACLCache -- invalidate ACL info for a user that has just
* obtained or lost tokens
***************
*** 533,538 ****
--- 594,601 ----
return code;
}
+
+
long cm_IoctlFlushAllVolumes(struct smb_ioctl *ioctlp, struct cm_user *userp)
{
long code;
***************
*** 564,570 ****
long code;
cm_scache_t *scp;
unsigned long volume;
! int i;
cm_req_t req;
cm_InitReq(&req);
--- 627,633 ----
long code;
cm_scache_t *scp;
unsigned long volume;
! unsigned long cell;
cm_req_t req;
cm_InitReq(&req);
***************
*** 573,595 ****
if (code) return code;
volume = scp->fid.volume;
cm_ReleaseSCache(scp);
! lock_ObtainWrite(&cm_scacheLock);
! for (i=0; inextp) {
! if (scp->fid.volume == volume) {
! cm_HoldSCacheNoLock(scp);
! lock_ReleaseWrite(&cm_scacheLock);
!
! /* now flush the file */
! code = cm_FlushFile(scp, userp, &req);
! lock_ObtainWrite(&cm_scacheLock);
! cm_ReleaseSCacheNoLock(scp);
! }
! }
! }
! lock_ReleaseWrite(&cm_scacheLock);
return code;
}
--- 636,645 ----
if (code) return code;
volume = scp->fid.volume;
+ cell = scp->fid.cell;
cm_ReleaseSCache(scp);
! code = cm_FlushVolume(userp, &req, cell, volume);
return code;
}
***************
*** 983,994 ****
memcpy(&csi, tp, sizeof(csi));
if (csi.tinterval >= 0) {
cp = ioctlp->outDatap;
! memcpy(cp, (char *)&cm_daemonCheckInterval, sizeof(long));
ioctlp->outDatap += sizeof(long);
if (csi.tinterval > 0) {
if (!smb_SUser(userp))
return CM_ERROR_NOACCESS;
! cm_daemonCheckInterval = csi.tinterval;
}
return 0;
}
--- 1033,1044 ----
memcpy(&csi, tp, sizeof(csi));
if (csi.tinterval >= 0) {
cp = ioctlp->outDatap;
! memcpy(cp, (char *)&cm_daemonCheckDownInterval, sizeof(long));
ioctlp->outDatap += sizeof(long);
if (csi.tinterval > 0) {
if (!smb_SUser(userp))
return CM_ERROR_NOACCESS;
! cm_daemonCheckDownInterval = csi.tinterval;
}
return 0;
}
***************
*** 1453,1465 ****
/* set preferences for an existing vlserver */
cm_ChangeRankCellVLServer(tsp);
}
- cm_PutServer(tsp); /* decrease refcount */
}
else /* add a new server without a cell */
{
tsp = cm_NewServer(&tmp, type, NULL); /* refcount = 1 */
tsp->ipRank = rank;
}
}
return 0;
}
--- 1503,1518 ----
/* set preferences for an existing vlserver */
cm_ChangeRankCellVLServer(tsp);
}
}
else /* add a new server without a cell */
{
tsp = cm_NewServer(&tmp, type, NULL); /* refcount = 1 */
tsp->ipRank = rank;
}
+ lock_ObtainMutex(&tsp->mx);
+ tsp->flags |= CM_SERVERFLAG_PREF_SET;
+ lock_ReleaseMutex(&tsp->mx);
+ cm_PutServer(tsp); /* decrease refcount */
}
return 0;
}
Index: openafs/src/WINNT/afsd/cm_ioctl.h
diff -c openafs/src/WINNT/afsd/cm_ioctl.h:1.8.2.4 openafs/src/WINNT/afsd/cm_ioctl.h:1.8.2.5
*** openafs/src/WINNT/afsd/cm_ioctl.h:1.8.2.4 Sun Oct 2 02:08:55 2005
--- openafs/src/WINNT/afsd/cm_ioctl.h Mon Nov 21 19:30:01 2005
***************
*** 118,123 ****
--- 118,127 ----
extern long cm_FlushFile(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
+ extern long cm_FlushVolume(cm_user_t *, cm_req_t *reqp, afs_uint32 cell, afs_uint32 volume);
+
+ extern long cm_FlushParent(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp);
+
extern long cm_IoctlTraceControl(smb_ioctl_t *ioctlp, cm_user_t *userp);
extern long cm_IoctlSetToken(smb_ioctl_t *ioctlp, cm_user_t *userp);
Index: openafs/src/WINNT/afsd/cm_server.c
diff -c openafs/src/WINNT/afsd/cm_server.c:1.13.2.5 openafs/src/WINNT/afsd/cm_server.c:1.13.2.7
*** openafs/src/WINNT/afsd/cm_server.c:1.13.2.5 Fri Mar 11 01:58:42 2005
--- openafs/src/WINNT/afsd/cm_server.c Mon Nov 21 19:30:01 2005
***************
*** 100,112 ****
} /* got an unauthenticated connection to this server */
lock_ObtainMutex(&tsp->mx);
! if (code == 0) {
/* mark server as up */
tsp->flags &= ~CM_SERVERFLAG_DOWN;
}
else {
/* mark server as down */
tsp->flags |= CM_SERVERFLAG_DOWN;
}
lock_ReleaseMutex(&tsp->mx);
}
--- 100,114 ----
} /* got an unauthenticated connection to this server */
lock_ObtainMutex(&tsp->mx);
! if (code >= 0) {
/* mark server as up */
tsp->flags &= ~CM_SERVERFLAG_DOWN;
}
else {
/* mark server as down */
tsp->flags |= CM_SERVERFLAG_DOWN;
+ if (code != VRESTARTING)
+ cm_ForceNewConnections(tsp);
}
lock_ReleaseMutex(&tsp->mx);
}
***************
*** 438,458 ****
*/
cm_GCConnections(serverp); /* connsp */
! lock_FinalizeMutex(&serverp->mx);
! if ( cm_allServersp == serverp )
! cm_allServersp = serverp->allNextp;
! else {
! cm_server_t *tsp;
!
! for(tsp = cm_allServersp; tsp->allNextp; tsp=tsp->allNextp) {
! if ( tsp->allNextp == serverp ) {
! tsp->allNextp = serverp->allNextp;
! break;
! }
}
}
}
! }
void cm_FreeServerList(cm_serverRef_t** list)
{
--- 440,463 ----
*/
cm_GCConnections(serverp); /* connsp */
! if (!(serverp->flags & CM_SERVERFLAG_PREF_SET)) {
! lock_FinalizeMutex(&serverp->mx);
! if ( cm_allServersp == serverp )
! cm_allServersp = serverp->allNextp;
! else {
! cm_server_t *tsp;
!
! for(tsp = cm_allServersp; tsp->allNextp; tsp=tsp->allNextp) {
! if ( tsp->allNextp == serverp ) {
! tsp->allNextp = serverp->allNextp;
! break;
! }
! }
}
+ free(serverp);
}
}
! }
void cm_FreeServerList(cm_serverRef_t** list)
{
Index: openafs/src/WINNT/afsd/cm_server.h
diff -c openafs/src/WINNT/afsd/cm_server.h:1.5.2.4 openafs/src/WINNT/afsd/cm_server.h:1.5.2.5
*** openafs/src/WINNT/afsd/cm_server.h:1.5.2.4 Fri Mar 11 01:58:42 2005
--- openafs/src/WINNT/afsd/cm_server.h Mon Nov 21 19:30:01 2005
***************
*** 24,35 ****
struct cm_server *allNextp; /* locked by cm_serverLock */
struct sockaddr_in addr; /* by mx */
int type; /* by mx */
! struct cm_conn *connsp; /* locked by cm_connLock */
long flags; /* by mx */
! struct cm_cell *cellp; /* cell containing this server */
! unsigned long refCount; /* locked by cm_serverLock */
osi_mutex_t mx;
! unsigned short ipRank; /* server priority */
} cm_server_t;
enum repstate {not_busy, busy, offline};
--- 24,35 ----
struct cm_server *allNextp; /* locked by cm_serverLock */
struct sockaddr_in addr; /* by mx */
int type; /* by mx */
! struct cm_conn *connsp; /* locked by cm_connLock */
long flags; /* by mx */
! struct cm_cell *cellp; /* cell containing this server */
! unsigned long refCount; /* locked by cm_serverLock */
osi_mutex_t mx;
! unsigned short ipRank; /* server priority */
} cm_server_t;
enum repstate {not_busy, busy, offline};
***************
*** 47,52 ****
--- 47,53 ----
/* flags */
#define CM_SERVERFLAG_DOWN 1 /* server is down */
+ #define CM_SERVERFLAG_PREF_SET 2 /* server preference set by user */
/* flags for procedures */
#define CM_FLAG_CHECKUPSERVERS 1 /* check working servers */
Index: openafs/src/WINNT/afsd/cm_utils.c
diff -c openafs/src/WINNT/afsd/cm_utils.c:1.5.14.5 openafs/src/WINNT/afsd/cm_utils.c:1.5.14.6
*** openafs/src/WINNT/afsd/cm_utils.c:1.5.14.5 Sat Oct 15 17:48:23 2005
--- openafs/src/WINNT/afsd/cm_utils.c Mon Nov 21 19:37:48 2005
***************
*** 10,15 ****
--- 10,16 ----
#include
#include
+ #include
#ifndef DJGPP
#include
#include
***************
*** 42,50 ****
--- 43,57 ----
#define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED
#define ELOOP WSAELOOP
+ #ifdef ENAMETOOLONG
+ #undef ENAMETOOLONG
+ #endif
#define ENAMETOOLONG WSAENAMETOOLONG
#define EHOSTDOWN WSAEHOSTDOWN
#define EHOSTUNREACH WSAEHOSTUNREACH
+ #ifdef ENOTEMPTY
+ #undef ENOTEMPTY
+ #endif
#define ENOTEMPTY WSAENOTEMPTY
#define EPROCLIM WSAEPROCLIM
#define EUSERS WSAEUSERS
***************
*** 53,67 ****
#define EREMOTE WSAEREMOTE
#endif /* EWOULDBLOCK */
#endif /* !DJGPP */
#include
#include
-
#include
#include
- #include
- #include
-
#include "afsd.h"
static osi_once_t cm_utilsOnce;
--- 60,72 ----
#define EREMOTE WSAEREMOTE
#endif /* EWOULDBLOCK */
#endif /* !DJGPP */
+ #include
+
#include
#include
#include
#include
#include "afsd.h"
static osi_once_t cm_utilsOnce;
***************
*** 256,264 ****
|| error == 122 /* EDQUOT on Linux */
|| error == 1133) /* EDQUOT on Irix */
error = CM_ERROR_QUOTA;
! else if (error == VNOVNODE)
error = CM_ERROR_BADFD;
! else if (error == 21)
return CM_ERROR_ISDIR;
return error;
}
--- 261,273 ----
|| error == 122 /* EDQUOT on Linux */
|| error == 1133) /* EDQUOT on Irix */
error = CM_ERROR_QUOTA;
! else if (error == VNOVNODE) {
! #ifdef COMMENT
error = CM_ERROR_BADFD;
! #else
! error = CM_ERROR_RETRY;
! #endif
! } else if (error == 21)
return CM_ERROR_ISDIR;
return error;
}
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.27 openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.29
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.27 Tue Oct 18 16:53:50 2005
--- openafs/src/WINNT/afsd/cm_vnodeops.c Wed Nov 23 00:02:11 2005
***************
*** 3589,3598 ****
/* Called with scp->mx held */
long cm_UnlockByKey(cm_scache_t * scp,
! cm_key_t key,
! int flags,
! cm_user_t * userp,
! cm_req_t * reqp)
{
long code = 0;
AFSFid tfid;
--- 3589,3598 ----
/* Called with scp->mx held */
long cm_UnlockByKey(cm_scache_t * scp,
! cm_key_t key,
! int flags,
! cm_user_t * userp,
! cm_req_t * reqp)
{
long code = 0;
AFSFid tfid;
***************
*** 4137,4144 ****
for(q = cm_allFileLocks; q; q = nq) {
fileLock = (cm_file_lock_t *) q;
-
nq = osi_QNext(q);
if (IS_LOCK_DELETED(fileLock)) {
--- 4137,4144 ----
for(q = cm_allFileLocks; q; q = nq) {
fileLock = (cm_file_lock_t *) q;
nq = osi_QNext(q);
+ code = -1;
if (IS_LOCK_DELETED(fileLock)) {
***************
*** 4520,4522 ****
--- 4520,4557 ----
return (k1 == k2);
}
}
+
+ void cm_ReleaseAllLocks(void)
+ {
+ cm_scache_t *scp;
+ cm_req_t req;
+ cm_user_t *userp;
+ cm_key_t key;
+ cm_file_lock_t *fileLock;
+ int i;
+
+ for (i = 0; i < cm_data.hashTableSize; i++)
+ {
+ for ( scp = cm_data.hashTablep[i]; scp; scp = scp->nextp ) {
+ while (scp->fileLocksH != NULL) {
+ lock_ObtainMutex(&scp->mx);
+ lock_ObtainWrite(&cm_scacheLock);
+ if (!scp->fileLocksH) {
+ lock_ReleaseWrite(&cm_scacheLock);
+ lock_ReleaseMutex(&scp->mx);
+ break;
+ }
+ fileLock = (cm_file_lock_t *)((char *) scp->fileLocksH - offsetof(cm_file_lock_t, fileq));
+ userp = fileLock->userp;
+ cm_HoldUser(userp);
+ key = fileLock->key;
+ cm_HoldSCacheNoLock(scp);
+ lock_ReleaseWrite(&cm_scacheLock);
+ cm_UnlockByKey(scp, key, 0, userp, &req);
+ cm_ReleaseSCache(scp);
+ cm_ReleaseUser(userp);
+ lock_ReleaseMutex(&scp->mx);
+ }
+ }
+ }
+ }
Index: openafs/src/WINNT/afsd/cm_vnodeops.h
diff -c openafs/src/WINNT/afsd/cm_vnodeops.h:1.5.2.6 openafs/src/WINNT/afsd/cm_vnodeops.h:1.5.2.7
*** openafs/src/WINNT/afsd/cm_vnodeops.h:1.5.2.6 Wed Oct 5 01:12:27 2005
--- openafs/src/WINNT/afsd/cm_vnodeops.h Tue Nov 8 22:05:34 2005
***************
*** 172,178 ****
LARGE_INTEGER LLength,
cm_key_t key);
! extern void cm_CheckLocks();
extern long cm_RetryLock(cm_file_lock_t *oldFileLock, int client_is_dead);
--- 172,180 ----
LARGE_INTEGER LLength,
cm_key_t key);
! extern void cm_CheckLocks(void);
!
! extern void cm_ReleaseAllLocks(void);
extern long cm_RetryLock(cm_file_lock_t *oldFileLock, int client_is_dead);
Index: openafs/src/WINNT/afsd/cmdebug.c
diff -c openafs/src/WINNT/afsd/cmdebug.c:1.1.2.2 openafs/src/WINNT/afsd/cmdebug.c:removed
*** openafs/src/WINNT/afsd/cmdebug.c:1.1.2.2 Fri Jul 15 08:18:30 2005
--- openafs/src/WINNT/afsd/cmdebug.c Thu Dec 1 02:47:58 2005
***************
*** 1,560 ****
- /*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
- #include
- #include
-
- RCSID
- ("$Header: /cvs/openafs/src/WINNT/afsd/Attic/cmdebug.c,v 1.1.2.2 2005/07/15 12:18:30 jaltman Exp $");
-
-
- #include
- #ifdef AFS_NT40_ENV
- #include
- #include
- #else
- #ifdef HAVE_NETINET_IN_H
- #include
- #endif
- #include
- #include
- #endif
- #include
- #ifdef HAVE_STRING_H
- #include
- #else
- #ifdef HAVE_STRINGS_H
- #include
- #endif
- #endif
- #ifdef AFS_AIX32_ENV
- #include
- #endif
- #include
- #include
- #include
- #include
- #include
-
- extern struct hostent *hostutil_GetHostByName();
-
- static int
- PrintCacheConfig(struct rx_connection *aconn)
- {
- struct cacheConfig c;
- afs_uint32 srv_ver, conflen;
- int code;
-
- c.cacheConfig_len = 0;
- c.cacheConfig_val = NULL;
- code = RXAFSCB_GetCacheConfig(aconn, 1, &srv_ver, &conflen, &c);
- if (code) {
- printf("cmdebug: error checking cache config: %s\n",
- error_message(code));
- return 0;
- }
-
- if (srv_ver == AFS_CLIENT_RETRIEVAL_FIRST_EDITION) {
- struct cm_initparams_v1 *c1;
-
- if (c.cacheConfig_len != sizeof(*c1) / sizeof(afs_uint32)) {
- printf("cmdebug: configuration data size mismatch (%d != %d)\n",
- c.cacheConfig_len, sizeof(*c1) / sizeof(afs_uint32));
- return 0;
- }
-
- c1 = (struct cm_initparams_v1 *)c.cacheConfig_val;
- printf("Chunk files: %d\n", c1->nChunkFiles);
- printf("Stat caches: %d\n", c1->nStatCaches);
- printf("Data caches: %d\n", c1->nDataCaches);
- printf("Volume caches: %d\n", c1->nVolumeCaches);
- printf("Chunk size: %d", c1->otherChunkSize);
- if (c1->firstChunkSize != c1->otherChunkSize)
- printf(" (first: %d)", c1->firstChunkSize);
- printf("\n");
- printf("Cache size: %d kB\n", c1->cacheSize);
- printf("Set time: %s\n", c1->setTime ? "yes" : "no");
- printf("Cache type: %s\n", c1->memCache ? "memory" : "disk");
- } else {
- printf("cmdebug: unsupported server version %d\n", srv_ver);
- }
- }
-
- #ifndef CAPABILITY_BITS
- #define CAPABILITY_ERRORTRANS (1<<0)
- #define CAPABILITY_BITS 1
- #endif
-
- static int
- PrintInterfaces(struct rx_connection *aconn)
- {
- Capabilities caps;
- struct interfaceAddr addr;
- char * p;
- int i, code;
-
- caps.Capabilities_val = NULL;
- caps.Capabilities_len = 0;
-
- code = RXAFSCB_TellMeAboutYourself(aconn, &addr, &caps);
- if (code == RXGEN_OPCODE)
- code = RXAFSCB_WhoAreYou(aconn, &addr);
- if (code) {
- printf("cmdebug: error checking interfaces: %s\n",
- error_message(code));
- return 0;
- }
-
- UuidToString((UUID *)&addr.uuid, &p);
- printf("UUID: %s\n",p);
- RpcStringFree(&p);
-
- printf("Host interfaces:\n");
- for (i = 0; i < addr.numberOfInterfaces; i++) {
- printf("%s", afs_inet_ntoa(htonl(addr.addr_in[i])));
- if (addr.subnetmask[i])
- printf(", netmask %s", afs_inet_ntoa(htonl(addr.subnetmask[i])));
- if (addr.mtu[i])
- printf(", MTU %d", addr.mtu[i]);
- printf("\n");
- }
-
- if (caps.Capabilities_val) {
- printf("Capabilities:\n");
- if (caps.Capabilities_val[0] & CAPABILITY_ERRORTRANS) {
- printf("Error Translation\n");
- }
- printf("\n");
- }
-
- if (caps.Capabilities_val)
- free(caps.Capabilities_val);
- caps.Capabilities_val = NULL;
- caps.Capabilities_len = 0;
-
- return 0;
- }
-
- static int
- IsLocked(register struct AFSDBLockDesc *alock)
- {
- if (alock->waitStates || alock->exclLocked || alock->numWaiting
- || alock->readersReading)
- return 1;
- return 0;
- }
-
- static int
- PrintLock(register struct AFSDBLockDesc *alock)
- {
- printf("(");
- if (alock->waitStates) {
- if (alock->waitStates & READ_LOCK)
- printf("reader_waiting");
- if (alock->waitStates & WRITE_LOCK)
- printf("writer_waiting");
- if (alock->waitStates & SHARED_LOCK)
- printf("upgrade_waiting");
- } else
- printf("none_waiting");
- if (alock->exclLocked) {
- if (alock->exclLocked & WRITE_LOCK)
- printf(", write_locked");
- if (alock->exclLocked & SHARED_LOCK)
- printf(", upgrade_locked");
- printf("(pid:%d at:%d)", alock->pid_writer, alock->src_indicator);
- }
- if (alock->readersReading)
- printf(", %d read_locks(pid:%d)", alock->readersReading,
- alock->pid_last_reader);
- if (alock->numWaiting)
- printf(", %d waiters", alock->numWaiting);
- printf(")");
- return 0;
- }
-
- static int
- PrintLocks(register struct rx_connection *aconn, int aint32)
- {
- register int i;
- struct AFSDBLock lock;
- afs_int32 code;
-
- for (i = 0; i < 1000; i++) {
- code = RXAFSCB_GetLock(aconn, i, &lock);
- if (code) {
- if (code == 1)
- break;
- /* otherwise we have an unrecognized error */
- printf("cmdebug: error checking locks: %s\n",
- error_message(code));
- return code;
- }
- /* here we have the lock information, so display it, perhaps */
- if (aint32 || IsLocked(&lock.lock)) {
- printf("Lock %s status: ", lock.name);
- PrintLock(&lock.lock);
- printf("\n");
- }
- }
- return 0;
- }
-
- struct cell_cache {
- afs_int32 cellnum;
- char *cellname;
- struct cell_cache *next;
- };
-
- static char *
- GetCellName(struct rx_connection *aconn, afs_int32 cellnum)
- {
- static int no_getcellbynum;
- static struct cell_cache *cache;
- struct cell_cache *tcp;
- int code;
- char *cellname;
- serverList sl;
-
- if (no_getcellbynum)
- return NULL;
-
- for (tcp = cache; tcp; tcp = tcp->next)
- if (tcp->cellnum == cellnum)
- return tcp->cellname;
-
- cellname = NULL;
- sl.serverList_len = 0;
- sl.serverList_val = NULL;
- code = RXAFSCB_GetCellByNum(aconn, cellnum, &cellname, &sl);
- if (code) {
- if (code == RXGEN_OPCODE)
- no_getcellbynum = 1;
- return NULL;
- }
-
- if (sl.serverList_val)
- free(sl.serverList_val);
- tcp = malloc(sizeof(struct cell_cache));
- tcp->next = cache;
- tcp->cellnum = cellnum;
- tcp->cellname = cellname;
- cache = tcp;
-
- return cellname;
- }
-
- static int
- PrintCacheEntries32(struct rx_connection *aconn, int aint32)
- {
- register int i;
- register afs_int32 code;
- struct AFSDBCacheEntry centry;
- char *cellname;
-
- for (i = 0; i < 10000; i++) {
- code = RXAFSCB_GetCE(aconn, i, ¢ry);
- if (code) {
- if (code == 1)
- break;
- printf("cmdebug: failed to get cache entry %d (%s)\n", i,
- error_message(code));
- return code;
- }
-
- if (centry.addr == 0) {
- /* PS output */
- printf("Proc %4d sleeping at %08x, pri %3d\n",
- centry.netFid.Vnode, centry.netFid.Volume,
- centry.netFid.Unique - 25);
- continue;
- }
-
- if (aint32 == 0 && !IsLocked(¢ry.lock) ||
- aint32 == 2 && centry.refCount == 0 ||
- aint32 == 4 && centry.callback == 0)
- continue;
-
- /* otherwise print this entry */
- printf("** Cache entry @ 0x%08x for %d.%d.%d.%d", centry.addr,
- centry.cell, centry.netFid.Volume, centry.netFid.Vnode,
- centry.netFid.Unique);
-
- cellname = GetCellName(aconn, centry.cell);
- if (cellname)
- printf(" [%s]\n", cellname);
- else
- printf("\n");
-
- if (IsLocked(¢ry.lock)) {
- printf(" locks: ");
- PrintLock(¢ry.lock);
- printf("\n");
- }
- printf(" %012d bytes DV %012d refcnt %05d\n", centry.Length,
- centry.DataVersion, centry.refCount);
- printf(" callback %08x\texpires %u\n", centry.callback,
- centry.cbExpires);
- printf(" %d opens\t%d writers\n", centry.opens, centry.writers);
-
- /* now display states */
- printf(" ");
- if (centry.mvstat == 0)
- printf("normal file");
- else if (centry.mvstat == 1)
- printf("mount point");
- else if (centry.mvstat == 2)
- printf("volume root");
- else if (centry.mvstat == 3)
- printf("directory");
- else if (centry.mvstat == 4)
- printf("symlink");
- else if (centry.mvstat == 5)
- printf("microsoft dfs link");
- else if (centry.mvstat == 6)
- printf("invalid link");
- else
- printf("bogus mvstat %d", centry.mvstat);
- printf("\n states (0x%x)", centry.states);
- if (centry.states & 1)
- printf(", stat'd");
- if (centry.states & 2)
- printf(", backup");
- if (centry.states & 4)
- printf(", read-only");
- if (centry.states & 8)
- printf(", mt pt valid");
- if (centry.states & 0x10)
- printf(", pending core");
- if (centry.states & 0x40)
- printf(", wait-for-store");
- if (centry.states & 0x80)
- printf(", mapped");
- printf("\n");
- }
- return 0;
- }
-
- static int
- PrintCacheEntries64(struct rx_connection *aconn, int aint32)
- {
- register int i;
- register afs_int32 code;
- struct AFSDBCacheEntry64 centry;
- char *cellname;
- int ce64 = 0;
-
- for (i = 0; i < 10000; i++) {
- code = RXAFSCB_GetCE64(aconn, i, ¢ry);
- if (code) {
- if (code == 1)
- break;
- printf("cmdebug: failed to get cache entry %d (%s)\n", i,
- error_message(code));
- return code;
- }
-
- if (centry.addr == 0) {
- /* PS output */
- printf("Proc %4d sleeping at %08x, pri %3d\n",
- centry.netFid.Vnode, centry.netFid.Volume,
- centry.netFid.Unique - 25);
- continue;
- }
-
- if (aint32 == 0 && !IsLocked(¢ry.lock) ||
- aint32 == 2 && centry.refCount == 0 ||
- aint32 == 4 && centry.callback == 0)
- continue;
-
- /* otherwise print this entry */
- printf("** Cache entry @ 0x%08x for %d.%d.%d.%d", centry.addr,
- centry.cell, centry.netFid.Volume, centry.netFid.Vnode,
- centry.netFid.Unique);
-
- cellname = GetCellName(aconn, centry.cell);
- if (cellname)
- printf(" [%s]\n", cellname);
- else
- printf("\n");
-
- if (IsLocked(¢ry.lock)) {
- printf(" locks: ");
- PrintLock(¢ry.lock);
- printf("\n");
- }
- #ifdef AFS_64BIT_ENV
- printf(" %012I64d bytes DV %012d refcnt %05d\n", centry.Length,
- centry.DataVersion, centry.refCount);
- #else
- printf(" %012d bytes DV %012d refcnt %05d\n", centry.Length,
- centry.DataVersion, centry.refCount);
- #endif
- printf(" callback %08x\texpires %u\n", centry.callback,
- centry.cbExpires);
- printf(" %d opens\t%d writers\n", centry.opens, centry.writers);
-
- /* now display states */
- printf(" ");
- if (centry.mvstat == 0)
- printf("normal file");
- else if (centry.mvstat == 1)
- printf("mount point");
- else if (centry.mvstat == 2)
- printf("volume root");
- else if (centry.mvstat == 3)
- printf("directory");
- else if (centry.mvstat == 4)
- printf("symlink");
- else if (centry.mvstat == 5)
- printf("microsoft dfs link");
- else if (centry.mvstat == 6)
- printf("invalid link");
- else
- printf("bogus mvstat %d", centry.mvstat);
- printf("\n states (0x%x)", centry.states);
- if (centry.states & 1)
- printf(", stat'd");
- if (centry.states & 2)
- printf(", backup");
- if (centry.states & 4)
- printf(", read-only");
- if (centry.states & 8)
- printf(", mt pt valid");
- if (centry.states & 0x10)
- printf(", pending core");
- if (centry.states & 0x40)
- printf(", wait-for-store");
- if (centry.states & 0x80)
- printf(", mapped");
- printf("\n");
- }
- return 0;
- }
-
- static int
- PrintCacheEntries(struct rx_connection *aconn, int aint32)
- {
- register afs_int32 code;
- struct AFSDBCacheEntry64 centry64;
-
- code = RXAFSCB_GetCE64(aconn, 0, ¢ry64);
- if (code != RXGEN_OPCODE)
- return PrintCacheEntries64(aconn, aint32);
- else
- return PrintCacheEntries32(aconn, aint32);
- }
-
- static int
- CommandProc(struct cmd_syndesc *as)
- {
- struct rx_connection *conn;
- register char *hostName;
- register struct hostent *thp;
- afs_int32 port;
- struct rx_securityClass *secobj;
- int int32p;
- afs_int32 addr;
-
- hostName = as->parms[0].items->data;
- if (as->parms[1].items)
- port = atoi(as->parms[1].items->data);
- else
- port = 7001;
- thp = hostutil_GetHostByName(hostName);
- if (!thp) {
- printf("cmdebug: can't resolve address for host %s.\n", hostName);
- exit(1);
- }
- memcpy(&addr, thp->h_addr, sizeof(afs_int32));
- secobj = rxnull_NewServerSecurityObject();
- conn = rx_NewConnection(addr, htons(port), 1, secobj, 0);
- if (!conn) {
- printf("cmdebug: failed to create connection for host %s\n",
- hostName);
- exit(1);
- }
- if (as->parms[5].items) {
- /* -addrs */
- PrintInterfaces(conn);
- return 0;
- }
- if (as->parms[6].items) {
- /* -cache */
- PrintCacheConfig(conn);
- return 0;
- }
- if (as->parms[2].items)
- /* -long */
- int32p = 1;
- else if (as->parms[3].items)
- /* -refcounts */
- int32p = 2;
- else if (as->parms[4].items)
- /* -callbacks */
- int32p = 4;
- else
- int32p = 0;
-
- if (int32p == 0 || int32p == 1)
- PrintLocks(conn, int32p);
- if (int32p >= 0 || int32p <= 4)
- PrintCacheEntries(conn, int32p);
- return 0;
- }
-
- #ifndef AFS_NT40_ENV
- #include "AFS_component_version_number.c"
- #endif
-
- int
- main(int argc, char **argv)
- {
- register struct cmd_syndesc *ts;
-
- #ifdef AFS_AIX32_ENV
- /*
- * The following signal action for AIX is necessary so that in case of a
- * crash (i.e. core is generated) we can include the user's data section
- * in the core dump. Unfortunately, by default, only a partial core is
- * generated which, in many cases, isn't too useful.
- */
- struct sigaction nsa;
-
- sigemptyset(&nsa.sa_mask);
- nsa.sa_handler = SIG_DFL;
- nsa.sa_flags = SA_FULLDUMP;
- sigaction(SIGSEGV, &nsa, NULL);
- #endif
-
- #ifdef AFS_NT40_ENV
- if (afs_winsockInit() < 0) {
- printf("%s: Couldn't initialize winsock. Exiting...\n", argv[0]);
- return 1;
- }
- #endif
-
- rx_Init(0);
-
- ts = cmd_CreateSyntax(NULL, CommandProc, 0, "probe unik server");
- cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
- cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
- cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
- cmd_AddParm(ts, "-refcounts", CMD_FLAG, CMD_OPTIONAL,
- "print only cache entries with positive reference counts");
- cmd_AddParm(ts, "-callbacks", CMD_FLAG, CMD_OPTIONAL,
- "print only cache entries with callbacks");
- cmd_AddParm(ts, "-addrs", CMD_FLAG, CMD_OPTIONAL,
- "print only host interfaces");
- cmd_AddParm(ts, "-cache", CMD_FLAG, CMD_OPTIONAL,
- "print only cache configuration");
-
- cmd_Dispatch(argc, argv);
- exit(0);
- }
--- 0 ----
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.55.2.31 openafs/src/WINNT/afsd/smb.c:1.55.2.32
*** openafs/src/WINNT/afsd/smb.c:1.55.2.31 Wed Oct 19 02:58:46 2005
--- openafs/src/WINNT/afsd/smb.c Mon Oct 24 22:09:05 2005
***************
*** 6798,6805 ****
osi_LogEvent("AFS Dispatch %s",(myCrt_Dispatch(inp->inCom)),"vcp 0x%x lana %d lsn %d",(int)vcp,vcp->lana,vcp->lsn);
osi_Log4(smb_logp,"Dispatch %s vcp 0x%x lana %d lsn %d",myCrt_Dispatch(inp->inCom),vcp,vcp->lana,vcp->lsn);
code = (*(dp->procp)) (vcp, inp, outp);
! osi_LogEvent("AFS Dispatch return",NULL,"Code 0x%x",(code==0)?0:code-CM_ERROR_BASE);
! osi_Log4(smb_logp,"Dispatch return code 0x%x vcp 0x%x lana %d lsn %d",(code==0)?0:code-CM_ERROR_BASE,vcp,vcp->lana,vcp->lsn);
#ifdef LOG_PACKET
if ( code == CM_ERROR_BADSMB ||
code == CM_ERROR_BADOP )
--- 6798,6805 ----
osi_LogEvent("AFS Dispatch %s",(myCrt_Dispatch(inp->inCom)),"vcp 0x%x lana %d lsn %d",(int)vcp,vcp->lana,vcp->lsn);
osi_Log4(smb_logp,"Dispatch %s vcp 0x%x lana %d lsn %d",myCrt_Dispatch(inp->inCom),vcp,vcp->lana,vcp->lsn);
code = (*(dp->procp)) (vcp, inp, outp);
! osi_LogEvent("AFS Dispatch return",NULL,"Code 0x%x",code);
! osi_Log4(smb_logp,"Dispatch return code 0x%x vcp 0x%x lana %d lsn %d",code,vcp,vcp->lana,vcp->lsn);
#ifdef LOG_PACKET
if ( code == CM_ERROR_BADSMB ||
code == CM_ERROR_BADOP )
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.42.2.31 openafs/src/WINNT/afsd/smb3.c:1.42.2.33
*** openafs/src/WINNT/afsd/smb3.c:1.42.2.31 Fri Oct 14 07:19:55 2005
--- openafs/src/WINNT/afsd/smb3.c Mon Oct 24 22:09:06 2005
***************
*** 1380,1385 ****
--- 1380,1387 ----
osi_LogEvent("AFS-Dispatch-RAP[%s]",myCrt_RapDispatch(rapOp),"vcp[%x] lana[%d] lsn[%d]",(int)vcp,vcp->lana,vcp->lsn);
osi_Log4(smb_logp,"AFS Server - Dispatch-RAP %s vcp[%x] lana[%d] lsn[%d]",myCrt_RapDispatch(rapOp),vcp,vcp->lana,vcp->lsn);
code = (*smb_rapDispatchTable[rapOp].procp)(vcp, asp, outp);
+ osi_LogEvent("AFS-Dispatch-RAP return",myCrt_RapDispatch(rapOp),"Code 0x%x",code);
+ osi_Log4(smb_logp,"AFS Server - Dispatch-RAP return code 0x%x vcp[%x] lana[%d] lsn[%d]",code,vcp,vcp->lana,vcp->lsn);
}
else {
osi_LogEvent("AFS-Dispatch-RAP [invalid]", NULL, "op[%x] vcp[%x] lana[%d] lsn[%d]", rapOp, vcp, vcp->lana, vcp->lsn);
***************
*** 5804,5809 ****
--- 5806,5818 ----
osi_LogSaveString(smb_logp, treeStartp));
openAction = 2; /* created directory */
+ /* if the request is to create the root directory
+ * it will appear as a directory name of the nul-string
+ * and a code of CM_ERROR_NOSUCHFILE
+ */
+ if ( !*treeStartp && code == CM_ERROR_NOSUCHFILE)
+ code = CM_ERROR_EXISTS;
+
setAttr.mask = CM_ATTRMASK_CLIENTMODTIME;
setAttr.clientModTime = time(NULL);
***************
*** 6822,6836 ****
((smb_t *)outp)->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
switch (function) {
- case 6:
- return smb_ReceiveNTTranQuerySecurityDesc(vcp, inp, outp);
- case 4:
- return smb_ReceiveNTTranNotifyChange(vcp, inp, outp);
case 1:
return smb_ReceiveNTTranCreate(vcp, inp, outp);
! default:
! return CM_ERROR_INVAL;
}
}
/*
--- 6831,6853 ----
((smb_t *)outp)->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
switch (function) {
case 1:
return smb_ReceiveNTTranCreate(vcp, inp, outp);
! case 2:
! osi_Log0(smb_logp, "SMB NT Transact Ioctl - not implemented");
! break;
! case 3:
! osi_Log0(smb_logp, "SMB NT Transact SetSecurityDesc - not implemented");
! break;
! case 4:
! return smb_ReceiveNTTranNotifyChange(vcp, inp, outp);
! case 5:
! osi_Log0(smb_logp, "SMB NT Transact Rename - not implemented");
! break;
! case 6:
! return smb_ReceiveNTTranQuerySecurityDesc(vcp, inp, outp);
}
+ return CM_ERROR_INVAL;
}
/*
Index: openafs/src/WINNT/client_config/drivemap.cpp
diff -c openafs/src/WINNT/client_config/drivemap.cpp:1.27.2.6 openafs/src/WINNT/client_config/drivemap.cpp:1.27.2.7
*** openafs/src/WINNT/client_config/drivemap.cpp:1.27.2.6 Wed Jul 6 20:29:12 2005
--- openafs/src/WINNT/client_config/drivemap.cpp Mon Nov 21 19:37:50 2005
***************
*** 1005,1011 ****
void SetBitLogonOption(BOOL set,DWORD value)
{
! RWLogonOption(FALSE,((set)?value | RWLogonOption(TRUE,0):RWLogonOption(TRUE,0) & ~value) );
}
DWORD RWLogonOption(BOOL read,DWORD value)
--- 1005,1011 ----
void SetBitLogonOption(BOOL set,DWORD value)
{
! RWLogonOption(FALSE,((set)?value | RWLogonOption(TRUE,0):RWLogonOption(TRUE,0) & ~value) );
}
DWORD RWLogonOption(BOOL read,DWORD value)
***************
*** 1040,1066 ****
void MapShareName(char *pszCmdLineA)
{
! fUserName = TRUE;
! TCHAR *p=pUserName;
! pszCmdLineA++;
! while (*pszCmdLineA && (*pszCmdLineA != ' '))
! {
! *p++=*pszCmdLineA++;
! }
}
void GenRandomName(TCHAR *pname,int len)
{
! if (fUserName)
! { //user name was passed through command line, use once
! fUserName=FALSE;
! return;
! }
! srand( (unsigned)time( NULL ) );
! for (int i=0;i0))
! {
! if (drivemap) {
! DisMountDOSDrive(*lpnrLocal[i].lpLocalName);
DEBUG_EVENT1("AFS DriveUnMap","UnMap-Local=%x",res);
! }
! } else {
! DisMountDOSDriveFull(lpnrLocal[i].lpRemoteName);
DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res);
}
- }
- }
}
! } while (res!=ERROR_NO_MORE_ITEMS);
! GlobalFree((HGLOBAL)lpnrLocal);
! WNetCloseEnum(hEnum);
}
! BOOL DoMapShareChange()
! {
! DRIVEMAPLIST List;
! TCHAR szMachine[ MAX_PATH],szPath[MAX_PATH];
! DWORD rc=28;
! HANDLE hEnum;
! LPNETRESOURCE lpnrLocal,lpnr=NULL;
! DWORD res;
! DWORD cEntries=-1;
DWORD cbBuffer=16384;
memset(szMachine, '\0', sizeof(szMachine));
GetClientNetbiosName(szMachine);
// Initialize the data structure
! if (!IsServiceActive())
! return TRUE;
! memset (&List, 0x00, sizeof(DRIVEMAPLIST));
! for (size_t ii = 0; ii < 26; ++ii)
! List.aDriveMap[ii].chDrive = chDRIVE_A + ii;
! QueryDriveMapList_ReadSubmounts (&List);
! if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR)
! return FALSE;
! lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer);
! sprintf(szPath,"\\\\%s\\",szMachine);
! _strlwr(szPath);
! do {
! memset(lpnrLocal,0,cbBuffer);
! if ((res = WNetEnumResource(hEnum,&cEntries,lpnrLocal,&cbBuffer))==NO_ERROR)
{
! for (DWORD i=0;i0))
! {
! if (drivemap) {
! DisMountDOSDrive(*lpnrLocal[i].lpLocalName);
DEBUG_EVENT1("AFS DriveUnMap","UnMap-Local=%x",res);
! }
! } else {
! DisMountDOSDriveFull(lpnrLocal[i].lpRemoteName);
DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res);
}
}
! }
! }
! } while (res!=ERROR_NO_MORE_ITEMS);
! GlobalFree((HGLOBAL)lpnrLocal);
! WNetCloseEnum(hEnum);
}
! BOOL DoMapShareChange(BOOL removeUnknown)
! {
! DRIVEMAPLIST List;
! TCHAR szMachine[ MAX_PATH],szPath[MAX_PATH];
! DWORD rc=28;
! HANDLE hEnum;
! LPNETRESOURCE lpnrLocal,lpnr=NULL;
! DWORD res;
! DWORD cEntries=-1;
DWORD cbBuffer=16384;
memset(szMachine, '\0', sizeof(szMachine));
GetClientNetbiosName(szMachine);
// Initialize the data structure
! if (!IsServiceActive())
! return TRUE;
! memset (&List, 0x00, sizeof(DRIVEMAPLIST));
! for (size_t ii = 0; ii < 26; ++ii)
! List.aDriveMap[ii].chDrive = chDRIVE_A + ii;
! QueryDriveMapList_ReadSubmounts (&List);
! if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR)
! return FALSE;
! lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer);
! sprintf(szPath,"\\\\%s\\",szMachine);
! _strlwr(szPath);
! do {
! memset(lpnrLocal,0,cbBuffer);
! if ((res = WNetEnumResource(hEnum,&cEntries,lpnrLocal,&cbBuffer))==NO_ERROR)
! {
! for (DWORD i=0;i
Jeffrey Altman
Jeffrey Altman
! 2
0
2005-09-25T20:26:00Z
! 2005-09-25T20:26:00Z
1
9
53
--- 13,22 ----
Jeffrey Altman
Jeffrey Altman
! 3
0
2005-09-25T20:26:00Z
! 2005-11-30T06:53:00Z
1
9
53
***************
*** 24,30 ****
1
1
61
! 11.6408
!
--- 111,130 ----
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
!
***************
*** 155,161 ****
--- 158,165 ----
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.2.2.6 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.2.2.7
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.2.2.6 Sat Oct 8 10:15:24 2005
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm Wed Nov 30 02:13:12 2005
***************
*** 11,17 ****
! OpenAFS for Windows 1.4.0 Release Notes
--- 11,17 ----
! OpenAFS for Windows 1.4.1-RC2 Release Notes
***************
*** 34,53 ****
1414Error! Bookmark not defined.
2.
! System Requirements. Error! Bookmark not defined.
2.1
! Supported Operating Systems. Error! Bookmark not defined.
2.2
! Disk Space. Error! Bookmark not defined.
2.3
! Additional Software. Error! Bookmark not defined.
3.
! Operational Notes. Error! Bookmark not defined.
3.1.
! Requirements for Kerberos 5 Authentication. Error! Bookmark not defined.
3.2.
! Use of the Microsoft Loopback Adapter Error! Bookmark not defined.
3.3.
! Using Freelance (Dynamic Root) Mode to Improve Mobility. Error! Bookmark not defined.
3.4.
! Locating AFS Volume Database Servers. Error! Bookmark not defined.
3.5.
! Obtaining AFS Tokens as a Part of Windows Logon. Error! Bookmark not defined.
3.6.
! AFS System Tray Command Line Options. Error! Bookmark not defined.
3.7.
! The “AFS Client Admins” Authorization Group. Error! Bookmark not defined.
3.8.
! OpenAFS support for UNC paths. Error! Bookmark not defined.
3.9.
! OpenAFS includes aklog.exe. Error! Bookmark not defined.
3.10.
! OpenAFS Servers on Windows are Unsupported. Error! Bookmark not defined.
3.11.
! OpenAFS Debugging Symbol files. Error! Bookmark not defined.
3.12.
! Maximum File Size is 2GB.. Error! Bookmark not defined.
3.13.
! Encrypted AFS File Access. Error! Bookmark not defined.
3.14.
! Authenticated Access to the OpenAFS Client Service. Error! Bookmark not defined.
3.15.
! No More INI Files. Error! Bookmark not defined.
3.16.
! Microsoft Windows Internet Connection Firewall Error! Bookmark not defined.
3.17.
! Browsing AFS from the Explorer Shell and Office. Error! Bookmark not defined.
3.18.
! No Support for Byte Range Locking. Error! Bookmark not defined.
3.19.
! Automatic Discarding of AFS Tokens at Logoff. Error! Bookmark not defined.
3.20.
! Terminal Server installations. Error! Bookmark not defined.
3.21.
! Hidden Dot Files. Error! Bookmark not defined.
3.22.
! Status Cache Limits. Error! Bookmark not defined.
3.23.
! NETBIOS over TCP/IP must be enabled. Error! Bookmark not defined.
3.24.
! OpenAFS binaries are digitally signed. Error! Bookmark not defined.
3.25.
! Maximum Size of the AFSCache File. Error! Bookmark not defined.
3.26.
! Filename Character Sets. Error! Bookmark not defined.
3.27.
! Known Character Set Issues with Roaming Profiles. Error! Bookmark not defined.
3.28.
! The AFSCache File. Error! Bookmark not defined.
3.29.
! Restricting OpenAFS Client Service Start and Stop. Error! Bookmark not defined.
3.30.
! The @sys Name List Error! Bookmark not defined.
3.31.
! Symlinks to AFS UNC paths. Error! Bookmark not defined.
3.32.
! Cache Manager Debugging Now Supported. Error! Bookmark not defined.
3.33.
! Windows Logon Caching vs. Kerberos Logons. Error! Bookmark not defined.
3.34.
! Initial Server Preferences. Error! Bookmark not defined.
3.35.
! File Timestamps. Error! Bookmark not defined.
3.36.
! Windows RPC client support must be installed. Error! Bookmark not defined.
3.37.
! Generating Minidumps of the OpenAFS Client Service. Error! Bookmark not defined.
3.38.
! AFS Client Universally Unique Identifiers. Error! Bookmark not defined.
4.
! How to Debug Problems with OpenAFS for Windows: Error! Bookmark not defined.
4.1.
! pioctl debugging (IoctlDebug registry key) Error! Bookmark not defined.
4.2.
! afsd_service initialization log (%WinDir%\TEMP\afsd_init.log) Error! Bookmark not defined.
4.3.
! afsd_service debug logs (fs trace {-on, -off, -dump}
! ->%WinDir%\TEMP\afsd.log) Error! Bookmark not defined.
4.4.
! Using SysInternal’s DbgView and FileMon Tools. Error! Bookmark not defined.
4.5.
! Microsoft MiniDumps (fs minidump ->
! %WinDir%\TEMP\afsd.dmp) Error! Bookmark not defined.
4.6.
! Single Sign-on (Integrated Logon) debugging. Error! Bookmark not defined.
4.7.
! RX (AFS RPC) debugging (rxdebug) Error! Bookmark not defined.
4.8.
! Cache Manager debugging (cmdebug) Error! Bookmark not defined.
4.9.
! Persistent Cache consistency check. Error! Bookmark not defined.
5.
! Reporting Bugs: Error! Bookmark not defined.
6.
! How to Contribute to the Development of OpenAFS for Windows. Error! Bookmark not defined.
6.1.
! The USENIX OpenAFS Fund. Error! Bookmark not defined.
6.2.
! Secure Endpoints Inc. Error! Bookmark not defined.
6.3.
! The MIT Kerberos Account Error! Bookmark not defined.
6.4.
! Direct contributions of code and/or documentation. Error! Bookmark not defined.
6.5.
! OpenAFS for Windows Mailing Lists. Error! Bookmark not defined.
7.
! MSI Deployment Guide. Error! Bookmark not defined.
7.1.
! Introduction. Error! Bookmark not defined.
7.2.
! Configuration Options. Error! Bookmark not defined.
7.3
! Additional Resources. Error! Bookmark not defined.
7.4.
! Upgrades. Error! Bookmark not defined.
Appendix
! A: Registry Values. Error! Bookmark not defined.
A.1.
! Service parameters. Error! Bookmark not defined.
A.2.
! Integrated Logon Network provider parameters. Error! Bookmark not defined.
A.2.1
! Domain specific configuration keys for the Network Provider Error! Bookmark not defined.
A.3.
! AFS Credentials System Tray Tool parameters. Error! Bookmark not defined.
A.4
! OpenAFS Client Service Environment Variables. Error! Bookmark not defined.
--- 210,791 ----
1. Installer Options. Error!
! Bookmark not defined.
2. System Requirements. Error! Bookmark not defined.
2.1 Supported Operating Systems. Error! Bookmark not
! defined.
2.2 Disk Space. Error!
! Bookmark not defined.
2.3 Additional Software. Error! Bookmark not
! defined.
3. Operational Notes. Error!
! Bookmark not defined.
3.1. Requirements for Kerberos 5
! Authentication. Error! Bookmark not
! defined.
3.2. Use of the Microsoft Loopback Adapter Error! Bookmark not
! defined.
3.3. Using Freelance (Dynamic Root) Mode to
! Improve Mobility. Error! Bookmark not
! defined.
3.4. Locating AFS Volume Database Servers. Error! Bookmark not defined.
3.5. Obtaining AFS Tokens as a Part of
! Windows Logon. Error! Bookmark not
! defined.
3.6. AFS System Tray Command Line Options. Error! Bookmark not
! defined.
3.7. The “AFS Client Admins” Authorization
! Group. Error! Bookmark not
! defined.
3.8. OpenAFS support for UNC paths. Error! Bookmark not
! defined.
3.9. OpenAFS includes aklog.exe. Error! Bookmark not
! defined.
3.10. OpenAFS Servers on Windows are
! Unsupported. Error! Bookmark not
! defined.
3.11. OpenAFS Debugging Symbol files. Error! Bookmark not
! defined.
3.12. Maximum File Size is 2GB.. Error! Bookmark not
! defined.
3.13. Encrypted AFS File Access. Error! Bookmark not
! defined.
3.14. Authenticated Access to the OpenAFS
! Client Service. Error! Bookmark not
! defined.
3.15. No More INI Files. Error! Bookmark not
! defined.
3.16. Microsoft Windows Internet Connection
! Firewall Error! Bookmark not
! defined.
3.17. Browsing AFS from the Explorer Shell
! and Office. Error! Bookmark not
! defined.
3.18. Byte Range Locking. Error! Bookmark not
! defined.
3.19. Automatic Discarding of AFS Tokens at
! Logoff. Error! Bookmark not
! defined.
3.20. Terminal Server installations. Error! Bookmark not
! defined.
3.21. Hidden Dot Files. Error! Bookmark not defined.
3.22. Status Cache Limits. Error! Bookmark not
! defined.
3.23. NETBIOS over TCP/IP must be enabled. Error! Bookmark not
! defined.
3.24. OpenAFS binaries are digitally signed. Error! Bookmark not
! defined.
3.25. Maximum Size of the AFSCache File. Error! Bookmark not
! defined.
3.26. Filename Character Sets. Error! Bookmark not
! defined.
3.27. Known Character Set Issues with Roaming
! Profiles. Error! Bookmark not
! defined.
3.28. The AFSCache File. Error! Bookmark not
! defined.
3.29. Restricting OpenAFS Client Service
! Start and Stop. Error! Bookmark not
! defined.
3.30. The @sys Name List Error! Bookmark not
! defined.
3.31. Symlinks to AFS UNC paths. Error! Bookmark not
! defined.
3.32. Cache Manager Debugging Now Supported. Error! Bookmark not
! defined.
3.33. Windows Logon Caching vs. Kerberos
! Logons. Error! Bookmark not
! defined.
3.34. Initial Server Preferences. Error! Bookmark not
! defined.
3.35. File Timestamps. Error!
! Bookmark not defined.
3.36. Windows RPC client support must be
! installed. Error! Bookmark not
! defined.
3.37. Generating Minidumps of the OpenAFS
! Client Service. Error! Bookmark not
! defined.
3.38. AFS Client Universally Unique
! Identifiers. Error! Bookmark not
! defined.
4. How to Debug Problems with OpenAFS for
! Windows: Error! Bookmark not
! defined.
4.1. pioctl debugging (IoctlDebug registry
! key) Error! Bookmark not
! defined.
4.2. afsd_service initialization log
! (%WinDir%\TEMP\afsd_init.log) Error!
! Bookmark not defined.
4.3. afsd_service debug logs (fs trace {-on,
! -off, -dump} ->%WinDir%\TEMP\afsd.log) Error!
! Bookmark not defined.
4.4. Using SysInternal’s DbgView and FileMon
! Tools. Error! Bookmark not
! defined.
4.5. Microsoft MiniDumps (fs minidump -> %WinDir%\TEMP\afsd.dmp) Error! Bookmark not
! defined.
4.6. Single Sign-on (Integrated Logon)
! debugging. Error! Bookmark not
! defined.
4.7. RX (AFS RPC) debugging (rxdebug) Error! Bookmark not
! defined.
4.8. Cache Manager debugging (cmdebug) Error! Bookmark not
! defined.
4.9. Persistent Cache consistency check. Error! Bookmark not
! defined.
5. Reporting Bugs: Error!
! Bookmark not defined.
6. How to Contribute to the Development of
! OpenAFS for Windows. Error! Bookmark not
! defined.
6.1. The USENIX OpenAFS Fund. Error! Bookmark not
! defined.
6.2. Secure Endpoints Inc. Error! Bookmark not
! defined.
6.3. The MIT Kerberos Account Error! Bookmark not
! defined.
6.4. Direct contributions of code and/or
! documentation. Error! Bookmark not
! defined.
6.5. OpenAFS for Windows Mailing Lists. Error! Bookmark not
! defined.
7. MSI Deployment Guide. Error! Bookmark not
! defined.
7.1. Introduction. Error!
! Bookmark not defined.
7.2. Configuration Options. Error! Bookmark not
! defined.
7.3 Additional Resources. Error! Bookmark not
! defined.
7.4. Upgrades. Error!
! Bookmark not defined.
Appendix A: Registry Values. Error! Bookmark not
! defined.
A.1. Service parameters. Error! Bookmark not
! defined.
A.2. Integrated Logon Network provider
! parameters. Error! Bookmark not
! defined.
A.2.1 Domain specific configuration keys for
! the Network Provider Error! Bookmark not
! defined.
A.3. AFS Credentials System Tray Tool
! parameters. Error! Bookmark not
! defined.
A.4 OpenAFS Client Service Environment
! Variables. Error! Bookmark not
! defined.
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes_files/preview.wmf
Index: openafs/src/WINNT/install/wix/lang/en_US/ui.wxi
diff -c openafs/src/WINNT/install/wix/lang/en_US/ui.wxi:1.6.2.3 openafs/src/WINNT/install/wix/lang/en_US/ui.wxi:1.6.2.4
*** openafs/src/WINNT/install/wix/lang/en_US/ui.wxi:1.6.2.3 Sun Jun 12 21:07:39 2005
--- openafs/src/WINNT/install/wix/lang/en_US/ui.wxi Mon Nov 21 10:53:12 2005
***************
*** 760,779 ****
! 0
! 1
! 0
! 1
! 0
! 1
! 0
! 1
!
!
!
!
!
!
!
!
! yes
! no
--- 970,977 ----
!
!
Index: openafs/src/WINNT/talocale/tal_string.cpp
diff -c openafs/src/WINNT/talocale/tal_string.cpp:1.6.2.1 openafs/src/WINNT/talocale/tal_string.cpp:1.6.2.2
*** openafs/src/WINNT/talocale/tal_string.cpp:1.6.2.1 Wed Jul 6 20:29:17 2005
--- openafs/src/WINNT/talocale/tal_string.cpp Mon Nov 21 19:32:41 2005
***************
*** 823,843 ****
}
else
{
! GetTimeFormat (LOCALE_USER_DEFAULT, 0, <, NULL, szTime, cchRESOURCE);
! GetDateFormat (LOCALE_USER_DEFAULT, DATE_SHORTDATE, <, NULL, szDate, cchRESOURCE);
if (fShowTime && fShowDate)
{
! lstrcat (szTime, TEXT(" "));
! lstrcat (szTime, szDate);
}
! else if (fShowDate && !fShowTime)
{
! lstrcpy (szTime, szDate);
}
}
! wsprintf (pszTarget, FixFormatString (pszFormatUser), szTime);
return rc;
}
--- 823,843 ----
}
else
{
! GetTimeFormat (LOCALE_USER_DEFAULT, 0, <, "HH:mm:ss", szTime, cchRESOURCE);
! GetDateFormat (LOCALE_USER_DEFAULT, 0, <, "yyyy-MM-dd", szDate, cchRESOURCE);
if (fShowTime && fShowDate)
{
! lstrcat (szDate, TEXT(" "));
! lstrcat (szDate, szTime);
}
! else if (!fShowDate && fShowTime)
{
! lstrcpy (szDate, szTime);
}
}
! wsprintf (pszTarget, FixFormatString (pszFormatUser), szDate);
return rc;
}
Index: openafs/src/WINNT/tests/winflock/README.txt
diff -c /dev/null openafs/src/WINNT/tests/winflock/README.txt:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/README.txt Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,17 ----
+
+ To run winflock.exe:
+
+ C:\> winflock.exe -d (dir) > verbose.log
+
+ By default, there a lot of logging generated to stdout while the actual test
+ results are reported to stderr. Redirecting stdout to a log file cleans out
+ the output.
+
+ The directory specified by (dir) must exist. This is where the test files
+ will be created and tests run against.
+
+ Eg:
+
+ winflock.exe -d \\afs\athena.mit.edu\user\a\s\asanka\test > verbose.log
+
+
Index: openafs/src/WINNT/tests/winflock/main.cpp
diff -c /dev/null openafs/src/WINNT/tests/winflock/main.cpp:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/main.cpp Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,240 ----
+ #include "winflock.h"
+
+ BOOL isChild = FALSE;
+ HANDLE h_child = NULL;
+ HANDLE event_child = NULL;
+ HANDLE event_parent = NULL;
+ HANDLE mutex_logfile = NULL;
+
+ BOOL tst_read_write = TRUE;
+ BOOL tst_pause = FALSE;
+
+ int show_usage(_TCHAR * pname)
+ {
+ cerr << pname << " : WIN32 File Locking Test\n";
+ cerr <<
+ "Options:\n"
+ " -d : sets the directory where the test files are to be\n"
+ " created.\n"
+ " -nr : disable read/write tests\n"
+ " -p : Pause during the test with the test file locked\n"
+ ;
+ return 1;
+ }
+
+ int parse_cmd_line(int argc, _TCHAR * argv[])
+ {
+ int i;
+
+ if(argc == 1) {
+ return show_usage(argv[0]);
+ }
+
+ for(i=1; i 0 && test_dir[len-1] != _T('\\'))
+ StringCbCat(test_dir, sizeof(test_dir), _T("\\"));
+ } else {
+ return show_usage(argv[0]);
+ }
+ } else if (!_tcscmp(argv[i], _T("-nr"))) {
+ tst_read_write = FALSE;
+ } else if(!_tcscmp(argv[i], _T("-child"))) {
+ isChild = TRUE;
+ } else if(!_tcscmp(argv[i], _T("-p"))) {
+ tst_pause = TRUE;
+ } else {
+ cerr << "Invalid option : " << argv[i] << "\n";
+ return show_usage(argv[0]);
+ }
+ }
+ return 0;
+ }
+
+ int spawn_kids(int argc, _TCHAR *argv[])
+ {
+ PROCESS_INFORMATION procinfo;
+ STARTUPINFO startinfo;
+ TCHAR cmd_line[MAX_PATH];
+ size_t len;
+
+ StringCbCopy(cmd_line, sizeof(cmd_line), _T("\""));
+ StringCbCat(cmd_line, sizeof(cmd_line), argv[0]);
+ StringCbCat(cmd_line, sizeof(cmd_line), _T("\""));
+ StringCbCat(cmd_line, sizeof(cmd_line), _T(" -child"));
+ if(!tst_read_write)
+ StringCbCat(cmd_line, sizeof(cmd_line), _T(" -nr"));
+ StringCbLength(test_dir, sizeof(test_dir), &len);
+ if(len > 0) {
+ StringCbCat(cmd_line, sizeof(cmd_line), _T(" -d "));
+ StringCbCat(cmd_line, sizeof(cmd_line), test_dir);
+ //_tcscat(cmd_line, _T("\""));
+ }
+
+ startinfo.cb = sizeof(startinfo);
+ startinfo.lpReserved = NULL;
+ startinfo.lpDesktop = NULL;
+ startinfo.lpTitle = NULL;
+ startinfo.dwFlags = 0;
+ startinfo.cbReserved2 = 0;
+
+ cerr << "PARENT: Process ID:" << GetCurrentProcessId() << "\n";
+ cerr << "PARENT: Spawning child process: " << cmd_line << "\n";
+
+ if(!CreateProcess(
+ NULL,
+ cmd_line,
+ NULL,
+ NULL,
+ FALSE,
+ 0,
+ NULL,
+ NULL,
+ &startinfo,
+ &procinfo))
+ return 1;
+
+ h_child = procinfo.hProcess;
+
+ if(procinfo.hThread)
+ CloseHandle(procinfo.hThread);
+
+ cerr << "PARENT: Waiting for child process...\n";
+ cerr.flush();
+
+ WaitForSingleObject(event_parent, INFINITE);
+
+ cerr << "PARENT: Done.\n";
+ cerr << "PARENT: Created child process ID: " << procinfo.dwProcessId << "\n";
+ cerr.flush();
+
+ return 0;
+ }
+
+ int run_tests(void)
+ {
+ int rv = 0;
+ int rvt = 0;
+
+ #define PC_CALL(f) \
+ if(!isChild) { \
+ BEGINLOG(); \
+ rvt = f; \
+ ENDLOG(); \
+ SetEvent(event_child); \
+ WaitForSingleObject(event_parent, INFINITE); \
+ } else { \
+ WaitForSingleObject(event_child, INFINITE); \
+ BEGINLOG(); \
+ rvt = f; \
+ ENDLOG(); \
+ SetEvent(event_parent); \
+ } \
+ rv = (rv | rvt)
+
+ #define PCINT_CALL(f) \
+ rvt = f; \
+ rv = (rv | rvt)
+
+ PC_CALL(begin_tests());
+
+ PC_CALL(test_create());
+
+ if(tst_read_write)
+ PC_CALL(test_lock_prep());
+
+ PCINT_CALL(testint_lock_excl_beof());
+
+ if(tst_read_write)
+ PCINT_CALL(testint_lock_excl_rw_beof());
+
+ if(tst_read_write)
+ PCINT_CALL(testint_lock_excl_eeof());
+
+ if(tst_pause) {
+ TCHAR c;
+ cin >> c;
+ }
+
+ PCINT_CALL(testint_unlock());
+
+ PCINT_CALL(testint_lock_escalation());
+
+ PC_CALL(end_tests());
+
+ #undef PC_CALL
+ #undef PCINT_CALL
+
+ return rv;
+ }
+
+ void cleanup(void)
+ {
+ if(h_child)
+ CloseHandle(h_child);
+ }
+
+ void create_sync_objects(void)
+ {
+ event_child = CreateEvent(
+ NULL,
+ FALSE,
+ FALSE,
+ _T("Local\\WinFLockChildEvent"));
+
+ assert(event_child != NULL);
+
+ event_parent = CreateEvent(
+ NULL,
+ FALSE,
+ FALSE,
+ _T("Local\\WinFLockParentEvent"));
+
+ assert(event_parent != NULL);
+
+ mutex_logfile = CreateMutex(
+ NULL,
+ FALSE,
+ _T("Local\\WinFLockLogFileMutex"));
+
+ assert(mutex_logfile != NULL);
+ }
+
+ void free_sync_objects(void)
+ {
+ if(event_child)
+ CloseHandle(event_child);
+ if(event_parent)
+ CloseHandle(event_parent);
+ if(mutex_logfile)
+ CloseHandle(mutex_logfile);
+ }
+
+ int _tmain(int argc, _TCHAR * argv[])
+ {
+ int rv;
+
+ rv = parse_cmd_line(argc, argv);
+ if(rv != 0)
+ return rv;
+
+ create_sync_objects();
+
+ if(!isChild) {
+ if(spawn_kids(argc, argv))
+ return 1;
+ } else {
+ SetEvent(event_parent);
+ }
+
+ rv = run_tests();
+
+ free_sync_objects();
+
+ cleanup();
+ return rv;
+ }
Index: openafs/src/WINNT/tests/winflock/sync.cpp
diff -c /dev/null openafs/src/WINNT/tests/winflock/sync.cpp:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/sync.cpp Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,50 ----
+ #include "winflock.h"
+
+ void _begin_log(void)
+ {
+ WaitForSingleObject(mutex_logfile, INFINITE);
+ logfile << (isChild?"CHILD {\n":"PARENT {\n");
+ }
+
+ void _end_log(void)
+ {
+ logfile << "}\n";
+ logfile.flush();
+ ReleaseMutex(mutex_logfile);
+ }
+
+ void _sync_begin_parent(void)
+ {
+ if(!isChild) {
+ BEGINLOG();
+ } else {
+ WaitForSingleObject(event_child, INFINITE);
+ }
+ }
+
+ void _sync_end_parent(void)
+ {
+ if(!isChild) {
+ ENDLOG();
+ SetEvent(event_child);
+ } else {
+ }
+ }
+
+ void _sync_begin_child(void)
+ {
+ if(!isChild) {
+ WaitForSingleObject(event_parent, INFINITE);
+ } else {
+ BEGINLOG();
+ }
+ }
+
+ void _sync_end_child(void)
+ {
+ if(!isChild) {
+ } else {
+ ENDLOG();
+ SetEvent(event_parent);
+ }
+ }
Index: openafs/src/WINNT/tests/winflock/tests.cpp
diff -c /dev/null openafs/src/WINNT/tests/winflock/tests.cpp:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/tests.cpp Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,953 ----
+ #include "winflock.h"
+
+ TCHAR test_dir[MAX_PATH] = _T("");
+ TCHAR fn_base[MAX_PATH] = _T("");
+ TCHAR fn_aux[MAX_PATH] = _T("");
+
+ HANDLE h_file_base = NULL;
+ HANDLE h_file_aux = NULL;
+
+ void log_last_error(void)
+ {
+ logfile << "GetLastError() == " << GetLastError() << "\n";
+ }
+
+ int begin_tests()
+ {
+ TCHAR file_name[MAX_PATH];
+
+ if(!isChild)
+ logfile << "-------Starting tests-----------------------------\n";
+
+ StringCbCopy(file_name, sizeof(file_name), test_dir);
+ StringCbCat(file_name, sizeof(file_name), _T("FLTST000"));
+ StringCbCopy(fn_base, sizeof(fn_base), file_name);
+
+ logfile << "h_file_base = CreateFile(" << file_name << ") shared\n";
+
+ h_file_base = CreateFile(
+ file_name,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h_file_base == INVALID_HANDLE_VALUE) {
+ log_last_error();
+ return 1;
+ }
+
+ StringCbCopy(file_name, sizeof(file_name), test_dir);
+ StringCbCat(file_name, sizeof(file_name), _T("FLTST001"));
+ StringCbCopy(fn_aux, sizeof(fn_aux), file_name);
+
+ if(!isChild) {
+
+ logfile << "h_file_aux = CreateFile(" << file_name << ") exclusive\n";
+
+ h_file_aux = CreateFile(
+ file_name,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h_file_aux == INVALID_HANDLE_VALUE) {
+ log_last_error();
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+ /* CreateFile:
+ - Requesting a sharing mode that conflicts with the access mode specified in a previous
+ open reqeuest whose handle is still open should be an error (should return ERROR_SHARING_VIOLATION)
+ - If sharing mode is 0, the file cannot be opened again until the handle is closed.
+ - Sharing modes should be tested:
+ - FILE_SHARE_DELETE
+ - FILE_SHARE_READ
+ - FILE_SHARE_WRITE
+ */
+ int test_create(void)
+ {
+ HANDLE h;
+
+ if(isChild) {
+ logfile << "----Begin CreateFile tests ----\n";
+
+ cerr <<
+ "TEST:CREATE:001 Requesting a sharing mode that conflicts with the access mode "
+ "specified in a previous open requestion whose handle is still open should be an error.\n";
+
+ cerr <<
+ "TEST:CREATE:001:01 Attempt exclusive open of a file which is already opened exclusively\n";
+
+ logfile << "CreateFile(" << fn_aux << ")... exclusive\n";
+ h = CreateFile(
+ fn_aux,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h != INVALID_HANDLE_VALUE) {
+ logfile << "BAD : CreateFile(" << fn_aux << ") should have failed but didn't\n";
+ cerr << "TEST:CREATE:001:01 ***FAILED***\n";
+ CloseHandle(h);
+ } else {
+ logfile << "good: CreateFile(" << fn_aux << ") failed\n";
+ cerr << "TEST:CREATE:001:01 PASS (LastError=" << GetLastError() << ")\n";
+ if(GetLastError() != ERROR_SHARING_VIOLATION)
+ cerr << "TEST:CREATE:001:01 **WARN** LastError != ERROR_SHARING_VIOLATION\n";
+ }
+
+ cerr <<
+ "TEST:CREATE:001:02 Attempt to open a file with shared read which is already opened exclusively\n";
+
+ logfile << "CreateFile(" << fn_aux << ")... share read\n";
+
+ h = CreateFile(
+ fn_aux,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h != INVALID_HANDLE_VALUE) {
+ logfile << "BAD : CreateFile(" << fn_aux << ") should have failed but didn't\n";
+ cerr << "TEST:CREATE:001:02 ***FAILED***\n";
+ CloseHandle(h);
+ } else {
+ logfile << "good\n";
+ cerr << "TEST:CREATE:001:02 PASS (LastError=" << GetLastError() << ")\n";
+ if(GetLastError() != ERROR_SHARING_VIOLATION)
+ cerr << "TEST:CREATE:001:02 **WARN** LastError != ERROR_SHARING_VIOLATION\n";
+ }
+
+ cerr <<
+ "TEST:CREATE:001:03 Attempt to open a file exclusively which is already opened shared\n";
+
+ logfile << "CreateFile(" << fn_base << ")... exclusive\n";
+
+ h = CreateFile(
+ fn_base,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h != INVALID_HANDLE_VALUE) {
+ logfile << "BAD : CreateFile(" << fn_base << ") should have failed but didn't\n";
+ cerr << "TEST:CREATE:001:03 ***FAILED***\n";
+ CloseHandle(h);
+ } else {
+ logfile << "good\n";
+ cerr << "TEST:CREATE:001:03 PASS (LastError=" << GetLastError() << ")\n";
+ if(GetLastError() != ERROR_SHARING_VIOLATION)
+ cerr << "TEST:CREATE:001:03 **WARN** LastError != ERROR_SHARING_VIOLATION\n";
+ }
+
+ cerr <<
+ "TEST:CREATE:001:04 Attempt to open a file shared write which is already opened shared r/w\n";
+
+ logfile << "CreateFile(" << fn_base << ")... share write\n";
+
+ h = CreateFile(
+ fn_base,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_WRITE,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h != INVALID_HANDLE_VALUE) {
+ logfile << "BAD : CreateFile(" << fn_base << ") should have failed but didn't\n";
+ cerr << "TEST:CREATE:001:04 ***FAILED***\n";
+ CloseHandle(h);
+ } else {
+ logfile << "good\n";
+ cerr << "TEST:CREATE:001:04 PASS (LastError=" << GetLastError() << ")\n";
+ if(GetLastError() != ERROR_SHARING_VIOLATION)
+ cerr << "TEST:CREATE:001:04 **WARN** LastError != ERROR_SHARING_VIOLATION\n";
+ }
+
+ cerr <<
+ "TEST:CREATE:001:05 Attempt to open a file shared r/w which is already opened shared r/w\n";
+
+ logfile << "CreateFile(" << fn_base << ")... share r/w\n";
+
+ h = CreateFile(
+ fn_base,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_WRITE | FILE_SHARE_READ,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL);
+
+ if(h != INVALID_HANDLE_VALUE) {
+ logfile << "good\n";
+ cerr << "TEST:CREATE:001:05 PASS\n";
+ CloseHandle(h);
+ } else {
+ logfile << "BAD : CreateFile(" << fn_base << ") failed!\n";
+ cerr << "TEST:CREATE:001:05 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ }
+
+ logfile << "----End CreateFile tests ----\n";
+ }
+
+ return 0;
+ }
+
+ /* prepare the test file by filling it in with the test pattern */
+ int test_lock_prep(void)
+ {
+ int i,j;
+ DWORD * buffer;
+ DWORD nb;
+ if(!isChild) {
+ logfile << "----Preparing test file----\n";
+ /* buffer is 4k */
+ buffer = (DWORD *) malloc(sizeof(DWORD) * 1024);
+
+ assert(buffer != NULL);
+ logfile << "SetFilePointer(h_file_base, 0, NULL, FILE_BEGIN)\n";
+ SetFilePointer(h_file_base, 0, NULL, FILE_BEGIN);
+ for(j=0; j<256; j++) {
+ for(i=0; i<1024; i++) {
+ buffer[i] = j;
+ }
+
+ logfile << "WriteFile(h_file_base, (LPCVOID) buffer, sizeof(DWORD) * 1024, &nb, NULL)\n";
+
+ if(!WriteFile(h_file_base, (LPCVOID) buffer, sizeof(DWORD) * 1024, &nb, NULL)) {
+ logfile << "WARNING**: WriteFile error=" << GetLastError() << "\n";
+ } else if(nb != sizeof(DWORD) * 1024) {
+ logfile << "WARNING**: WriteFile underrun (j=" << j << ",nb=" << nb << ")\n";
+ }
+ }
+
+ free(buffer);
+
+ SetEndOfFile(h_file_base);
+ FlushFileBuffers(h_file_base);
+
+ logfile << "----End Preparing test file---\n";
+ }
+
+ return 0;
+ }
+
+ /* Test exclusive locks below EOF
+
+ testint_* functions manage their own cross process synchronization
+ */
+ int testint_lock_excl_beof(void)
+ {
+ /* at this point, test_lock_prep() has already run, and the length
+ of h_file_base is set at 1M */
+ SYNC_BEGIN_PARENT {
+ logfile << "----Begin Lock Test Exclusive BEOF----\n";
+
+ cerr << "TEST:LOCK:001 Exclusive byte-range locks below EOF\n";
+
+ /* parent takes three non-overlapping locks */
+ logfile << "LockFile(h_file_base, PAGE_BEGIN(10), 0, PAGE_LEN(10), 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(10), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:001 ***ERROR*** Setup failed!\n";
+ }
+
+ logfile << "LockFile(h_file_base, 4096 * 30, 0, 4096 * 10, 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(30), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:001 ***ERROR*** Setup failed!\n";
+ }
+
+ logfile << "LockFile(h_file_base, 4096 * 62, 0, 4096 * 1, 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(62), 0, PAGE_LEN(1), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:001 ***ERROR*** Setup failed!\n";
+ }
+ } SYNC_END_PARENT;
+
+ SYNC_BEGIN_PARENT {
+ logfile << "--Test using same handle, same process--\n";
+ cerr <<
+ "TEST:LOCK:001:01 Test overlapping locks within same process (complete overlap)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(3), 0)) {
+ cerr << "TEST:LOCK:001:01 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:01 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(3), 0))
+ cerr << "TEST:LOCK:001:01 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:001:02 Test overlapping locks within same process (partial overlap A)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:001:02 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:02 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:001:02 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:001:03 Test overlapping locks within same process (partial overlap B)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(25), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:001:03 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:03 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(25), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:001:03 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:001:04 Test non-overlapping locks with same process\n";
+ cerr <<
+ "TEST:LOCK:001:04 PASS (iff Setup succeeded)\n";
+
+ } SYNC_END_PARENT;
+
+ SYNC_BEGIN_CHILD {
+ logfile << "--Test using child process--\n";
+ cerr <<
+ "TEST:LOCK:001:05 Test overlapping locks with different process (complete overlap)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(3), 0)) {
+ cerr << "TEST:LOCK:001:05 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:05 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(3), 0))
+ cerr << "TEST:LOCK:001:05 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:001:06 Test overlapping locks with different process (partial overlap A)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:001:06 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:06 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(15), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:001:06 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:001:07 Test overlapping locks with different process (partial overlap B)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(25), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:001:07 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:07 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(25), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:001:07 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:001:08 Test non-overlapping lock with different process\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(50), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:001:08 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:001:08 PASS\n";
+ /* leave lock held */
+ }
+ } SYNC_END_CHILD;
+
+ return 0;
+ }
+
+ /* by now we have the following exclusive locks:
+
+ pages 10-19 : exclusive by parent
+ pages 30-39 : exclusive by parent
+ pages 50-59 : exclusive by child
+ pages 0-9 : free-for-all
+ pages 20-29 : free-for-all
+ pages 40-49 : free-for-all
+ pages 60-61 : free-for-all
+ page 62 : exclusive by parent
+ pages 63-255: free-for-all
+ pages 256- : non-existent
+ */
+
+
+ int testint_lock_excl_rw_beof(void)
+ {
+ DWORD * read_buf;
+ DWORD * write_buf;
+ DWORD nbytes;
+
+ /* each of read_buf and write_buf are 10 pages long */
+ read_buf = (DWORD *) malloc(sizeof(DWORD) * 10240);
+ assert(read_buf != NULL);
+
+ write_buf = (DWORD *) malloc(sizeof(DWORD) * 10240);
+ assert(write_buf != NULL);
+
+ SYNC_BEGIN_PARENT {
+ logfile << "----Test writes and reads on exclusive locks----\n";
+ logfile << "--Read tests--\n";
+
+ cerr << "TEST:LOCK:002 Read tests in the presence of locks\n";
+
+ cerr << "TEST:LOCK:002:01 Read in unlocked area\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(42), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(42), NULL, FILE_BEGIN) != PAGE_BEGIN(42)) {
+ cerr << "TEST:LOCK:002:01 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:01 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:01 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:002:02 Read in partially locked area (A)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(27), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(27), NULL, FILE_BEGIN) != PAGE_BEGIN(27)) {
+ cerr << "TEST:LOCK:002:02 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:02 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:02 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:002:03 Read in locked area\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(32), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(32), NULL, FILE_BEGIN) != PAGE_BEGIN(32)) {
+ cerr << "TEST:LOCK:002:03 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:03 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:03 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:002:04 Read in partially locked area (B)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(37), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(37), NULL, FILE_BEGIN) != PAGE_BEGIN(37)) {
+ cerr << "TEST:LOCK:002:04 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:04 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:04 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:002:05 Read in partially unowned area (A)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(47), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(47), NULL, FILE_BEGIN) != PAGE_BEGIN(47)) {
+ cerr << "TEST:LOCK:002:05 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:05 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:05 ***FAILED***\n";
+ }
+
+ cerr << "TEST:LOCK:002:06 Read in fully unowned area\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(52), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(52), NULL, FILE_BEGIN) != PAGE_BEGIN(52)) {
+ cerr << "TEST:LOCK:002:06 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:06 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:06 ***FAILED***\n";
+ }
+
+ cerr << "TEST:LOCK:002:07 Read in partially unowned area (B)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(56), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(56), NULL, FILE_BEGIN) != PAGE_BEGIN(56)) {
+ cerr << "TEST:LOCK:002:07 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:07 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:07 ***FAILED***\n";
+ }
+
+ cerr << "TEST:LOCK:002:08 Read in partially unowned area (C)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(59), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(59), NULL, FILE_BEGIN) != PAGE_BEGIN(59)) {
+ cerr << "TEST:LOCK:002:08 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!ReadFile(h_file_base, (LPVOID) read_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:002:08 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:002:08 ***FAILED***\n";
+ }
+ } SYNC_END_PARENT;
+
+ SYNC_BEGIN_CHILD {
+ int i;
+ int j;
+
+ for(j=0; j<10; j++) {
+ for(i=0; i<1024; i++) {
+ write_buf[j*1024 + i] = 0x0d0d0d0d;
+ }
+ }
+
+ cerr << "TEST:LOCK:003 Write tests in the presence of locks\n";
+ logfile << "--Write tests--\n";
+
+ cerr << "TEST:LOCK:003:01 Write in unlocked area\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(42), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(42), NULL, FILE_BEGIN) != PAGE_BEGIN(42)) {
+ cerr << "TEST:LOCK:003:01 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:01 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:01 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:003:02 Write in partially owned area (A)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(47), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(47), NULL, FILE_BEGIN) != PAGE_BEGIN(47)) {
+ cerr << "TEST:LOCK:003:02 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:02 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:02 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:003:03 Write in fully owned area\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(52), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(52), NULL, FILE_BEGIN) != PAGE_BEGIN(52)) {
+ cerr << "TEST:LOCK:003:03 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:03 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:03 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:003:04 Write in partially owned area (B)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(56), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(56), NULL, FILE_BEGIN) != PAGE_BEGIN(56)) {
+ cerr << "TEST:LOCK:003:04 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:04 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:04 PASS\n";
+ }
+
+ cerr << "TEST:LOCK:003:05 Write in partially unowned area (A)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(27), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(27), NULL, FILE_BEGIN) != PAGE_BEGIN(27)) {
+ cerr << "TEST:LOCK:003:05 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:05 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:05 ***FAILED***\n";
+ }
+
+ cerr << "TEST:LOCK:003:06 Write in fully unowned area\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(32), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(32), NULL, FILE_BEGIN) != PAGE_BEGIN(32)) {
+ cerr << "TEST:LOCK:003:06 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:06 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:06 ***FAILED***\n";
+ }
+
+ cerr << "TEST:LOCK:003:07 Write in partially unowned area (B)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(37), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(37), NULL, FILE_BEGIN) != PAGE_BEGIN(37)) {
+ cerr << "TEST:LOCK:003:07 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:07 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:07 ***FAILED***\n";
+ }
+
+ cerr << "TEST:LOCK:003:08 Write in partially unowned area (C)\n";
+
+ logfile << "SetFilePointer(h_file_base, PAGE_BEGIN(59), NULL, FILE_BEGIN)\n";
+ if(SetFilePointer(h_file_base, PAGE_BEGIN(59), NULL, FILE_BEGIN) != PAGE_BEGIN(59)) {
+ cerr << "TEST:LOCK:003:08 ERROR** Setup Failed!\n";
+ logfile << "**ERROR** Last error=" << GetLastError() << "\n";
+ }
+ if(!WriteFile(h_file_base, (LPCVOID) write_buf, PAGE_LEN(5), &nbytes, NULL)) {
+ cerr << "TEST:LOCK:003:08 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:003:08 ***FAILED***\n";
+ }
+
+ FlushFileBuffers(h_file_base);
+
+ } SYNC_END_CHILD;
+
+ free(write_buf);
+ free(read_buf);
+
+ return 0;
+ }
+
+ int testint_lock_excl_eeof(void)
+ {
+ /* at this point, test_lock_prep() has already run, and the length
+ of h_file_base is set at 1M */
+ SYNC_BEGIN_PARENT {
+ logfile << "----Begin Lock Test Exclusive EEOF----\n";
+
+ cerr << "TEST:LOCK:004 Exclusive byte-range locks above EOF\n";
+
+ /* parent takes three non-overlapping locks */
+ logfile << "LockFile(h_file_base, PAGE_BEGIN(256+10), 0, PAGE_LEN(10), 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+10), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:004 ***ERROR*** Setup failed!\n";
+ }
+
+ logfile << "LockFile(h_file_base, PAGE_BEGIN(256+30), 0, 4096 * 10, 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+30), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:004 ***ERROR*** Setup failed!\n";
+ }
+
+ logfile << "LockFile(h_file_base, PAGE_BEGIN(256+62), 0, 4096 * 1, 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+62), 0, PAGE_LEN(1), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:004 ***ERROR*** Setup failed!\n";
+ }
+ } SYNC_END_PARENT;
+
+ SYNC_BEGIN_PARENT {
+ logfile << "--Test using same handle, same process--\n";
+ cerr <<
+ "TEST:LOCK:004:01 Test overlapping locks within same process (complete overlap)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(3), 0)) {
+ cerr << "TEST:LOCK:004:01 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:01 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(3), 0))
+ cerr << "TEST:LOCK:004:01 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:004:02 Test overlapping locks within same process (partial overlap A)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:004:02 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:02 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:004:02 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:004:03 Test overlapping locks within same process (partial overlap B)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+25), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:004:03 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:03 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+25), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:004:03 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:004:04 Test non-overlapping locks with same process\n";
+ cerr <<
+ "TEST:LOCK:004:04 PASS (iff Setup succeeded)\n";
+
+ } SYNC_END_PARENT;
+
+ SYNC_BEGIN_CHILD {
+ logfile << "--Test using child process--\n";
+ cerr <<
+ "TEST:LOCK:004:05 Test overlapping locks with different process (complete overlap)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(3), 0)) {
+ cerr << "TEST:LOCK:004:05 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:05 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(3), 0))
+ cerr << "TEST:LOCK:004:05 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:004:06 Test overlapping locks with different process (partial overlap A)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:004:06 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:06 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+15), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:004:06 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:004:07 Test overlapping locks with different process (partial overlap B)\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+25), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:004:07 PASS (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:07 ***FAILED***\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+25), 0, PAGE_LEN(10), 0))
+ cerr << "TEST:LOCK:004:07 ****BADNESS**** UnlockFile failed with " << GetLastError() << "\n";
+ }
+
+ cerr <<
+ "TEST:LOCK:004:08 Test non-overlapping lock with different process\n";
+
+ if(!LockFile(h_file_base, PAGE_BEGIN(256+50), 0, PAGE_LEN(10), 0)) {
+ cerr << "TEST:LOCK:004:08 ***FAILED*** (LastError=" << GetLastError() << ")\n";
+ } else {
+ cerr << "TEST:LOCK:004:08 PASS\n";
+ /* leave lock held */
+ }
+ } SYNC_END_CHILD;
+
+ return 0;
+ }
+
+ /* not necessary */
+ int testint_lock_excl_rw_eeof(void)
+ {
+ return 0;
+ }
+
+ /* unlock all the remaining locks */
+ int testint_unlock(void)
+ {
+ SYNC_BEGIN_PARENT {
+ logfile << "----Begin Unlock test----\n";
+
+ cerr << "TEST:LOCK:005 Unlocks\n";
+
+ cerr << "TEST:LOCK:005:01 Unlock parent locks\n";
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(10), 0, PAGE_LEN(10), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(10), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:01 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:01 PASS\n";
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(30), 0, PAGE_LEN(10), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(30), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:02 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:02 PASS\n";
+
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(62), 0, PAGE_LEN(1), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(62), 0, PAGE_LEN(1), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:03 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:03 PASS\n";
+
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(256+10), 0, PAGE_LEN(10), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+10), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:04 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:04 PASS\n";
+
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(256+30), 0, PAGE_LEN(10), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+30), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:05 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:05 PASS\n";
+
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(256+62), 0, PAGE_LEN(1), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+62), 0, PAGE_LEN(1), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:06 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:06 PASS\n";
+
+ } SYNC_END_PARENT;
+
+ SYNC_BEGIN_CHILD {
+ cerr << "TEST:LOCK:005:02 Unlock parent locks\n";
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(50), 0, PAGE_LEN(10), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(50), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:07 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:07 PASS\n";
+
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(256+50), 0, PAGE_LEN(10), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(256+50), 0, PAGE_LEN(10), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:08 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:08 PASS\n";
+
+ } SYNC_END_CHILD;
+
+ SYNC_BEGIN_PARENT {
+ cerr << "TEST:LOCK:006 Check if unlocked really worked\n";
+
+ logfile << "LockFile(h_file_base, PAGE_BEGIN(0), 0, PAGE_LEN(256+60), 0)\n";
+ if(!LockFile(h_file_base, PAGE_BEGIN(0), 0, PAGE_LEN(256+60), 0)) {
+ logfile << "ERROR**: LockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:006:01 ***ERROR*** Lock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:006:01 PASS\n";
+
+ logfile << "UnlockFile(h_file_base, PAGE_BEGIN(0), 0, PAGE_LEN(256+60), 0)\n";
+ if(!UnlockFile(h_file_base, PAGE_BEGIN(0), 0, PAGE_LEN(256+60), 0)) {
+ logfile << "ERROR**: UnockFile Failed (last error=" << GetLastError() << ")\n";
+ cerr << "TEST:LOCK:005:08 ***ERROR*** Unlock Failed! Error=" << GetLastError() << "\n";
+ } else
+ cerr << "TEST:LOCK:005:08 PASS\n";
+ } SYNC_END_PARENT;
+
+ return 0;
+ }
+
+ int testint_lock_escalation(void)
+ {
+ OVERLAPPED ov;
+
+ ZeroMemory(&ov, sizeof(ov));
+
+ SYNC_BEGIN_PARENT {
+ cerr << "TEST:LOCK:006 Lock Escalation\n";
+ logfile << "-----------Lock escalation------\n";
+
+ ov.Offset = PAGE_BEGIN(10);
+ ov.OffsetHigh = 0;
+ if(!LockFileEx(h_file_base, LOCKFILE_FAIL_IMMEDIATELY, 0, PAGE_LEN(10), 0, &ov)) {
+ logfile << "ERROR**: Last error = " << GetLastError() << "\n";
+ cerr << "TEST:LOCK:006:01 ***FAILED*** Error=" << GetLastError() << "\n";
+ } else {
+ cerr << "TEST:LOCK:006:01 PASS\n";
+ }
+
+ ov.Offset = PAGE_BEGIN(30);
+ ov.OffsetHigh = 0;
+ if(!LockFileEx(h_file_base, LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY, 0, PAGE_LEN(10), 0, &ov)) {
+ logfile << "ERROR**: Last error = " << GetLastError() << "\n";
+ cerr << "TEST:LOCK:006:02 ***FAILED*** Error=" << GetLastError() << "\n";
+ } else {
+ cerr << "TEST:LOCK:006:02 PASS\n";
+ }
+
+ ov.Offset = PAGE_BEGIN(50);
+ ov.OffsetHigh = 0;
+ if(!LockFileEx(h_file_base, LOCKFILE_FAIL_IMMEDIATELY, 0, PAGE_LEN(10), 0, &ov)) {
+ logfile << "ERROR**: Last error = " << GetLastError() << "\n";
+ cerr << "TEST:LOCK:006:03 ***FAILED*** Error=" << GetLastError() << "\n";
+ } else {
+ cerr << "TEST:LOCK:006:03 PASS\n";
+ }
+
+ ov.Offset = PAGE_BEGIN(50);
+ ov.OffsetHigh = 0;
+ if(!UnlockFileEx(h_file_base, 0, PAGE_LEN(10), 0, &ov)) {
+ logfile << "ERROR**: Last error = " << GetLastError() << "\n";
+ cerr << "TEST:LOCK:006:04 ***FAILED*** Error=" << GetLastError() << "\n";
+ } else {
+ cerr << "TEST:LOCK:006:04 PASS\n";
+ }
+
+ ov.Offset = PAGE_BEGIN(30);
+ ov.OffsetHigh = 0;
+ if(!UnlockFileEx(h_file_base, 0, PAGE_LEN(10), 0, &ov)) {
+ logfile << "ERROR**: Last error = " << GetLastError() << "\n";
+ cerr << "TEST:LOCK:006:05 ***FAILED*** Error=" << GetLastError() << "\n";
+ } else {
+ cerr << "TEST:LOCK:006:05 PASS\n";
+ }
+
+ ov.Offset = PAGE_BEGIN(10);
+ ov.OffsetHigh = 0;
+ if(!UnlockFileEx(h_file_base, 0, PAGE_LEN(10), 0, &ov)) {
+ logfile << "ERROR**: Last error = " << GetLastError() << "\n";
+ cerr << "TEST:LOCK:006:06 ***FAILED*** Error=" << GetLastError() << "\n";
+ } else {
+ cerr << "TEST:LOCK:006:06 PASS\n";
+ }
+
+ } SYNC_END_PARENT;
+
+ return 0;
+ }
+
+ int end_tests()
+ {
+ if(h_file_base != NULL) {
+ logfile << "Closing h_file_base\n";
+ CloseHandle(h_file_base);
+ }
+ if(h_file_aux != NULL) {
+ logfile << "Closing h_file_aux\n";
+ CloseHandle(h_file_aux);
+ }
+
+ logfile << "--------Ending tests\n";
+
+ return 0;
+ }
Index: openafs/src/WINNT/tests/winflock/winflock.h
diff -c /dev/null openafs/src/WINNT/tests/winflock/winflock.h:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/winflock.h Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,69 ----
+ #pragma once
+
+ #include
+ #include
+ #include
+ #include
+
+ #include
+
+ using namespace std;
+
+ extern _TCHAR test_dir[MAX_PATH];
+ extern BOOL isChild;
+ extern HANDLE h_child;
+ extern HANDLE event_child;
+ extern HANDLE event_parent;
+ extern HANDLE mutex_logfile;
+
+ #define logfile cout
+
+ void _begin_log(void);
+ void _end_log(void);
+ void _sync_begin_parent(void);
+ void _sync_end_parent(void);
+ void _sync_begin_child(void);
+ void _sync_end_child(void);
+
+ #define BEGINLOG() _begin_log()
+ #define ENDLOG() _end_log()
+
+ /*
+ SYNC_BEGIN_PARENT {
+ ... parent code here ...
+ } SYNC_END_PARENT;
+ */
+
+ #define SYNC_BEGIN_PARENT \
+ _sync_begin_parent(); \
+ if(!isChild)
+
+ #define SYNC_END_PARENT \
+ _sync_end_parent()
+
+ /*
+ SYNC_BEGIN_CHILD {
+ ... child code here ...
+ } SYNC_END_CHILD;
+ */
+ #define SYNC_BEGIN_CHILD \
+ _sync_begin_child(); \
+ if(isChild)
+
+ #define SYNC_END_CHILD \
+ _sync_end_child()
+
+ int begin_tests(void);
+
+ int test_create(void);
+ int test_lock_prep(void);
+ int testint_lock_excl_beof(void);
+ int testint_lock_excl_rw_beof(void);
+ int testint_lock_excl_eeof(void);
+ int testint_unlock(void);
+ int testint_lock_escalation(void);
+
+ int end_tests(void);
+
+ #define PAGE_BEGIN(x) ((x) * 4096)
+ #define PAGE_LEN(x) ((x) * 4096)
\ No newline at end of file
Index: openafs/src/WINNT/tests/winflock/winflock.sln
diff -c /dev/null openafs/src/WINNT/tests/winflock/winflock.sln:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/winflock.sln Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,21 ----
+ Microsoft Visual Studio Solution File, Format Version 8.00
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winflock", "winflock.vcproj", "{60F4E436-B15A-48B3-A627-7C62A6C97C03}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+ EndProject
+ Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {60F4E436-B15A-48B3-A627-7C62A6C97C03}.Debug.ActiveCfg = Debug|Win32
+ {60F4E436-B15A-48B3-A627-7C62A6C97C03}.Debug.Build.0 = Debug|Win32
+ {60F4E436-B15A-48B3-A627-7C62A6C97C03}.Release.ActiveCfg = Release|Win32
+ {60F4E436-B15A-48B3-A627-7C62A6C97C03}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+ EndGlobal
Index: openafs/src/WINNT/tests/winflock/winflock.vcproj
diff -c /dev/null openafs/src/WINNT/tests/winflock/winflock.vcproj:1.1.2.2
*** /dev/null Thu Dec 1 02:48:02 2005
--- openafs/src/WINNT/tests/winflock/winflock.vcproj Mon Oct 31 17:17:02 2005
***************
*** 0 ****
--- 1,144 ----
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openafs/src/afs/afs.h
diff -c openafs/src/afs/afs.h:1.48.2.24 openafs/src/afs/afs.h:1.48.2.25
*** openafs/src/afs/afs.h:1.48.2.24 Thu Oct 13 14:23:36 2005
--- openafs/src/afs/afs.h Fri Nov 18 23:35:39 2005
***************
*** 1096,1101 ****
--- 1096,1103 ----
#define DO_STATS 1 /* bits used by FindVCache */
#define DO_VLRU 2
+ #define IS_SLOCK 4
+ #define IS_WLOCK 8
/* values for flag param of afs_CheckVolumeNames */
#define AFS_VOLCHECK_EXPIRED 0x1 /* volumes whose callbacks have expired */
Index: openafs/src/afs/afs_vcache.c
diff -c openafs/src/afs/afs_vcache.c:1.65.2.30 openafs/src/afs/afs_vcache.c:1.65.2.32
*** openafs/src/afs/afs_vcache.c:1.65.2.30 Fri Oct 14 22:33:09 2005
--- openafs/src/afs/afs_vcache.c Thu Dec 1 00:10:55 2005
***************
*** 39,45 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.30 2005/10/15 02:33:09 shadow Exp $");
#include "afs/sysincludes.h" /*Standard vendor system headers */
#include "afsincludes.h" /*AFS-based standard headers */
--- 39,45 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.32 2005/12/01 05:10:55 shadow Exp $");
#include "afs/sysincludes.h" /*Standard vendor system headers */
#include "afsincludes.h" /*AFS-based standard headers */
***************
*** 877,886 ****
* request is lost */
i = VCHash(afid);
tvc->hnext = afs_vhashT[i];
afs_vhashT[i] = tvc;
! QAdd(&afs_vhashTV[i], &tvc->vhashq);
if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) {
refpanic("NewVCache VLRU inconsistent");
--- 877,887 ----
* request is lost */
i = VCHash(afid);
+ j = VCHashV(afid);
tvc->hnext = afs_vhashT[i];
afs_vhashT[i] = tvc;
! QAdd(&afs_vhashTV[j], &tvc->vhashq);
if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) {
refpanic("NewVCache VLRU inconsistent");
***************
*** 1671,1677 ****
ObtainSharedLock(&afs_xvcache, 5);
! tvc = afs_FindVCache(afid, &retry, DO_STATS | DO_VLRU);
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
--- 1672,1678 ----
ObtainSharedLock(&afs_xvcache, 5);
! tvc = afs_FindVCache(afid, &retry, DO_STATS | DO_VLRU | IS_SLOCK);
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
***************
*** 1911,1917 ****
#endif
ObtainSharedLock(&afs_xvcache, 6);
! tvc = afs_FindVCache(&nfid, &retry, DO_VLRU /* no xstats now */ );
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
--- 1912,1918 ----
#endif
ObtainSharedLock(&afs_xvcache, 6);
! tvc = afs_FindVCache(&nfid, &retry, DO_VLRU | IS_SLOCK/* no xstats now */ );
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
***************
*** 2374,2380 ****
loop:
ObtainSharedLock(&afs_xvcache, 8);
! tvc = afs_FindVCache(afid, &retry, DO_VLRU /* no stats */ );
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
--- 2375,2381 ----
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);
***************
*** 2509,2514 ****
--- 2510,2537 ----
#endif
} /*afs_PutVCache */
+
+ static void findvc_sleep(struct vcache *avc, int flag) {
+ if (flag & IS_SLOCK) {
+ ReleaseSharedLock(&afs_xvcache);
+ } else {
+ if (flag & IS_WLOCK) {
+ ReleaseWriteLock(&afs_xvcache);
+ } else {
+ ReleaseReadLock(&afs_xvcache);
+ }
+ }
+ afs_osi_Sleep(&avc->states);
+ if (flag & IS_SLOCK) {
+ ObtainSharedLock(&afs_xvcache, 341);
+ } else {
+ if (flag & IS_WLOCK) {
+ ObtainWriteLock(&afs_xvcache, 343);
+ } else {
+ ObtainReadLock(&afs_xvcache);
+ }
+ }
+ }
/*
* afs_FindVCache
*
***************
*** 2542,2558 ****
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
if (FidMatches(afid, tvc)) {
if (tvc->states & CVInit) {
! int lock;
! lock = CheckLock(&afs_xvcache);
! if (lock > 0)
! ReleaseReadLock(&afs_xvcache);
! else
! ReleaseSharedLock(&afs_xvcache);
! afs_osi_Sleep(&tvc->states);
! if (lock > 0)
! ObtainReadLock(&afs_xvcache);
! else
! ObtainSharedLock(&afs_xvcache, 341);
goto findloop;
}
#ifdef AFS_OSF_ENV
--- 2565,2571 ----
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
if (FidMatches(afid, tvc)) {
if (tvc->states & CVInit) {
! findvc_sleep(tvc, flag);
goto findloop;
}
#ifdef AFS_OSF_ENV
***************
*** 2567,2583 ****
#ifdef AFS_DARWIN80_ENV
int vg;
if (tvc->states & CDeadVnode) {
! int lock;
! lock = CheckLock(&afs_xvcache);
! if (lock > 0)
! ReleaseReadLock(&afs_xvcache);
! else
! ReleaseSharedLock(&afs_xvcache);
! afs_osi_Sleep(&tvc->states);
! if (lock > 0)
! ObtainReadLock(&afs_xvcache);
! else
! ObtainSharedLock(&afs_xvcache, 341);
goto findloop;
}
AFS_GUNLOCK();
--- 2580,2586 ----
#ifdef AFS_DARWIN80_ENV
int vg;
if (tvc->states & CDeadVnode) {
! findvc_sleep(tvc, flag);
goto findloop;
}
AFS_GUNLOCK();
Index: openafs/src/afs/DARWIN/osi_file.c
diff -c openafs/src/afs/DARWIN/osi_file.c:1.8.2.1 openafs/src/afs/DARWIN/osi_file.c:1.8.2.3
*** openafs/src/afs/DARWIN/osi_file.c:1.8.2.1 Wed Oct 5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_file.c Thu Dec 1 02:37:21 2005
***************
*** 11,17 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8.2.1 2005/10/05 05:58:29 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 11,17 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8.2.3 2005/12/01 07:37:21 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 63,73 ****
}
ino_t
- #ifdef AFS_DARWIN80_ENV
VnodeToIno(vnode_t avp)
- #else
- VnodeToIno(vnode_t * avp)
- #endif
{
unsigned long ret;
--- 63,69 ----
***************
*** 104,114 ****
dev_t
- #ifdef AFS_DARWIN80_ENV
VnodeToDev(vnode_t avp)
- #else
- VnodeToDev(vnode_t * avp)
- #endif
{
#ifndef AFS_DARWIN80_ENV
if (afs_CacheFSType == AFS_APPL_UFS_CACHE) {
--- 100,106 ----
***************
*** 116,122 ****
return ip->i_dev;
} else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) {
#endif
! #if defined(AFS_DARWIN80_ENV) || !defined(VTOH)
struct vattr va;
VATTR_INIT(&va);
VATTR_WANTED(&va, va_fsid);
--- 108,114 ----
return ip->i_dev;
} else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) {
#endif
! #if defined(AFS_DARWIN80_ENV)
struct vattr va;
VATTR_INIT(&va);
VATTR_WANTED(&va, va_fsid);
Index: openafs/src/afs/DARWIN/osi_groups.c
diff -c openafs/src/afs/DARWIN/osi_groups.c:1.5.2.1 openafs/src/afs/DARWIN/osi_groups.c:1.5.2.2
*** openafs/src/afs/DARWIN/osi_groups.c:1.5.2.1 Wed Oct 5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_groups.c Tue Nov 29 00:02:24 2005
***************
*** 18,24 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_groups.c,v 1.5.2.1 2005/10/05 05:58:29 shadow Exp $");
/* We should be doing something better anyway */
#ifdef AFS_DARWIN80_ENV
int
--- 18,24 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_groups.c,v 1.5.2.2 2005/11/29 05:02:24 shadow Exp $");
/* We should be doing something better anyway */
#ifdef AFS_DARWIN80_ENV
int
***************
*** 86,92 ****
return code;
}
!
gid_t gidset[NGROUPS];
int ngroups, code;
int j;
--- 86,99 ----
return code;
}
! int
! setpag(proc, cred, pagvalue, newpag, change_parent)
! struct proc *proc;
! struct ucred **cred;
! afs_uint32 pagvalue;
! afs_uint32 *newpag;
! afs_uint32 change_parent;
! {
gid_t gidset[NGROUPS];
int ngroups, code;
int j;
Index: openafs/src/afs/DARWIN/osi_machdep.h
diff -c openafs/src/afs/DARWIN/osi_machdep.h:1.3.2.4 openafs/src/afs/DARWIN/osi_machdep.h:1.3.2.7
*** openafs/src/afs/DARWIN/osi_machdep.h:1.3.2.4 Wed Oct 5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_machdep.h Thu Dec 1 02:37:21 2005
***************
*** 203,210 ****
#define AFS_APPL_UFS_CACHE 1
#define AFS_APPL_HFS_CACHE 2
! extern ino_t VnodeToIno(struct vnode * vp);
! extern dev_t VnodeToDev(struct vnode * vp);
extern int igetinode(mount_t vfsp, dev_t dev , ino_t inode, vnode_t *vpp,
struct vattr *va, int *perror);
--- 203,210 ----
#define AFS_APPL_UFS_CACHE 1
#define AFS_APPL_HFS_CACHE 2
! extern ino_t VnodeToIno(vnode_t avp);
! extern dev_t VnodeToDev(vnode_t vp);
extern int igetinode(mount_t vfsp, dev_t dev , ino_t inode, vnode_t *vpp,
struct vattr *va, int *perror);
***************
*** 219,224 ****
--- 219,236 ----
#define uprintf printf
#endif
+ #ifndef AFS_DARWIN80_ENV
+ #define ifaddr_address_family(x) (x)->ifa_addr->sa_family
+ #define ifaddr_address(x, y, z) memcpy(y, (x)->ifa_addr, z)
+ #define ifaddr_netmask(x, y, z) memcpy(y, (x)->ifa_netmask, z)
+ #define ifaddr_dstaddress(x, y, z) memcpy(y, (x)->ifa_dstaddr, z)
+ #define ifaddr_ifnet(x) (x?(x)->ifa_ifp:0)
+ #define ifnet_flags(x) (x?(x)->if_flags:0)
+ #define ifnet_metric(x) (x?(x)->if_data.ifi_metric:0)
+ /*#define ifnet_mtu(x) (x)->if_mtu*/
+ #define ifaddr_withnet(x) ifa_ifwithnet(x)
+ #endif
+
#endif /* KERNEL */
#endif /* _OSI_MACHDEP_H_ */
Index: openafs/src/afs/DARWIN/osi_module.c
diff -c openafs/src/afs/DARWIN/osi_module.c:1.10.2.2 openafs/src/afs/DARWIN/osi_module.c:1.10.2.3
*** openafs/src/afs/DARWIN/osi_module.c:1.10.2.2 Wed Oct 5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_module.c Fri Nov 18 23:35:40 2005
***************
*** 2,8 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_module.c,v 1.10.2.2 2005/10/05 05:58:29 shadow Exp $");
#include "afs/sysincludes.h"
#include "afsincludes.h"
--- 2,8 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_module.c,v 1.10.2.3 2005/11/19 04:35:40 shadow Exp $");
#include "afs/sysincludes.h"
#include "afsincludes.h"
***************
*** 134,138 ****
return KERN_SUCCESS;
}
! KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, "1.3.82", afs_modload,
afs_modunload)
--- 134,138 ----
return KERN_SUCCESS;
}
! KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, VERSION, afs_modload,
afs_modunload)
Index: openafs/src/afs/DARWIN/osi_vfsops.c
diff -c openafs/src/afs/DARWIN/osi_vfsops.c:1.11.2.2 openafs/src/afs/DARWIN/osi_vfsops.c:1.11.2.3
*** openafs/src/afs/DARWIN/osi_vfsops.c:1.11.2.2 Wed Oct 5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_vfsops.c Tue Nov 29 00:02:24 2005
***************
*** 5,11 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.11.2.2 2005/10/05 05:58:29 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
--- 5,11 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.11.2.3 2005/11/29 05:02:24 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
***************
*** 84,90 ****
vfs_context_t ctx;
#else
int
! afs_mount(mp, path, data, ndp, p)
register struct mount *mp;
char *path;
caddr_t data;
--- 84,90 ----
vfs_context_t ctx;
#else
int
! afs_mount(mp, path, data, ndp, ctx)
register struct mount *mp;
char *path;
caddr_t data;
***************
*** 252,261 ****
#else
struct proc *p = current_proc();
struct ucred _cr;
! struct ucred *cr =&_cr;
pcred_readlock(p);
! cr = *p->p_cred->pc_ucred;
pcred_unlock(p);
#endif
AFS_GLOCK();
--- 252,261 ----
#else
struct proc *p = current_proc();
struct ucred _cr;
! struct ucred *cr = &_cr;
pcred_readlock(p);
! _cr = *p->p_cred->pc_ucred;
pcred_unlock(p);
#endif
AFS_GLOCK();
Index: openafs/src/afs/DARWIN/osi_vnodeops.c
diff -c openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.5 openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.8
*** openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.5 Wed Oct 5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_vnodeops.c Tue Nov 29 01:54:46 2005
***************
*** 5,11 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.5 2005/10/05 05:58:29 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
--- 5,11 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.8 2005/11/29 06:54:46 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
***************
*** 574,579 ****
--- 574,583 ----
bits |= PRSFS_INSERT;
if (ap->a_action & KAUTH_VNODE_DELETE_CHILD)
bits |= PRSFS_DELETE;
+ 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;
} else {
if (ap->a_action & KAUTH_VNODE_READ_DATA)
bits |= PRSFS_READ;
***************
*** 581,589 ****
bits |= PRSFS_WRITE;
if (ap->a_action & KAUTH_VNODE_EXECUTE)
bits |= PRSFS_READ; /* and mode bits.... */
}
- if (ap->a_action & KAUTH_VNODE_READ_ATTRIBUTES)
- bits |= PRSFS_READ;
if (ap->a_action & KAUTH_VNODE_WRITE_ATTRIBUTES)
bits |= PRSFS_WRITE;
#if 0 /* no extended attributes */
--- 585,595 ----
bits |= PRSFS_WRITE;
if (ap->a_action & KAUTH_VNODE_EXECUTE)
bits |= PRSFS_READ; /* and mode bits.... */
+ if (ap->a_action & KAUTH_VNODE_READ_ATTRIBUTES)
+ bits |= PRSFS_READ;
+ if (ap->a_action & KAUTH_VNODE_READ_SECURITY) /* mode bits/gid, not afs acl */
+ bits |= PRSFS_READ;
}
if (ap->a_action & KAUTH_VNODE_WRITE_ATTRIBUTES)
bits |= PRSFS_WRITE;
#if 0 /* no extended attributes */
***************
*** 592,599 ****
if (ap->a_action & KAUTH_VNODE_WRITE_EXTATTRIBUTES)
bits |= PRSFS_WRITE;
#endif
- if (ap->a_action & KAUTH_VNODE_READ_SECURITY) /* mode bits/gid, not afs acl */
- bits |= PRSFS_READ;
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 */
--- 598,603 ----
***************
*** 1585,1591 ****
register struct vnode *vp = ap->a_vp;
struct vcache *tvc = VTOAFS(vp);
#ifndef AFS_DARWIN80_ENV
! if (prtactive && vnode_isinuse(vp, 0) != 0)
vprint("afs_vop_inactive(): pushing active", vp);
#endif
if (tvc) {
--- 1589,1595 ----
register struct vnode *vp = ap->a_vp;
struct vcache *tvc = VTOAFS(vp);
#ifndef AFS_DARWIN80_ENV
! if (prtactive && vp->v_usecount != 0)
vprint("afs_vop_inactive(): pushing active", vp);
#endif
if (tvc) {
***************
*** 1616,1623 ****
AFS_GLOCK();
ObtainWriteLock(&afs_xvcache, 335);
error = afs_FlushVCache(tvc, &sl); /* toss our stuff from vnode */
! if (tvc->states & (CVInit | CDeadVnode)) {
! tvc->states &= ~(CVInit | CDeadVnode);
afs_osi_Wakeup(&tvc->states);
}
ReleaseWriteLock(&afs_xvcache);
--- 1620,1635 ----
AFS_GLOCK();
ObtainWriteLock(&afs_xvcache, 335);
error = afs_FlushVCache(tvc, &sl); /* toss our stuff from vnode */
! if (tvc->states & (CVInit
! #ifdef AFS_DARWIN80_ENV
! | CDeadVnode
! #endif
! )) {
! tvc->states &= ~(CVInit
! #ifdef AFS_DARWIN80_ENV
! | CDeadVnode
! #endif
! );
afs_osi_Wakeup(&tvc->states);
}
ReleaseWriteLock(&afs_xvcache);
Index: openafs/src/afs/HPUX/osi_inode.c
diff -c openafs/src/afs/HPUX/osi_inode.c:1.8 openafs/src/afs/HPUX/osi_inode.c:1.8.2.1
*** openafs/src/afs/HPUX/osi_inode.c:1.8 Wed Jul 28 23:13:47 2004
--- openafs/src/afs/HPUX/osi_inode.c Mon Nov 7 18:43:32 2005
***************
*** 17,23 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/HPUX/osi_inode.c,v 1.8 2004/07/29 03:13:47 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 17,23 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/HPUX/osi_inode.c,v 1.8.2.1 2005/11/07 23:43:32 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 128,133 ****
--- 128,134 ----
int dummy;
extern struct fileops vnodefops;
register int code;
+ int fd;
AFS_STATCNT(afs_syscall_iopen);
***************
*** 144,149 ****
--- 145,153 ----
iput(ip);
goto out;
}
+ #ifdef AFS_HPUX1111_ENV
+ fd = u.u_r.r_val1;
+ #endif
iunlock(ip);
fp->f_ops = &vnodefops;
***************
*** 175,181 ****
* called by falloc(), which is called above.
*/
if (is_multithreaded(u.u_procp)) {
! int fd = (int)u.u_r.r_val1;
putf(fd);
}
--- 179,187 ----
* called by falloc(), which is called above.
*/
if (is_multithreaded(u.u_procp)) {
! #ifndef AFS_HPUX1111_ENV
! fd = (int)u.u_r.r_val1;
! #endif
putf(fd);
}
Index: openafs/src/afs/LINUX/osi_module.c
diff -c openafs/src/afs/LINUX/osi_module.c:1.52.2.19 openafs/src/afs/LINUX/osi_module.c:1.52.2.20
*** openafs/src/afs/LINUX/osi_module.c:1.52.2.19 Mon Jul 11 15:29:56 2005
--- openafs/src/afs/LINUX/osi_module.c Tue Nov 1 19:28:17 2005
***************
*** 15,21 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.19 2005/07/11 19:29:56 shadow Exp $");
#include /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
--- 15,21 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.20 2005/11/02 00:28:17 shadow Exp $");
#include /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
***************
*** 24,30 ****
#include "h/mm.h"
#ifdef AFS_AMD64_LINUX20_ENV
! #include "../asm/ia32_unistd.h"
#endif
#include
--- 24,30 ----
#include "h/mm.h"
#ifdef AFS_AMD64_LINUX20_ENV
! #include
#endif
#include
Index: openafs/src/afs/LINUX/osi_syscall.c
diff -c openafs/src/afs/LINUX/osi_syscall.c:1.1.2.6 openafs/src/afs/LINUX/osi_syscall.c:1.1.2.7
*** openafs/src/afs/LINUX/osi_syscall.c:1.1.2.6 Mon May 23 17:16:10 2005
--- openafs/src/afs/LINUX/osi_syscall.c Tue Nov 1 19:28:17 2005
***************
*** 15,21 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_syscall.c,v 1.1.2.6 2005/05/23 21:16:10 shadow Exp $");
#ifdef AFS_LINUX24_ENV
#include /* early to avoid printf->printk mapping */
--- 15,21 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_syscall.c,v 1.1.2.7 2005/11/02 00:28:17 shadow Exp $");
#ifdef AFS_LINUX24_ENV
#include /* early to avoid printf->printk mapping */
***************
*** 26,32 ****
#include "h/mm.h"
#ifdef AFS_AMD64_LINUX20_ENV
! #include "../asm/ia32_unistd.h"
#endif
#include
--- 26,32 ----
#include "h/mm.h"
#ifdef AFS_AMD64_LINUX20_ENV
! #include
#endif
#include
Index: openafs/src/afs/LINUX/osi_vfsops.c
diff -c openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.11 openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.12
*** openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.11 Thu Oct 13 14:08:40 2005
--- openafs/src/afs/LINUX/osi_vfsops.c Mon Nov 28 22:20:28 2005
***************
*** 16,22 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.11 2005/10/13 18:08:40 shadow Exp $");
#define __NO_VERSION__ /* don't define kernel_version in module.h */
#include /* early to avoid printf->printk mapping */
--- 16,22 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.12 2005/11/29 03:20:28 shadow Exp $");
#define __NO_VERSION__ /* don't define kernel_version in module.h */
#include /* early to avoid printf->printk mapping */
***************
*** 343,354 ****
{
struct vcache *vcp = VTOAFS(ip);
if (VREFCOUNT(vcp) == 2) {
- AFS_GLOCK();
if (VREFCOUNT(vcp) == 2)
afs_InactiveVCache(vcp, NULL);
- AFS_GUNLOCK();
}
}
/* afs_put_super
--- 343,354 ----
{
struct vcache *vcp = VTOAFS(ip);
+ AFS_GLOCK();
if (VREFCOUNT(vcp) == 2) {
if (VREFCOUNT(vcp) == 2)
afs_InactiveVCache(vcp, NULL);
}
+ AFS_GUNLOCK();
}
/* afs_put_super
Index: openafs/src/afs/SOLARIS/osi_vnodeops.c
diff -c openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.6 openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.7
*** openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.6 Thu Oct 13 14:23:41 2005
--- openafs/src/afs/SOLARIS/osi_vnodeops.c Mon Nov 28 23:13:29 2005
***************
*** 11,17 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.20.2.6 2005/10/13 18:23:41 shadow Exp $");
/*
* SOLARIS/osi_vnodeops.c
--- 11,17 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.20.2.7 2005/11/29 04:13:29 shadow Exp $");
/*
* SOLARIS/osi_vnodeops.c
***************
*** 266,272 ****
register struct dcache *tdc;
int i, s, pexists;
int slot;
! afs_size_t offset = 0, nlen;
struct vrequest treq;
afs_int32 mapForRead = 0, Code = 0;
u_offset_t toffset;
--- 266,272 ----
register struct dcache *tdc;
int i, s, pexists;
int slot;
! afs_size_t offset, nlen = 0;
struct vrequest treq;
afs_int32 mapForRead = 0, Code = 0;
u_offset_t toffset;
Index: openafs/src/afs/VNOPS/afs_vnop_attrs.c
diff -c openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.27.2.9 openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.27.2.10
*** openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.27.2.9 Wed Oct 5 01:58:31 2005
--- openafs/src/afs/VNOPS/afs_vnop_attrs.c Sun Oct 23 02:31:23 2005
***************
*** 24,30 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.9 2005/10/05 05:58:31 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 24,30 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.10 2005/10/23 06:31:23 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 158,177 ****
* Below return 0 (and not 1) blocks if the file is zero length. This conforms
* better with the other filesystems that do return 0.
*/
! #ifdef AFS_HPUX_ENV
! attrs->va_blocks = (attrs->va_size ? ((attrs->va_size + 1023) >> 10) : 0);
! #elif defined(AFS_SGI_ENV)
! attrs->va_blocks = BTOBB(attrs->va_size);
! #elif defined(AFS_XBSD_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
attrs->va_bytes = (attrs->va_size ? (attrs->va_size + 1023) : 1024);
#ifdef va_bytes_rsv
attrs->va_bytes_rsv = -1;
#endif
! #else
! attrs->va_blocks =
! (attrs->va_size ? ((attrs->va_size + 1023) >> 10) << 1 : 0);
#endif
-
return 0;
}
--- 158,177 ----
* Below return 0 (and not 1) blocks if the file is zero length. This conforms
* better with the other filesystems that do return 0.
*/
! #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
attrs->va_bytes = (attrs->va_size ? (attrs->va_size + 1023) : 1024);
#ifdef va_bytes_rsv
attrs->va_bytes_rsv = -1;
#endif
! #elif defined(AFS_HPUX_ENV)
! attrs->va_blocks = (attrs->va_size ? ((attrs->va_size + 1023)>>10) : 0);
! #elif defined(AFS_SGI_ENV)
! attrs->va_blocks = BTOBB(attrs->va_size);
! #elif defined(AFS_SUN5_ENV)
! attrs->va_nblocks = (attrs->va_size ? ((attrs->va_size + 1023)>>10)<<1:0);
! #else /* everything else */
! attrs->va_blocks = (attrs->va_size ? ((attrs->va_size + 1023)>>10)<<1:0);
#endif
return 0;
}
Index: openafs/src/afs/VNOPS/afs_vnop_lookup.c
diff -c openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.50.2.14 openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.50.2.15
*** openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.50.2.14 Fri Oct 14 22:33:12 2005
--- openafs/src/afs/VNOPS/afs_vnop_lookup.c Fri Nov 18 23:35:41 2005
***************
*** 18,24 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.14 2005/10/15 02:33:12 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 18,24 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.15 2005/11/19 04:35:41 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 291,297 ****
do {
retry = 0;
ObtainWriteLock(&afs_xvcache, 597);
! root_vp = afs_FindVCache(tvc->mvid, &retry, 0);
if (root_vp && retry) {
ReleaseWriteLock(&afs_xvcache);
afs_PutVCache(root_vp);
--- 291,297 ----
do {
retry = 0;
ObtainWriteLock(&afs_xvcache, 597);
! root_vp = afs_FindVCache(tvc->mvid, &retry, IS_WLOCK);
if (root_vp && retry) {
ReleaseWriteLock(&afs_xvcache);
afs_PutVCache(root_vp);
***************
*** 701,707 ****
do {
retry = 0;
ObtainWriteLock(&afs_xvcache, 130);
! tvcp = afs_FindVCache(&tfid, &retry, 0 /* no stats | LRU */ );
if (tvcp && retry) {
ReleaseWriteLock(&afs_xvcache);
afs_PutVCache(tvcp);
--- 701,707 ----
do {
retry = 0;
ObtainWriteLock(&afs_xvcache, 130);
! tvcp = afs_FindVCache(&tfid, &retry, IS_WLOCK /* no stats | LRU */ );
if (tvcp && retry) {
ReleaseWriteLock(&afs_xvcache);
afs_PutVCache(tvcp);
Index: openafs/src/afs/VNOPS/afs_vnop_readdir.c
diff -c openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.24.2.7 openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.24.2.8
*** openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.24.2.7 Wed Oct 5 01:58:31 2005
--- openafs/src/afs/VNOPS/afs_vnop_readdir.c Fri Nov 18 23:35:42 2005
***************
*** 23,29 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.24.2.7 2005/10/05 05:58:31 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 23,29 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.24.2.8 2005/11/19 04:35:42 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 247,253 ****
tfid.Fid.Unique = ntohl(ade->fid.vunique);
if ((avc->states & CForeign) == 0 && (ntohl(ade->fid.vnode) & 1)) {
return DT_DIR;
! } else if ((tvc = afs_FindVCache(&tfid, 0, 0))) {
if (tvc->mvstat) {
afs_PutVCache(tvc);
return DT_DIR;
--- 247,256 ----
tfid.Fid.Unique = ntohl(ade->fid.vunique);
if ((avc->states & CForeign) == 0 && (ntohl(ade->fid.vnode) & 1)) {
return DT_DIR;
! }
! ObtainReadLock(&afs_xvcache);
! if ((tvc = afs_FindVCache(&tfid, 0, 0))) {
! ReleaseReadLock(&afs_xvcache);
if (tvc->mvstat) {
afs_PutVCache(tvc);
return DT_DIR;
***************
*** 266,272 ****
/* what other types does AFS support? */
} else
afs_PutVCache(tvc);
! }
return DT_UNKNOWN;
}
#endif
--- 269,276 ----
/* what other types does AFS support? */
} else
afs_PutVCache(tvc);
! } else
! ReleaseReadLock(&afs_xvcache);
return DT_UNKNOWN;
}
#endif
Index: openafs/src/afsd/afsd.c
diff -c openafs/src/afsd/afsd.c:1.43.2.15 openafs/src/afsd/afsd.c:1.43.2.16
*** openafs/src/afsd/afsd.c:1.43.2.15 Sat Oct 15 11:23:39 2005
--- openafs/src/afsd/afsd.c Wed Nov 30 23:03:30 2005
***************
*** 58,64 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.15 2005/10/15 15:23:39 shadow Exp $");
#define VFS 1
--- 58,64 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.16 2005/12/01 04:03:30 shadow Exp $");
#define VFS 1
***************
*** 1477,1483 ****
if (as->parms[25].items) {
/* -files_per_subdir */
int res = atoi(as->parms[25].items->data);
! if (res < 10 || res > 2 ^ 30) {
printf
("afsd:invalid number of files per subdir, \"%s\". Ignored\n",
as->parms[25].items->data);
--- 1477,1483 ----
if (as->parms[25].items) {
/* -files_per_subdir */
int res = atoi(as->parms[25].items->data);
! if (res < 10 || res > (1 << 30)) {
printf
("afsd:invalid number of files per subdir, \"%s\". Ignored\n",
as->parms[25].items->data);
Index: openafs/src/auth/cellconfig.c
diff -c openafs/src/auth/cellconfig.c:1.40.2.4 openafs/src/auth/cellconfig.c:1.40.2.5
*** openafs/src/auth/cellconfig.c:1.40.2.4 Sat Oct 15 10:55:39 2005
--- openafs/src/auth/cellconfig.c Mon Nov 7 14:54:10 2005
***************
*** 11,17 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.4 2005/10/15 14:55:39 shadow Exp $");
#include
#include
--- 11,17 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.5 2005/11/07 19:54:10 shadow Exp $");
#include
#include
***************
*** 1125,1138 ****
return 0;
}
if (code < sizeof(afs_int32) + (tstr->nkeys*sizeof(struct afsconf_key))) {
tstr->nkeys = 0;
UNLOCK_GLOBAL_MUTEX;
return 0;
}
- /* convert key structure to host order */
- tstr->nkeys = ntohl(tstr->nkeys);
for (fd = 0; fd < tstr->nkeys; fd++)
tstr->key[fd].kvno = ntohl(tstr->key[fd].kvno);
--- 1125,1139 ----
return 0;
}
+ /* convert key structure to host order */
+ tstr->nkeys = ntohl(tstr->nkeys);
+
if (code < sizeof(afs_int32) + (tstr->nkeys*sizeof(struct afsconf_key))) {
tstr->nkeys = 0;
UNLOCK_GLOBAL_MUTEX;
return 0;
}
for (fd = 0; fd < tstr->nkeys; fd++)
tstr->key[fd].kvno = ntohl(tstr->key[fd].kvno);
Index: openafs/src/cf/osconf.m4
diff -c openafs/src/cf/osconf.m4:1.51.2.19 openafs/src/cf/osconf.m4:1.51.2.22
*** openafs/src/cf/osconf.m4:1.51.2.19 Fri Oct 21 00:48:43 2005
--- openafs/src/cf/osconf.m4 Thu Dec 1 00:16:31 2005
***************
*** 208,213 ****
--- 208,214 ----
MT_LIBS="-pthread"
PAM_CFLAGS="-O2 -pipe -fPIC"
SHLIB_LDFLAGS="-shared -Xlinker -x"
+ SHLIB_LINKER="${MT_CC} -shared"
TXLIBS="-lncurses"
XCFLAGS="-O2 -pipe"
YACC="byacc"
***************
*** 219,224 ****
--- 220,226 ----
MT_LIBS="-lpthread" # XXX -pthread soon
PAM_CFLAGS="-O2 -pipe -fPIC"
SHLIB_LDFLAGS="-shared -Xlinker -x"
+ SHLIB_LINKER="${MT_CC} -shared"
TXLIBS="/usr/lib/libcurses.so"
XCFLAGS="-O2 -pipe"
YACC="yacc"
***************
*** 230,235 ****
--- 232,238 ----
MT_LIBS=""
PAM_CFLAGS="-O2 -pipe -fPIC"
SHLIB_LDFLAGS="-shared -Xlinker -x"
+ SHLIB_LINKER="${MT_CC} -shared"
TXLIBS="/usr/lib/libcurses.so"
XCFLAGS="-O2 -pipe"
YACC="bison -y"
***************
*** 370,375 ****
--- 373,379 ----
PAM_CFLAGS="-O2 -pipe -fpic"
SHLIB_CFLAGS="-fpic"
SHLIB_LDFLAGS="-shared -Xlinker -x"
+ SHLIB_LINKER="${MT_CC} -shared"
TXLIBS="/usr/lib/libcurses.a"
XCFLAGS="-O2"
YACC="yacc"
***************
*** 435,440 ****
--- 439,445 ----
XCFLAGS="-no-cpp-precomp"
TXLIBS="-lncurses"
EXTRA_VLIBOBJS="fstab.o"
+ SHLIB_LINKER="${MT_CC} -dynamiclib"
;;
*_darwin_80)
***************
*** 449,455 ****
TXLIBS="-lncurses"
EXTRA_VLIBOBJS="fstab.o"
SHLIB_LINKER="${MT_CC} -dynamiclib"
- SHLIB_LINKER="${MT_CC} -dynamiclib"
;;
ppc_linux*)
--- 454,459 ----
***************
*** 707,712 ****
--- 711,717 ----
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
LD="/usr/ccs/bin/ld"
SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
+ LWP_OPTMZ="-g"
;;
sun4x_56)
***************
*** 727,732 ****
--- 732,738 ----
XLIBKVM="-lkvm"
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
+ LWP_OPTMZ="-g"
;;
sun4x_57)
***************
*** 748,753 ****
--- 754,760 ----
XLIBKVM="-lkvm"
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
+ LWP_OPTMZ="-g"
;;
sun4x_58)
***************
*** 769,774 ****
--- 776,782 ----
XLIBKVM="-lkvm"
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
+ LWP_OPTMZ="-g"
;;
sun4x_59)
***************
*** 790,795 ****
--- 798,804 ----
XLIBKVM="-lkvm"
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
+ LWP_OPTMZ="-g"
;;
sun4x_510)
***************
*** 811,816 ****
--- 820,826 ----
XLIBKVM="-lkvm"
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
+ LWP_OPTMZ="-g"
;;
sunx86_57)
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.1.2.22 openafs/src/config/NTMakefile.amd64_w2k:1.1.2.23
*** openafs/src/config/NTMakefile.amd64_w2k:1.1.2.22 Sat Oct 8 09:42:04 2005
--- openafs/src/config/NTMakefile.amd64_w2k Wed Nov 30 01:41:53 2005
***************
*** 80,86 ****
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0050
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0092
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.46.2.37 openafs/src/config/NTMakefile.i386_nt40:1.46.2.38
*** openafs/src/config/NTMakefile.i386_nt40:1.46.2.37 Sat Oct 8 09:42:04 2005
--- openafs/src/config/NTMakefile.i386_nt40 Wed Nov 30 01:41:53 2005
***************
*** 80,86 ****
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0050
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0092
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.1.2.23 openafs/src/config/NTMakefile.i386_w2k:1.1.2.25
*** openafs/src/config/NTMakefile.i386_w2k:1.1.2.23 Sat Oct 8 09:42:04 2005
--- openafs/src/config/NTMakefile.i386_w2k Wed Nov 30 01:41:53 2005
***************
*** 78,85 ****
LIB = $(AFSDEV_LIB)
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0050
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 78,86 ----
LIB = $(AFSDEV_LIB)
#define used in WinNT/2000 installation and program version display
+ AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0092
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/param.hp_ux11i.h
diff -c openafs/src/config/param.hp_ux11i.h:1.4 openafs/src/config/param.hp_ux11i.h:1.4.2.1
*** openafs/src/config/param.hp_ux11i.h:1.4 Mon Aug 9 00:07:33 2004
--- openafs/src/config/param.hp_ux11i.h Wed Nov 2 00:31:39 2005
***************
*** 26,31 ****
--- 26,32 ----
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_64BIT_CLIENT 1
#define AFS_64BITPOINTER_ENV 1 /* pointers are 64 bits. */
+ #define AFS_64BIT_IOPS_ENV 1
#include
Index: openafs/src/config/param.ppc_darwin_70.h
diff -c openafs/src/config/param.ppc_darwin_70.h:1.4.2.1 openafs/src/config/param.ppc_darwin_70.h:1.4.2.2
*** openafs/src/config/param.ppc_darwin_70.h:1.4.2.1 Mon Apr 4 00:01:21 2005
--- openafs/src/config/param.ppc_darwin_70.h Tue Nov 29 00:02:24 2005
***************
*** 64,70 ****
#define va_nodeid va_fileid
#define vfs_vnodecovered mnt_vnodecovered
#define direct dirent
! #define vnode_t struct vnode
//#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
//#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
--- 64,71 ----
#define va_nodeid va_fileid
#define vfs_vnodecovered mnt_vnodecovered
#define direct dirent
! #define vnode_t struct vnode *
! #define mount_t struct mount *
//#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
//#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
Index: openafs/src/libadmin/vos/afs_vosAdmin.c
diff -c openafs/src/libadmin/vos/afs_vosAdmin.c:1.9 openafs/src/libadmin/vos/afs_vosAdmin.c:1.9.2.1
*** openafs/src/libadmin/vos/afs_vosAdmin.c:1.9 Sun Dec 7 17:49:32 2003
--- openafs/src/libadmin/vos/afs_vosAdmin.c Tue Oct 25 02:35:55 2005
***************
*** 11,17 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/libadmin/vos/afs_vosAdmin.c,v 1.9 2003/12/07 22:49:32 jaltman Exp $");
#include
#include
--- 11,17 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/libadmin/vos/afs_vosAdmin.c,v 1.9.2.1 2005/10/25 06:35:55 shadow Exp $");
#include
#include
***************
*** 1975,1985 ****
if (!ValidateVolumeName(volumeName, &tst)) {
goto fail_vos_VLDBGet;
}
! if (!VLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
goto fail_vos_VLDBGet;
}
} else {
! if (!VLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
goto fail_vos_VLDBGet;
}
}
--- 1975,1985 ----
if (!ValidateVolumeName(volumeName, &tst)) {
goto fail_vos_VLDBGet;
}
! if (!aVLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
goto fail_vos_VLDBGet;
}
} else {
! if (!aVLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
goto fail_vos_VLDBGet;
}
}
***************
*** 2919,2925 ****
* Check that the volume doesn't already exist
*/
! if (VLDB_GetEntryByName(c_handle, volumeName, &vinfo, &tst)) {
tst = ADMVOSVOLUMENAMEDUP;
goto fail_vos_VolumeCreate;
}
--- 2919,2925 ----
* Check that the volume doesn't already exist
*/
! if (aVLDB_GetEntryByName(c_handle, volumeName, &vinfo, &tst)) {
tst = ADMVOSVOLUMENAMEDUP;
goto fail_vos_VolumeCreate;
}
***************
*** 3067,3073 ****
* Retrieve the entry
*/
! if (!VLDB_GetEntryByID(c_handle, readWriteVolumeId, -1, &entry, &tst)) {
goto fail_vos_VolumeRename;
}
--- 3067,3073 ----
* Retrieve the entry
*/
! if (!aVLDB_GetEntryByID(c_handle, readWriteVolumeId, -1, &entry, &tst)) {
goto fail_vos_VolumeRename;
}
***************
*** 3261,3267 ****
*/
if (volumeId != NULL) {
! if (!VLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
goto fail_vos_VolumeRestore;
}
volid = *volumeId;
--- 3261,3267 ----
*/
if (volumeId != NULL) {
! if (!aVLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
goto fail_vos_VolumeRestore;
}
volid = *volumeId;
***************
*** 3289,3295 ****
close(fd);
}
! if (!VLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
restoreflags = RV_FULLRST;
} else if (Lp_GetRwIndex(c_handle, &entry, 0) == -1) {
restoreflags = RV_FULLRST;
--- 3289,3295 ----
close(fd);
}
! if (!aVLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
restoreflags = RV_FULLRST;
} else if (Lp_GetRwIndex(c_handle, &entry, 0) == -1) {
restoreflags = RV_FULLRST;
Index: openafs/src/libadmin/vos/vosutils.c
diff -c openafs/src/libadmin/vos/vosutils.c:1.10 openafs/src/libadmin/vos/vosutils.c:1.10.2.2
*** openafs/src/libadmin/vos/vosutils.c:1.10 Sun Dec 7 17:49:32 2003
--- openafs/src/libadmin/vos/vosutils.c Tue Oct 25 02:35:56 2005
***************
*** 11,17 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/libadmin/vos/vosutils.c,v 1.10 2003/12/07 22:49:32 jaltman Exp $");
#include "vosutils.h"
#include "vsprocs.h"
--- 11,17 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/libadmin/vos/vosutils.c,v 1.10.2.2 2005/10/25 06:35:56 shadow Exp $");
#include "vosutils.h"
#include "vsprocs.h"
***************
*** 133,139 ****
}
int
! VLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_int32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_status_p st)
{
--- 133,139 ----
}
int
! aVLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_int32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_status_p st)
{
***************
*** 171,177 ****
}
int
! VLDB_GetEntryByName(afs_cell_handle_p cellHandle, const char *namep,
struct nvldbentry *entryp, afs_status_p st)
{
struct vldbentry oentry;
--- 171,177 ----
}
int
! aVLDB_GetEntryByName(afs_cell_handle_p cellHandle, const char *namep,
struct nvldbentry *entryp, afs_status_p st)
{
struct vldbentry oentry;
***************
*** 412,418 ****
afs_status_t tst;
int i, index = -1;
! if (!VLDB_GetEntryByID(cellHandle, volid, -1, rentry, &tst)) {
rc = 0;
goto fail_GetVolumeInfo;
}
--- 412,418 ----
afs_status_t tst;
int i, index = -1;
! if (!aVLDB_GetEntryByID(cellHandle, volid, -1, rentry, &tst)) {
rc = 0;
goto fail_GetVolumeInfo;
}
Index: openafs/src/libadmin/vos/vosutils.h
diff -c openafs/src/libadmin/vos/vosutils.h:1.5 openafs/src/libadmin/vos/vosutils.h:1.5.2.1
*** openafs/src/libadmin/vos/vosutils.h:1.5 Tue Jul 15 19:15:36 2003
--- openafs/src/libadmin/vos/vosutils.h Tue Oct 25 02:35:56 2005
***************
*** 15,26 ****
extern int VLDB_CreateEntry(afs_cell_handle_p cellHandle,
struct nvldbentry *entryp, afs_status_p st);
! extern int VLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_int32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_status_p st);
! extern int VLDB_GetEntryByName(afs_cell_handle_p cellHandle,
const char *namep, struct nvldbentry *entryp,
afs_status_p st);
--- 15,26 ----
extern int VLDB_CreateEntry(afs_cell_handle_p cellHandle,
struct nvldbentry *entryp, afs_status_p st);
! extern int aVLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_int32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_status_p st);
! extern int aVLDB_GetEntryByName(afs_cell_handle_p cellHandle,
const char *namep, struct nvldbentry *entryp,
afs_status_p st);
Index: openafs/src/libadmin/vos/vsprocs.c
diff -c openafs/src/libadmin/vos/vsprocs.c:1.11 openafs/src/libadmin/vos/vsprocs.c:1.11.2.1
*** openafs/src/libadmin/vos/vsprocs.c:1.11 Sat Nov 29 17:08:14 2003
--- openafs/src/libadmin/vos/vsprocs.c Tue Oct 25 02:35:56 2005
***************
*** 22,28 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/libadmin/vos/vsprocs.c,v 1.11 2003/11/29 22:08:14 jaltman Exp $");
#include "vsprocs.h"
#include "vosutils.h"
--- 22,28 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/libadmin/vos/vsprocs.c,v 1.11.2.1 2005/10/25 06:35:56 shadow Exp $");
#include "vsprocs.h"
#include "vosutils.h"
***************
*** 239,245 ****
} else {
islocked = 1;
! if (!VLDB_GetEntryByID(cellHandle, volumeId, avoltype, &entry, &tst)) {
goto fail_UV_DeleteVolume;
}
--- 239,245 ----
} else {
islocked = 1;
! if (!aVLDB_GetEntryByID(cellHandle, volumeId, avoltype, &entry, &tst)) {
goto fail_UV_DeleteVolume;
}
***************
*** 427,433 ****
backupId = 0;
newVol = 0;
! if (!VLDB_GetEntryByID(cellHandle, afromvol, -1, &entry, &tst)) {
goto fail_UV_MoveVolume;
}
--- 427,433 ----
backupId = 0;
newVol = 0;
! if (!aVLDB_GetEntryByID(cellHandle, afromvol, -1, &entry, &tst)) {
goto fail_UV_MoveVolume;
}
***************
*** 443,449 ****
}
islocked = 1;
! if (!VLDB_GetEntryByID(cellHandle, afromvol, RWVOL, &entry, &tst)) {
goto fail_UV_MoveVolume;
}
--- 443,449 ----
}
islocked = 1;
! if (!aVLDB_GetEntryByID(cellHandle, afromvol, RWVOL, &entry, &tst)) {
goto fail_UV_MoveVolume;
}
***************
*** 890,896 ****
AFSVolEndTrans(fromconn, fromtid, &rcode);
}
! if (!VLDB_GetEntryByID(cellHandle, afromvol, -1, &entry, &tst)) {
goto done;
}
--- 890,896 ----
AFSVolEndTrans(fromconn, fromtid, &rcode);
}
! if (!aVLDB_GetEntryByID(cellHandle, afromvol, -1, &entry, &tst)) {
goto done;
}
***************
*** 1005,1011 ****
/* the calls to VLDB will succeed only if avolid is a RW volume,
* since we are following the RW hash chain for searching */
! if (!VLDB_GetEntryByID(cellHandle, avolid, RWVOL, &entry, &tst)) {
goto fail_UV_BackupVolume;
}
--- 1005,1011 ----
/* the calls to VLDB will succeed only if avolid is a RW volume,
* since we are following the RW hash chain for searching */
! if (!aVLDB_GetEntryByID(cellHandle, avolid, RWVOL, &entry, &tst)) {
goto fail_UV_BackupVolume;
}
***************
*** 1026,1032 ****
vldblocked = 1;
/* Reread the vldb entry */
! if (!VLDB_GetEntryByID(cellHandle, avolid, RWVOL, &entry, &tst)) {
goto fail_UV_BackupVolume;
}
}
--- 1026,1032 ----
vldblocked = 1;
/* Reread the vldb entry */
! if (!aVLDB_GetEntryByID(cellHandle, avolid, RWVOL, &entry, &tst)) {
goto fail_UV_BackupVolume;
}
}
***************
*** 1503,1509 ****
islocked = 1;
/* Get the vldb entry in readable format */
! if (!VLDB_GetEntryByID(cellHandle, afromvol, RWVOL, &entry, &tst)) {
goto fail_UV_ReleaseVolume;
}
--- 1503,1509 ----
islocked = 1;
/* Get the vldb entry in readable format */
! if (!aVLDB_GetEntryByID(cellHandle, afromvol, RWVOL, &entry, &tst)) {
goto fail_UV_ReleaseVolume;
}
***************
*** 2118,2124 ****
fromcall = (struct rx_call *)0;
islocked = 0;
! if (!VLDB_GetEntryByID(cellHandle, afromvol, -1, &entry, &tst)) {
goto fail_UV_DumpVolume;
}
--- 2118,2124 ----
fromcall = (struct rx_call *)0;
islocked = 0;
! if (!aVLDB_GetEntryByID(cellHandle, afromvol, -1, &entry, &tst)) {
goto fail_UV_DumpVolume;
}
***************
*** 2329,2335 ****
pvolid = tovolid;
toconn = UV_Bind(cellHandle, toserver, AFSCONF_VOLUMEPORT);
if (pvolid == 0) { /*alot a new id if needed */
! VLDB_GetEntryByName(cellHandle, tovolname, &entry, &tst);
if (tst == VL_NOENT) {
tst =
ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, &pvolid);
--- 2329,2335 ----
pvolid = tovolid;
toconn = UV_Bind(cellHandle, toserver, AFSCONF_VOLUMEPORT);
if (pvolid == 0) { /*alot a new id if needed */
! aVLDB_GetEntryByName(cellHandle, tovolname, &entry, &tst);
if (tst == VL_NOENT) {
tst =
ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, &pvolid);
***************
*** 2450,2456 ****
/* Volume was restored on the file server, update the
* VLDB to reflect the change.
*/
! VLDB_GetEntryByID(cellHandle, pvolid, RWVOL, &entry, &tst);
if (tst && tst != VL_NOENT && tst != VL_ENTDELETED) {
goto fail_UV_RestoreVolume;
}
--- 2450,2456 ----
/* Volume was restored on the file server, update the
* VLDB to reflect the change.
*/
! aVLDB_GetEntryByID(cellHandle, pvolid, RWVOL, &entry, &tst);
if (tst && tst != VL_NOENT && tst != VL_ENTDELETED) {
goto fail_UV_RestoreVolume;
}
***************
*** 2613,2619 ****
}
islocked = 1;
! if (!VLDB_GetEntryByID(cellHandle, volid, RWVOL, &entry, &tst)) {
goto fail_UV_AddSite;
}
if (!ISNAMEVALID(entry.name)) {
--- 2613,2619 ----
}
islocked = 1;
! if (!aVLDB_GetEntryByID(cellHandle, volid, RWVOL, &entry, &tst)) {
goto fail_UV_AddSite;
}
if (!ISNAMEVALID(entry.name)) {
***************
*** 2692,2698 ****
}
islocked = 1;
! if (!VLDB_GetEntryByID(cellHandle, volid, RWVOL, &entry, &tst)) {
goto fail_UV_RemoveSite;
}
if (!Lp_ROMatch(cellHandle, &entry, server, part, &tst)) {
--- 2692,2698 ----
}
islocked = 1;
! if (!aVLDB_GetEntryByID(cellHandle, volid, RWVOL, &entry, &tst)) {
goto fail_UV_RemoveSite;
}
if (!Lp_ROMatch(cellHandle, &entry, server, part, &tst)) {
***************
*** 3006,3012 ****
maxVolid += temp2;
}
! VLDB_GetEntryByID(cellHandle, elem.ids[RWVOL], RWVOL, &entry, &tst);
if (tst && (tst != VL_NOENT)) {
noError = 0;
totalCE++;
--- 3006,3012 ----
maxVolid += temp2;
}
! aVLDB_GetEntryByID(cellHandle, elem.ids[RWVOL], RWVOL, &entry, &tst);
if (tst && (tst != VL_NOENT)) {
noError = 0;
totalCE++;
***************
*** 3495,3501 ****
}
islocked = 1;
! if (!VLDB_GetEntryByID
(cellHandle, entry->volumeId[RWVOL], RWVOL, entry, &tst)) {
goto fail_CheckVldb;
}
--- 3495,3501 ----
}
islocked = 1;
! if (!aVLDB_GetEntryByID
(cellHandle, entry->volumeId[RWVOL], RWVOL, entry, &tst)) {
goto fail_CheckVldb;
}
Index: openafs/src/libafs/afs.x86_darwin_80.plist.in
diff -c /dev/null openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.2.2
*** /dev/null Thu Dec 1 02:48:03 2005
--- openafs/src/libafs/afs.x86_darwin_80.plist.in Mon Oct 24 14:52:35 2005
***************
*** 0 ****
--- 1,33 ----
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ afs
+ CFBundleIdentifier
+ org.openafs.filesystems.afs
+ CFBundleInfoDictionaryVersion
+ 8.0
+ CFBundleName
+ afs
+ CFBundlePackageType
+ KEXT
+ CFBundleShortVersionString
+ 1.3.82
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.3.82
+ OSBundleLibraries
+
+ com.apple.kpi.bsd
+ 8.0.0
+ com.apple.kpi.mach
+ 8.0.0
+ com.apple.kpi.libkern
+ 8.0
+
+
+
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.21 openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.22
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.21 Sat Oct 22 01:58:45 2005
--- openafs/src/packaging/MacOS/OpenAFS.info Wed Nov 30 23:09:33 2005
***************
*** 1,5 ****
Title OpenAFS
! Version 1.4.1-rc1
Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
DefaultLocation /
Diskname (null)
--- 1,5 ----
Title OpenAFS
! Version 1.4.1-rc2
Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
DefaultLocation /
Diskname (null)
Index: openafs/src/packaging/MacOS/buildpkg.sh
diff -c openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.3 openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.6
*** openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.3 Fri Oct 21 00:59:16 2005
--- openafs/src/packaging/MacOS/buildpkg.sh Thu Dec 1 00:19:49 2005
***************
*** 107,112 ****
--- 107,113 ----
strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext $PKGROOT/private/var/db/openafs/etc
+ cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/C $PKGROOT/private/var/db/openafs/etc
chown -R root${SEP}wheel $PKGROOT/private
chmod -R og-w $PKGROOT/private
***************
*** 134,143 ****
cp OpenAFS.post_install $PKGRES/postinstall
cp OpenAFS.pre_upgrade $PKGRES/preupgrade
cp OpenAFS.post_install $PKGRES/postupgrade
! cp InstallationCheck $PKGRES
! mkdir $PKGRES/English.lproj
! cp InstallationCheck $PKGRES/English.lproj
! chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade $PKGRES/InstallationCheck
else
cp OpenAFS.post_install OpenAFS.pre_upgrade $PKGRES
cp OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade
--- 135,147 ----
cp OpenAFS.post_install $PKGRES/postinstall
cp OpenAFS.pre_upgrade $PKGRES/preupgrade
cp OpenAFS.post_install $PKGRES/postupgrade
! if [ $majorvers -ge 8 ]; then
! cp InstallationCheck $PKGRES
! mkdir $PKGRES/English.lproj
! cp InstallationCheck $PKGRES/English.lproj
! chmod a+x $PKGRES/InstallationCheck
! fi
! chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade
else
cp OpenAFS.post_install OpenAFS.pre_upgrade $PKGRES
cp OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade
***************
*** 170,175 ****
--- 174,180 ----
rm -rf pkgroot pkgres
mkdir dmg
mv OpenAFS.pkg dmg
+ rm -rf OpenAFS.dmg
hdiutil create -srcfolder dmg -volname OpenAFS -anyowners OpenAFS.dmg
rm -rf dmg
# Unfortunately, sudo sets $USER to root, so I can't chown the
Index: openafs/src/rx/rx.c
diff -c openafs/src/rx/rx.c:1.58.2.29 openafs/src/rx/rx.c:1.58.2.30
*** openafs/src/rx/rx.c:1.58.2.29 Sat Oct 8 00:00:07 2005
--- openafs/src/rx/rx.c Tue Nov 29 02:01:50 2005
***************
*** 17,23 ****
#endif
RCSID
! ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.29 2005/10/08 04:00:07 jaltman Exp $");
#ifdef KERNEL
#include "afs/sysincludes.h"
--- 17,23 ----
#endif
RCSID
! ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.30 2005/11/29 07:01:50 jaltman Exp $");
#ifdef KERNEL
#include "afs/sysincludes.h"
***************
*** 2851,2861 ****
np = rxi_ReceiveAckPacket(call, np, 1);
break;
case RX_PACKET_TYPE_ABORT:
! /* An abort packet: reset the connection, passing the error up to
! * the user */
/* What if error is zero? */
rxi_CallError(call, ntohl(*(afs_int32 *) rx_DataOf(np)));
! break;
case RX_PACKET_TYPE_BUSY:
/* XXXX */
break;
--- 2851,2865 ----
np = rxi_ReceiveAckPacket(call, np, 1);
break;
case RX_PACKET_TYPE_ABORT:
! /* An abort packet: reset the call, passing the error up to the user. */
/* What if error is zero? */
+ /* What if the error is -1? the application will treat it as a timeout. */
rxi_CallError(call, ntohl(*(afs_int32 *) rx_DataOf(np)));
! MUTEX_EXIT(&call->lock);
! MUTEX_ENTER(&conn->conn_data_lock);
! conn->refCount--;
! MUTEX_EXIT(&conn->conn_data_lock);
! return np; /* xmitting; drop packet */
case RX_PACKET_TYPE_BUSY:
/* XXXX */
break;
***************
*** 2877,2883 ****
--- 2881,2890 ----
rxi_SetAcksInTransmitQueue(call);
break;
#else /* RX_ENABLE_LOCKS */
+ MUTEX_EXIT(&call->lock);
+ MUTEX_ENTER(&conn->conn_data_lock);
conn->refCount--;
+ MUTEX_EXIT(&conn->conn_data_lock);
return np; /* xmitting; drop packet */
#endif /* RX_ENABLE_LOCKS */
}
Index: openafs/src/rx/rx_kcommon.h
diff -c openafs/src/rx/rx_kcommon.h:1.27.2.4 openafs/src/rx/rx_kcommon.h:1.27.2.5
*** openafs/src/rx/rx_kcommon.h:1.27.2.4 Wed Oct 5 01:58:42 2005
--- openafs/src/rx/rx_kcommon.h Tue Nov 29 01:54:47 2005
***************
*** 155,172 ****
extern struct domain inetdomain;
#endif /* AFS_XBSD_ENV */
- #ifndef AFS_DARWIN80_ENV
- #define ifaddr_address_family(x) (x)->ifa_addr->sa_family
- #define ifaddr_address(x, y, z) memcpy(y, (x)->ifa_addr, z)
- #define ifaddr_netmask(x, y, z) memcpy(y, (x)->ifa_netmask, z)
- #define ifaddr_dstaddress(x, y, z) memcpy(y, (x)->ifa_dstaddr, z)
- #define ifaddr_ifnet(x) (x?(x)->ifa_ifp:0)
- #define ifnet_flags(x) (x?(x)->if_flags:0)
- #define ifnet_metric(x) (x?(x)->if_data.ifi_metric:0)
- /*#define ifnet_mtu(x) (x)->if_mtu*/
- #define ifaddr_withnet(x) ifa_ifwithnet(x)
- #endif
-
#endif /* _RX_KCOMMON_H_ */
#endif
--- 155,160 ----
Index: openafs/src/rx/rx_packet.c
diff -c openafs/src/rx/rx_packet.c:1.35.2.18 openafs/src/rx/rx_packet.c:1.35.2.20
*** openafs/src/rx/rx_packet.c:1.35.2.18 Wed Oct 5 01:58:42 2005
--- openafs/src/rx/rx_packet.c Wed Nov 30 23:00:39 2005
***************
*** 15,21 ****
#endif
RCSID
! ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.18 2005/10/05 05:58:42 shadow Exp $");
#ifdef KERNEL
#if defined(UKERNEL)
--- 15,21 ----
#endif
RCSID
! ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.20 2005/12/01 04:00:39 shadow Exp $");
#ifdef KERNEL
#if defined(UKERNEL)
***************
*** 114,119 ****
--- 114,122 ----
afs_int32 ahost, short aport,
afs_int32 istack);
+ static int rxi_FreeDataBufsToQueue(struct rx_packet *p, int first,
+ struct rx_queue * q);
+
/* some rules about packets:
* 1. When a packet is allocated, the final iov_buf contains room for
* a security trailer, but iov_len masks that fact. If the security
***************
*** 381,394 ****
register struct rx_packet *c, *nc;
SPLVAR;
if (!num_pkts) {
! queue_Count(q, c, nc, rx_packet, num_pkts);
! if (!num_pkts)
! return 0;
}
! RX_TS_INFO_GET(rx_ts_info);
! RX_TS_FPQ_CHECKIN2(rx_ts_info, num_pkts, q);
if (rx_ts_info->_FPQ.len > rx_TSFPQLocalMax) {
NETPRI;
--- 384,405 ----
register struct rx_packet *c, *nc;
SPLVAR;
+ osi_Assert(num_pkts >= 0);
+ RX_TS_INFO_GET(rx_ts_info);
+
if (!num_pkts) {
! for (queue_Scan(q, c, nc, rx_packet), num_pkts++) {
! rxi_FreeDataBufsTSFPQ(c, 1, 0);
! }
! } else {
! for (queue_Scan(q, c, nc, rx_packet)) {
! rxi_FreeDataBufsTSFPQ(c, 1, 0);
! }
}
! if (num_pkts) {
! RX_TS_FPQ_CHECKIN2(rx_ts_info, num_pkts, q);
! }
if (rx_ts_info->_FPQ.len > rx_TSFPQLocalMax) {
NETPRI;
***************
*** 410,435 ****
int
rxi_FreePackets(int num_pkts, struct rx_queue *q)
{
register struct rx_packet *p, *np;
SPLVAR;
if (!num_pkts) {
for (queue_Scan(q, p, np, rx_packet), num_pkts++) {
RX_FPQ_MARK_FREE(p);
}
if (!num_pkts)
return 0;
} else {
for (queue_Scan(q, p, np, rx_packet)) {
RX_FPQ_MARK_FREE(p);
}
}
NETPRI;
MUTEX_ENTER(&rx_freePktQ_lock);
queue_SpliceAppend(&rx_freePacketQueue, q);
! rx_nFreePackets += num_pkts;
/* Wakeup anyone waiting for packets */
rxi_PacketsUnWait();
--- 421,463 ----
int
rxi_FreePackets(int num_pkts, struct rx_queue *q)
{
+ struct rx_queue cbs;
register struct rx_packet *p, *np;
+ int qlen = 0;
SPLVAR;
+ osi_Assert(num_pkts >= 0);
+ queue_Init(&cbs);
+
if (!num_pkts) {
for (queue_Scan(q, p, np, rx_packet), num_pkts++) {
+ if (p->niovecs > 2) {
+ qlen += rxi_FreeDataBufsToQueue(p, 2, &cbs);
+ }
RX_FPQ_MARK_FREE(p);
}
if (!num_pkts)
return 0;
} else {
for (queue_Scan(q, p, np, rx_packet)) {
+ if (p->niovecs > 2) {
+ qlen += rxi_FreeDataBufsToQueue(p, 2, &cbs);
+ }
RX_FPQ_MARK_FREE(p);
}
}
+ if (qlen) {
+ queue_SpliceAppend(q, &cbs);
+ qlen += num_pkts;
+ } else
+ qlen = num_pkts;
+
NETPRI;
MUTEX_ENTER(&rx_freePktQ_lock);
queue_SpliceAppend(&rx_freePacketQueue, q);
! rx_nFreePackets += qlen;
/* Wakeup anyone waiting for packets */
rxi_PacketsUnWait();
***************
*** 777,782 ****
--- 805,831 ----
}
#endif /* RX_ENABLE_TSFPQ */
+ /* free continuation buffers off a packet into a queue of buffers */
+ static int
+ rxi_FreeDataBufsToQueue(struct rx_packet *p, int first, struct rx_queue * q)
+ {
+ struct iovec *iov;
+ int count = 0;
+
+ if (first < 2)
+ first = 2;
+ for (; first < p->niovecs; first++, count++) {
+ iov = &p->wirevec[first];
+ if (!iov->iov_base)
+ osi_Panic("rxi_PacketIOVToQueue: unexpected NULL iov");
+ queue_Append(q, RX_CBUF_TO_PACKET(iov->iov_base, p));
+ }
+ p->length = 0;
+ p->niovecs = 0;
+
+ return count;
+ }
+
int
rxi_FreeDataBufsNoLock(struct rx_packet *p, int first)
{
***************
*** 2548,2554 ****
queue_Init(&q);
/* Free any extra elements in the wirevec */
! for (j = MAX(2, i), nb = j - p->niovecs; j < p->niovecs; j++) {
queue_Append(&q,RX_CBUF_TO_PACKET(p->wirevec[j].iov_base, p));
}
if (nb)
--- 2597,2603 ----
queue_Init(&q);
/* Free any extra elements in the wirevec */
! for (j = MAX(2, i), nb = p->niovecs - j; j < p->niovecs; j++) {
queue_Append(&q,RX_CBUF_TO_PACKET(p->wirevec[j].iov_base, p));
}
if (nb)
Index: openafs/src/rx/rx_prototypes.h
diff -c openafs/src/rx/rx_prototypes.h:1.14.2.12 openafs/src/rx/rx_prototypes.h:1.14.2.13
*** openafs/src/rx/rx_prototypes.h:1.14.2.12 Sat Oct 15 10:24:30 2005
--- openafs/src/rx/rx_prototypes.h Tue Oct 25 02:37:13 2005
***************
*** 309,314 ****
--- 309,315 ----
/* rx_kcommon.c */
+ struct socket;
extern int (*rxk_PacketArrivalProc) (struct rx_packet * ahandle,
struct sockaddr_in * afrom,
struct socket *arock,
Index: openafs/src/sys/Makefile.in
diff -c openafs/src/sys/Makefile.in:1.27.2.6 openafs/src/sys/Makefile.in:1.27.2.7
*** openafs/src/sys/Makefile.in:1.27.2.6 Mon Oct 17 15:12:06 2005
--- openafs/src/sys/Makefile.in Tue Oct 25 02:36:39 2005
***************
*** 62,67 ****
--- 62,69 ----
sun*_5*) \
${SHLIB_LINKER} -h libafssetpag.so.${LIBAFSSETPAGMAJOR} \
-o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
+ *bsd*) \
+ touch ${LIBAFSSETPAG};; \
*) \
${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
esac
Index: openafs/src/tbutc/Makefile.in
diff -c openafs/src/tbutc/Makefile.in:1.13.2.1 openafs/src/tbutc/Makefile.in:1.13.2.2
*** openafs/src/tbutc/Makefile.in:1.13.2.1 Sun Apr 24 16:05:22 2005
--- openafs/src/tbutc/Makefile.in Mon Oct 24 15:06:37 2005
***************
*** 24,30 ****
BUCOORDOBJS=ubik_db_if.o ../bucoord/volstub.o ../bucoord/dlq.o \
status.o ../bucoord/bucoord_errs.o
! VOLSEROBJS=vsprocs.o
VOLSERLIBS=${TOP_LIBDIR}/libvosadmin.a ${TOP_LIBDIR}/libafsadminutil.a
LWPOBJS =lock.o
--- 24,30 ----
BUCOORDOBJS=ubik_db_if.o ../bucoord/volstub.o ../bucoord/dlq.o \
status.o ../bucoord/bucoord_errs.o
! VOLSEROBJS=vsprocs.o vsutils.o
VOLSERLIBS=${TOP_LIBDIR}/libvosadmin.a ${TOP_LIBDIR}/libafsadminutil.a
LWPOBJS =lock.o
***************
*** 109,114 ****
--- 109,117 ----
status.o: ${BUCOORD}/status.c
${CC} ${CFLAGS} -c ${BUCOORD}/status.c
+ vsutils.o: ${VOLSER}/vsutils.c
+ ${CC} ${CFLAGS} -c ${VOLSER}/vsutils.c
+
vsprocs.o: ${VOLSER}/vsprocs.c
${CC} ${CFLAGS} -c ${VOLSER}/vsprocs.c
Index: openafs/src/venus/cmdebug.c
diff -c openafs/src/venus/cmdebug.c:1.15 openafs/src/venus/cmdebug.c:1.15.2.1
*** openafs/src/venus/cmdebug.c:1.15 Tue Jul 15 19:17:20 2003
--- openafs/src/venus/cmdebug.c Mon Oct 24 21:58:06 2005
***************
*** 11,23 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.15 2003/07/15 23:17:20 shadow Exp $");
#include
#include
#include
#include
#include
#ifdef HAVE_STRING_H
#include
--- 11,30 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.15.2.1 2005/10/25 01:58:06 jaltman Exp $");
#include
+ #ifdef AFS_NT40_ENV
+ #include
+ #include
+ #else
+ #ifdef HAVE_NETINET_IN_H
#include
+ #endif
#include
#include
+ #endif
#include
#ifdef HAVE_STRING_H
#include
***************
*** 37,45 ****
extern struct hostent *hostutil_GetHostByName();
! static
! PrintCacheConfig(aconn)
! struct rx_connection *aconn;
{
struct cacheConfig c;
afs_uint32 srv_ver, conflen;
--- 44,51 ----
extern struct hostent *hostutil_GetHostByName();
! static int
! PrintCacheConfig(struct rx_connection *aconn)
{
struct cacheConfig c;
afs_uint32 srv_ver, conflen;
***************
*** 80,99 ****
}
}
! static
! PrintInterfaces(aconn)
! struct rx_connection *aconn;
{
struct interfaceAddr addr;
int i, code;
! code = RXAFSCB_WhoAreYou(aconn, &addr);
if (code) {
printf("cmdebug: error checking interfaces: %s\n",
error_message(code));
return 0;
}
printf("Host interfaces:\n");
for (i = 0; i < addr.numberOfInterfaces; i++) {
printf("%s", afs_inet_ntoa(htonl(addr.addr_in[i])));
--- 86,129 ----
}
}
! #ifndef CAPABILITY_BITS
! #define CAPABILITY_ERRORTRANS (1<<0)
! #define CAPABILITY_BITS 1
! #endif
!
! static int
! PrintInterfaces(struct rx_connection *aconn)
{
+ Capabilities caps;
struct interfaceAddr addr;
+ #ifdef AFS_NT40_ENV
+ char * p;
+ #else
+ char uuidstr[128];
+ #endif
int i, code;
! caps.Capabilities_val = NULL;
! caps.Capabilities_len = 0;
!
! code = RXAFSCB_TellMeAboutYourself(aconn, &addr, &caps);
! if (code == RXGEN_OPCODE)
! code = RXAFSCB_WhoAreYou(aconn, &addr);
if (code) {
printf("cmdebug: error checking interfaces: %s\n",
error_message(code));
return 0;
}
+ #ifdef AFS_NT40_ENV
+ UuidToString((UUID *)&addr.uuid, &p);
+ printf("UUID: %s\n",p);
+ RpcStringFree(&p);
+ #else
+ afsUUID_to_string(&addr.uuid, uuidstr, sizeof(uuidstr));
+ printf("UUID: %s\n",uuidstr);
+ #endif
+
printf("Host interfaces:\n");
for (i = 0; i < addr.numberOfInterfaces; i++) {
printf("%s", afs_inet_ntoa(htonl(addr.addr_in[i])));
***************
*** 104,115 ****
printf("\n");
}
return 0;
}
! static
! IsLocked(alock)
! register struct AFSDBLockDesc *alock;
{
if (alock->waitStates || alock->exclLocked || alock->numWaiting
|| alock->readersReading)
--- 134,157 ----
printf("\n");
}
+ if (caps.Capabilities_val) {
+ printf("Capabilities:\n");
+ if (caps.Capabilities_val[0] & CAPABILITY_ERRORTRANS) {
+ printf("Error Translation\n");
+ }
+ printf("\n");
+ }
+
+ if (caps.Capabilities_val)
+ free(caps.Capabilities_val);
+ caps.Capabilities_val = NULL;
+ caps.Capabilities_len = 0;
+
return 0;
}
! static int
! IsLocked(register struct AFSDBLockDesc *alock)
{
if (alock->waitStates || alock->exclLocked || alock->numWaiting
|| alock->readersReading)
***************
*** 117,125 ****
return 0;
}
! static
! PrintLock(alock)
! register struct AFSDBLockDesc *alock;
{
printf("(");
if (alock->waitStates) {
--- 159,166 ----
return 0;
}
! static int
! PrintLock(register struct AFSDBLockDesc *alock)
{
printf("(");
if (alock->waitStates) {
***************
*** 147,156 ****
return 0;
}
! static
! PrintLocks(aconn, aint32)
! int aint32;
! register struct rx_connection *aconn;
{
register int i;
struct AFSDBLock lock;
--- 188,195 ----
return 0;
}
! static int
! PrintLocks(register struct rx_connection *aconn, int aint32)
{
register int i;
struct AFSDBLock lock;
***************
*** 246,252 ****
continue;
}
! if (!aint32 && !IsLocked(¢ry.lock))
continue;
/* otherwise print this entry */
--- 285,293 ----
continue;
}
! if (aint32 == 0 && !IsLocked(¢ry.lock) ||
! aint32 == 2 && centry.refCount == 0 ||
! aint32 == 4 && centry.callback == 0)
continue;
/* otherwise print this entry */
***************
*** 265,271 ****
PrintLock(¢ry.lock);
printf("\n");
}
! printf(" %d bytes\tDV %d refcnt %d\n", centry.Length,
centry.DataVersion, centry.refCount);
printf(" callback %08x\texpires %u\n", centry.callback,
centry.cbExpires);
--- 306,312 ----
PrintLock(¢ry.lock);
printf("\n");
}
! printf(" %012d bytes DV %012d refcnt %05d\n", centry.Length,
centry.DataVersion, centry.refCount);
printf(" callback %08x\texpires %u\n", centry.callback,
centry.cbExpires);
***************
*** 279,284 ****
--- 320,333 ----
printf("mount point");
else if (centry.mvstat == 2)
printf("volume root");
+ else if (centry.mvstat == 3) /* windows */
+ printf("directory");
+ else if (centry.mvstat == 4) /* windows */
+ printf("symlink");
+ else if (centry.mvstat == 5) /* windows */
+ printf("microsoft dfs link");
+ else if (centry.mvstat == 6) /* windows */
+ printf("invalid link");
else
printf("bogus mvstat %d", centry.mvstat);
printf("\n states (0x%x)", centry.states);
***************
*** 328,334 ****
continue;
}
! if (!aint32 && !IsLocked(¢ry.lock))
continue;
/* otherwise print this entry */
--- 377,385 ----
continue;
}
! if (aint32 == 0 && !IsLocked(¢ry.lock) ||
! aint32 == 2 && centry.refCount == 0 ||
! aint32 == 4 && centry.callback == 0)
continue;
/* otherwise print this entry */
***************
*** 348,357 ****
printf("\n");
}
#ifdef AFS_64BIT_ENV
! printf(" %lld bytes\tDV %d refcnt %d\n", centry.Length,
centry.DataVersion, centry.refCount);
#else
! printf(" %d bytes\tDV %d refcnt %d\n", centry.Length,
centry.DataVersion, centry.refCount);
#endif
printf(" callback %08x\texpires %u\n", centry.callback,
--- 399,408 ----
printf("\n");
}
#ifdef AFS_64BIT_ENV
! printf(" %012I64d bytes DV %012d refcnt %05d\n", centry.Length,
centry.DataVersion, centry.refCount);
#else
! printf(" %012d bytes DV %012d refcnt %05d\n", centry.Length,
centry.DataVersion, centry.refCount);
#endif
printf(" callback %08x\texpires %u\n", centry.callback,
***************
*** 366,372 ****
printf("mount point");
else if (centry.mvstat == 2)
printf("volume root");
! else
printf("bogus mvstat %d", centry.mvstat);
printf("\n states (0x%x)", centry.states);
if (centry.states & 1)
--- 417,431 ----
printf("mount point");
else if (centry.mvstat == 2)
printf("volume root");
! else if (centry.mvstat == 3)
! printf("directory");
! else if (centry.mvstat == 4)
! printf("symlink");
! else if (centry.mvstat == 5)
! printf("microsoft dfs link");
! else if (centry.mvstat == 6)
! printf("invalid link");
! else
printf("bogus mvstat %d", centry.mvstat);
printf("\n states (0x%x)", centry.states);
if (centry.states & 1)
***************
*** 401,409 ****
return PrintCacheEntries32(aconn, aint32);
}
! static
! CommandProc(as)
! struct cmd_syndesc *as;
{
struct rx_connection *conn;
register char *hostName;
--- 460,467 ----
return PrintCacheEntries32(aconn, aint32);
}
! int
! CommandProc(struct cmd_syndesc *as, char *arock)
{
struct rx_connection *conn;
register char *hostName;
***************
*** 431,460 ****
hostName);
exit(1);
}
! if (as->parms[3].items) {
/* -addrs */
PrintInterfaces(conn);
return 0;
}
! if (as->parms[4].items) {
/* -cache */
PrintCacheConfig(conn);
return 0;
}
if (as->parms[2].items)
int32p = 1;
else
int32p = 0;
! PrintLocks(conn, int32p);
! PrintCacheEntries(conn, int32p);
return 0;
}
#include "AFS_component_version_number.c"
! main(argc, argv)
! int argc;
! char **argv;
{
register struct cmd_syndesc *ts;
--- 489,529 ----
hostName);
exit(1);
}
! if (as->parms[5].items) {
/* -addrs */
PrintInterfaces(conn);
return 0;
}
! if (as->parms[6].items) {
/* -cache */
PrintCacheConfig(conn);
return 0;
}
if (as->parms[2].items)
+ /* -long */
int32p = 1;
+ else if (as->parms[3].items)
+ /* -refcounts */
+ int32p = 2;
+ else if (as->parms[4].items)
+ /* -callbacks */
+ int32p = 4;
else
int32p = 0;
!
! if (int32p == 0 || int32p == 1)
! PrintLocks(conn, int32p);
! if (int32p >= 0 || int32p <= 4)
! PrintCacheEntries(conn, int32p);
return 0;
}
+ #ifndef AFS_NT40_ENV
#include "AFS_component_version_number.c"
+ #endif
! int
! main(int argc, char **argv)
{
register struct cmd_syndesc *ts;
***************
*** 472,483 ****
--- 541,564 ----
nsa.sa_flags = SA_FULLDUMP;
sigaction(SIGSEGV, &nsa, NULL);
#endif
+
+ #ifdef AFS_NT40_ENV
+ if (afs_winsockInit() < 0) {
+ printf("%s: Couldn't initialize winsock. Exiting...\n", argv[0]);
+ return 1;
+ }
+ #endif
+
rx_Init(0);
ts = cmd_CreateSyntax(NULL, CommandProc, 0, "probe unik server");
cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
+ cmd_AddParm(ts, "-refcounts", CMD_FLAG, CMD_OPTIONAL,
+ "print only cache entries with positive reference counts");
+ cmd_AddParm(ts, "-callbacks", CMD_FLAG, CMD_OPTIONAL,
+ "print only cache entries with callbacks");
cmd_AddParm(ts, "-addrs", CMD_FLAG, CMD_OPTIONAL,
"print only host interfaces");
cmd_AddParm(ts, "-cache", CMD_FLAG, CMD_OPTIONAL,
Index: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.57.2.5 openafs/src/viced/host.c:1.57.2.6
*** openafs/src/viced/host.c:1.57.2.5 Thu Jul 28 16:52:21 2005
--- openafs/src/viced/host.c Mon Nov 28 22:41:48 2005
***************
*** 11,17 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.5 2005/07/28 20:52:21 shadow Exp $");
#include
#include
--- 11,17 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.6 2005/11/29 03:41:48 shadow Exp $");
#include
#include
***************
*** 895,912 ****
void
h_Enumerate_r(int (*proc) (), struct host *enumstart, char *param)
{
! register struct host *host;
! register int held;
if (hostCount == 0) {
return;
}
! for (host = enumstart; host; host = host->next) {
! if (!(held = h_Held_r(host)))
! h_Hold_r(host);
held = (*proc) (host, held, param);
if (!held)
! h_Release_r(host); /* this might free up the host */
}
} /*h_Enumerate_r */
--- 895,915 ----
void
h_Enumerate_r(int (*proc) (), struct host *enumstart, char *param)
{
! register struct host *host, *next;
! register int held, nheld;
if (hostCount == 0) {
return;
}
! if (!(held = h_Held_r(host)))
! h_Hold_r(host);
! for (host = enumstart; host; host = next, held = nheld) {
held = (*proc) (host, held, param);
+ next = host->next;
+ if (next && !(nheld = h_Held_r(next)))
+ h_Hold_r(next);
if (!held)
! h_Release_r(host); /* this might free up the host */
}
} /*h_Enumerate_r */
Index: openafs/src/vol/Makefile.in
diff -c openafs/src/vol/Makefile.in:1.18.2.1 openafs/src/vol/Makefile.in:1.18.2.2
*** openafs/src/vol/Makefile.in:1.18.2.1 Tue Dec 7 01:06:17 2004
--- openafs/src/vol/Makefile.in Tue Nov 1 11:45:44 2005
***************
*** 147,152 ****
--- 147,155 ----
hp?00_ux101 | hp_ux10? ) \
${CC} ${CFLAGS} -D_FILE64 -c ${srcdir}/listinodes.c \
;; \
+ hp_ux11* ) \
+ ${CC} ${CFLAGS} -D_FILE_OFFSET_BITS=64 -c ${srcdir}/listinodes.c \
+ ;; \
* ) ${CC} ${CFLAGS} -c ${srcdir}/listinodes.c \
;; \
esac
Index: openafs/src/vol/listinodes.c
diff -c openafs/src/vol/listinodes.c:1.13.2.2 openafs/src/vol/listinodes.c:1.13.2.3
*** openafs/src/vol/listinodes.c:1.13.2.2 Sun Apr 3 14:15:55 2005
--- openafs/src/vol/listinodes.c Tue Nov 1 11:45:44 2005
***************
*** 21,27 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/vol/listinodes.c,v 1.13.2.2 2005/04/03 18:15:55 shadow Exp $");
#ifndef AFS_NAMEI_ENV
#if defined(AFS_LINUX20_ENV) || defined(AFS_SUN4_ENV)
--- 21,27 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/vol/listinodes.c,v 1.13.2.3 2005/11/01 16:45:44 shadow Exp $");
#ifndef AFS_NAMEI_ENV
#if defined(AFS_LINUX20_ENV) || defined(AFS_SUN4_ENV)
***************
*** 109,114 ****
--- 109,136 ----
#endif
#include "partition.h"
+ /*@+fcnmacros +macrofcndecl@*/
+ #ifdef O_LARGEFILE
+ #ifdef S_SPLINT_S
+ extern off64_t afs_lseek(int FD, off64_t O, int F);
+ #endif /*S_SPLINT_S */
+ #define afs_lseek(FD, O, F) lseek64(FD, (off64_t) (O), F)
+ #define afs_stat stat64
+ #define afs_fstat fstat64
+ #define afs_open open64
+ #define afs_fopen fopen64
+ #else /* !O_LARGEFILE */
+ #ifdef S_SPLINT_S
+ extern off_t afs_lseek(int FD, off_t O, int F);
+ #endif /*S_SPLINT_S */
+ #define afs_lseek(FD, O, F) lseek(FD, (off_t) (O), F)
+ #define afs_stat stat
+ #define afs_fstat fstat
+ #define afs_open open
+ #define afs_fopen fopen
+ #endif /* !O_LARGEFILE */
+ /*@=fcnmacros =macrofcndecl@*/
+
/* Notice: parts of this module have been cribbed from vfsck.c */
#define ROOTINODE 2
***************
*** 248,254 ****
fmax = fs.s_fsize / (FSBSIZE / 512); /* first invalid blk num */
! pfd = open(rdev, O_RDONLY);
if (pfd < 0) {
Log("Unable to open `%s' inode for reading\n", rdev);
return -1;
--- 270,276 ----
fmax = fs.s_fsize / (FSBSIZE / 512); /* first invalid blk num */
! pfd = afs_open(rdev, O_RDONLY);
if (pfd < 0) {
Log("Unable to open `%s' inode for reading\n", rdev);
return -1;
***************
*** 359,365 ****
{
int pfd;
! pfd = open(devName, O_RDONLY);
if (pfd < 0) {
Log("Unable to open inode on %s for reading superblock.\n", devName);
return -1;
--- 381,387 ----
{
int pfd;
! pfd = afs_open(devName, O_RDONLY);
if (pfd < 0) {
Log("Unable to open inode on %s for reading superblock.\n", devName);
return -1;
***************
*** 797,803 ****
int_to_base64(stmp, renames[i].uniq));
for (tag = 2, j = 0; j < 64; tag++, j++) {
(void)sprintf(npath, "%s.%s", nbase, int_to_base64(stmp, tag));
! fd = open(npath, O_CREAT | O_EXCL | O_RDWR, 0);
if (fd > 0) {
close(fd);
break;
--- 819,825 ----
int_to_base64(stmp, renames[i].uniq));
for (tag = 2, j = 0; j < 64; tag++, j++) {
(void)sprintf(npath, "%s.%s", nbase, int_to_base64(stmp, tag));
! fd = afs_open(npath, O_CREAT | O_EXCL | O_RDWR, 0);
if (fd > 0) {
close(fd);
break;
***************
*** 1145,1151 ****
sleep(10);
#endif
! pfd = open(rdev, O_RDONLY);
if (pfd <= 0) {
sprintf(err1, "Could not open device %s to get inode list\n", rdev);
perror(err1);
--- 1167,1173 ----
sleep(10);
#endif
! pfd = afs_open(rdev, O_RDONLY);
if (pfd <= 0) {
sprintf(err1, "Could not open device %s to get inode list\n", rdev);
perror(err1);
***************
*** 1286,1295 ****
i = c * sblock.fs_ipg;
e = i + sblock.fs_ipg;
#if defined(AFS_HPUX102_ENV)
! if (lseek(pfd, dbtoo(fsbtodb(&sblock, itod(&sblock, i))), L_SET) ==
-1) {
#else
! if (lseek(pfd, dbtob(fsbtodb(&sblock, itod(&sblock, i))), L_SET) ==
-1) {
#endif
#else
--- 1308,1317 ----
i = c * sblock.fs_ipg;
e = i + sblock.fs_ipg;
#if defined(AFS_HPUX102_ENV)
! if (afs_lseek(pfd, dbtoo(fsbtodb(&sblock, itod(&sblock, i))), L_SET) ==
-1) {
#else
! if (afs_lseek(pfd, dbtob(fsbtodb(&sblock, itod(&sblock, i))), L_SET) ==
-1) {
#endif
#else
***************
*** 1307,1320 ****
e = i + super.fs.fs_ipg;
#ifdef AFS_OSF_ENV
dblk1 = fsbtodb(&super.fs, itod(&super.fs, i));
! if (lseek(pfd, (off_t) ((off_t) dblk1 * DEV_BSIZE), L_SET) == -1) {
#else
#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV)
f1 = fsbtodb(&super.fs, itod(&super.fs, i));
off = (offset_t) f1 << DEV_BSHIFT;
if (llseek(pfd, off, L_SET) == -1) {
#else
! if (lseek(pfd, dbtob(fsbtodb(&super.fs, itod(&super.fs, i))), L_SET)
== -1) {
#endif /* AFS_SUN5_ENV */
#endif /* AFS_OSF_ENV */
--- 1329,1342 ----
e = i + super.fs.fs_ipg;
#ifdef AFS_OSF_ENV
dblk1 = fsbtodb(&super.fs, itod(&super.fs, i));
! if (afs_lseek(pfd, (off_t) ((off_t) dblk1 * DEV_BSIZE), L_SET) == -1) {
#else
#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV)
f1 = fsbtodb(&super.fs, itod(&super.fs, i));
off = (offset_t) f1 << DEV_BSHIFT;
if (llseek(pfd, off, L_SET) == -1) {
#else
! if (afs_lseek(pfd, dbtob(fsbtodb(&super.fs, itod(&super.fs, i))), L_SET)
== -1) {
#endif /* AFS_SUN5_ENV */
#endif /* AFS_OSF_ENV */
***************
*** 1336,1342 ****
for (bj = bk = 0; bj < bufsize; bj = bj + 512, bk++) {
if ((code = read(pfd, dptr, 512)) != 512) {
Log("Error reading inode %d? for partition %s (errno = %d); run vfsck\n", bk + i, partition, errno);
! if (lseek(pfd, 512, L_SET) == -1) {
Log("Lseek failed\n");
goto out;
}
--- 1358,1364 ----
for (bj = bk = 0; bj < bufsize; bj = bj + 512, bk++) {
if ((code = read(pfd, dptr, 512)) != 512) {
Log("Error reading inode %d? for partition %s (errno = %d); run vfsck\n", bk + i, partition, errno);
! if (afs_lseek(pfd, 512, L_SET) == -1) {
Log("Lseek failed\n");
goto out;
}
***************
*** 1496,1507 ****
return -1;
}
#else /* AFS_AIX41_ENV */
! if (lseek(fd, blk * Bsize, 0) < 0) {
Log("Unable to seek to offset %u for block %u\n", blk * Bsize, blk);
}
#endif /* AFS_AIX41_ENV */
#else
! if (lseek(fd, (off_t) dbtob(blk), L_SET) < 0) {
Log("Unable to seek to offset %u for block %u\n", dbtob(blk), blk);
}
#endif
--- 1518,1529 ----
return -1;
}
#else /* AFS_AIX41_ENV */
! if (afs_lseek(fd, blk * Bsize, 0) < 0) {
Log("Unable to seek to offset %u for block %u\n", blk * Bsize, blk);
}
#endif /* AFS_AIX41_ENV */
#else
! if (afs_lseek(fd, (off_t) dbtob(blk), L_SET) < 0) {
Log("Unable to seek to offset %u for block %u\n", dbtob(blk), blk);
}
#endif
Index: openafs/src/vol/namei_ops.c
diff -c openafs/src/vol/namei_ops.c:1.21.2.3 openafs/src/vol/namei_ops.c:1.21.2.4
*** openafs/src/vol/namei_ops.c:1.21.2.3 Tue Nov 9 12:16:40 2004
--- openafs/src/vol/namei_ops.c Tue Nov 1 11:45:44 2005
***************
*** 13,19 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.3 2004/11/09 17:16:40 shadow Exp $");
#ifdef AFS_NAMEI_ENV
#include
--- 13,19 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.4 2005/11/01 16:45:44 shadow Exp $");
#ifdef AFS_NAMEI_ENV
#include
***************
*** 30,36 ****
#ifdef AFS_AIX_ENV
#include
#endif
! #ifdef AFS_SUN5_ENV
#include
#endif
#include
--- 30,36 ----
#ifdef AFS_AIX_ENV
#include
#endif
! #if defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
#include
#endif
#include
***************
*** 860,866 ****
namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
if (lockit) {
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
if (lockf(h->fd_fd, F_LOCK, 0) < 0)
#else
if (flock(h->fd_fd, LOCK_EX) < 0)
--- 860,866 ----
namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
if (lockit) {
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
if (lockf(h->fd_fd, F_LOCK, 0) < 0)
#else
if (flock(h->fd_fd, LOCK_EX) < 0)
***************
*** 879,885 ****
bad_getLinkByte:
if (lockit)
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
lockf(h->fd_fd, F_ULOCK, 0);
#else
flock(h->fd_fd, LOCK_UN);
--- 879,885 ----
bad_getLinkByte:
if (lockit)
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
lockf(h->fd_fd, F_ULOCK, 0);
#else
flock(h->fd_fd, LOCK_UN);
***************
*** 904,910 ****
return -1;
/* Only one manipulates at a time. */
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) {
#else
if (flock(fdP->fd_fd, LOCK_EX) < 0) {
--- 904,910 ----
return -1;
/* Only one manipulates at a time. */
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) {
#else
if (flock(fdP->fd_fd, LOCK_EX) < 0) {
***************
*** 944,950 ****
goto badGetFreeTag;
}
FDH_SYNC(fdP);
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
lockf(fdP->fd_fd, F_ULOCK, 0);
#else
flock(fdP->fd_fd, LOCK_UN);
--- 944,950 ----
goto badGetFreeTag;
}
FDH_SYNC(fdP);
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
lockf(fdP->fd_fd, F_ULOCK, 0);
#else
flock(fdP->fd_fd, LOCK_UN);
***************
*** 953,959 ****
return col;;
badGetFreeTag:
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
lockf(fdP->fd_fd, F_ULOCK, 0);
#else
flock(fdP->fd_fd, LOCK_UN);
--- 953,959 ----
return col;;
badGetFreeTag:
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
lockf(fdP->fd_fd, F_ULOCK, 0);
#else
flock(fdP->fd_fd, LOCK_UN);
***************
*** 980,986 ****
namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
if (!locked) {
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) {
#else
if (flock(fdP->fd_fd, LOCK_EX) < 0) {
--- 980,986 ----
namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
if (!locked) {
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) {
#else
if (flock(fdP->fd_fd, LOCK_EX) < 0) {
***************
*** 1023,1029 ****
bad_SetLinkCount:
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
lockf(fdP->fd_fd, F_ULOCK, 0);
#else
flock(fdP->fd_fd, LOCK_UN);
--- 1023,1029 ----
bad_SetLinkCount:
! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
lockf(fdP->fd_fd, F_ULOCK, 0);
#else
flock(fdP->fd_fd, LOCK_UN);