* privilege"?
*/
+#include <afsconfig.h>
#include <afs/param.h>
+
+RCSID("$Header$");
+
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <rx/rx.h>
#include <rx/rx_globals.h>
#include <sys/stat.h>
-#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
#include <sys/map.h>
#endif
#if !defined(AFS_NT40_ENV)
#include <sys/statfs.h>
#include <sys/lockf.h>
#else
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
#include <sys/dk.h>
#endif
#endif
struct afs_FSStats afs_fsstats;
-void ResetDebug(), SetDebug(), GetStatus(), Terminate();
+void ResetDebug(), SetDebug(), Terminate();
int CopyOnWrite(); /* returns 0 on success */
static TryLocalVLServer();
+void GetStatus(Vnode *targetptr, AFSFetchStatus *status, afs_int32 rights, afs_int32 anyrights, Vnode *parentptr);
+
/*
* Externals used by the xstat code.
*/
} /*SetVolumeSync*/
/*
- * This call overwrites the pointed-to rx_call with an rx_connection. This
- * is really bogus. Note that this function always returns a held host, so
+ * Note that this function always returns a held host, so
* that CallPostamble can block without the host's disappearing.
+ * Call returns rx connection in passed in *tconn
*/
-static CallPreamble(acall, activecall)
- register struct rx_call **acall;
+static CallPreamble(acall, activecall, tconn)
+ register struct rx_call *acall;
int activecall;
+ struct rx_connection **tconn;
{
struct host *thost;
- struct rx_connection *tconn;
struct client *tclient;
int retry_flag=1;
int code = 0;
- tconn = rx_ConnectionOf(*acall);
- *acall = (struct rx_call *)tconn; /* change it! */
+ char hoststr[16];
+ if (!tconn) {
+ ViceLog (0, ("CallPreamble: unexpected null tconn!\n"));
+ return -1;
+ }
+ *tconn = rx_ConnectionOf(acall);
H_LOCK
retry:
- tclient = h_FindClient_r(tconn);
+ tclient = h_FindClient_r(*tconn);
if (tclient->prfail == 1) { /* couldn't get the CPS */
if (!retry_flag) {
h_ReleaseClient_r(tclient);
h_Lock_r(thost);
if (thost->hostFlags & HOSTDELETED) {
- ViceLog(3,("Discarded a packet for deleted host %08x\n",thost->host));
+ ViceLog(3,("Discarded a packet for deleted host %s\n",afs_inet_ntoa_r(thost->host,hoststr)));
code = VBUSY; /* raced, so retry */
}
else if (thost->hostFlags & VENUSDOWN) {
if (BreakDelayedCallBacks_r(thost)) {
- ViceLog(0,("BreakDelayedCallbacks FAILED for host %08x which IS UP. Possible network or routing failure.\n",thost->host));
+ ViceLog(0,("BreakDelayedCallbacks FAILED for host %s which IS UP. Possible network or routing failure.\n",
+ afs_inet_ntoa_r(thost->host, hoststr)));
if ( MultiProbeAlternateAddress_r (thost) ) {
- ViceLog(0, ("MultiProbe failed to find new address for host %x.%d\n",
- thost->host, thost->port));
+ ViceLog(0, ("MultiProbe failed to find new address for host %s:%d\n",
+ afs_inet_ntoa_r(thost->host, hoststr), thost->port));
code = -1;
} else {
- ViceLog(0, ("MultiProbe found new address for host %x.%d\n",
- thost->host, thost->port));
+ ViceLog(0, ("MultiProbe found new address for host %s:%d\n",
+ afs_inet_ntoa_r(thost->host, hoststr), thost->port));
if (BreakDelayedCallBacks_r(thost)) {
- ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %08x which IS UP. Possible network or routing failure.\n",thost->host));
+ ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %s which IS UP. Possible network or routing failure.\n",
+ afs_inet_ntoa_r(thost->host, hoststr)));
code = -1;
}
}
} /*VolumeRootVnode*/
-SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_FetchData (acall, Fid, Pos, Len, OutStatus, CallBack, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to fetch */
afs_int32 Pos, Len; /* Not implemented yet */
struct AFSFetchStatus *OutStatus; /* Returned status for Fid */
struct AFSVolSync *Sync; /* synchronization info */
{
+ int code;
+
+ code = common_FetchData (acall, Fid, Pos, Len, OutStatus,
+ CallBack, Sync, 0);
+ return code;
+}
+
+SRXAFS_FetchData64 (acall, Fid, Pos, Len, OutStatus, CallBack, Sync)
+ struct rx_call *acall; /* Rx call */
+ struct AFSFid *Fid; /* Fid of file to fetch */
+ afs_int64 Pos, Len; /* Not implemented yet */
+ struct AFSFetchStatus *OutStatus; /* Returned status for Fid */
+ struct AFSCallBack *CallBack; /* If r/w return CB for Fid */
+ struct AFSVolSync *Sync; /* synchronization info */
+{
+ int code;
+ afs_int32 tPos, tLen;
+
+#ifdef AFS_64BIT_ENV
+ if (Pos + Len > 0x7fffffff)
+ return E2BIG;
+ tPos = Pos;
+ tLen = Len;
+#else /* AFS_64BIT_ENV */
+ if (Pos.high || Len.high)
+ return E2BIG;
+ tPos = Pos.low;
+ tLen = Len.low;
+#endif /* AFS_64BIT_ENV */
+
+ code = common_FetchData (acall, Fid, tPos, tLen, OutStatus,
+ CallBack, Sync, 1);
+ return code;
+}
+
+common_FetchData (acall, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
+ struct rx_call *acall; /* Rx call */
+ struct AFSFid *Fid; /* Fid of file to fetch */
+ afs_int32 Pos, Len; /* Not implemented yet */
+ struct AFSFetchStatus *OutStatus; /* Returned status for Fid */
+ struct AFSCallBack *CallBack; /* If r/w return CB for Fid */
+ struct AFSVolSync *Sync; /* synchronization info */
+ int type; /* 32 bit or 64 bit call */
+
+{
Vnode * targetptr = 0; /* pointer to vnode to fetch */
Vnode * parentwhentargetnotdir = 0; /* parent vnode if vptr is a file */
Vnode tparentwhentargetnotdir; /* parent vnode for GetStatus */
int fileCode = 0; /* return code from vol package */
Volume * volptr = 0; /* pointer to the volume */
struct client *client; /* pointer to the client data */
- struct rx_call *tcall; /* the call we're a part of */
+ struct rx_connection *tcon; /* the connection we're part of */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
AFSCallStats.FetchData++, AFSCallStats.TotalCalls++;
FS_UNLOCK
- /* CallPreamble changes tcon from a call to a conn */
- tcall = (struct rx_call *) tcon;
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_FetchData;
/* Get ptr to client data for user Id for logging */
/* Check whether the caller has permission access to fetch the data */
if (errorCode = Check_PermissionRights(targetptr, client, rights,
- CHK_FETCHDATA, 0))
+ CHK_FETCHDATA, 0))
goto Bad_FetchData;
/*
/* actually do the data transfer */
#if FS_STATS_DETAILED
- errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len,
+ errorCode = FetchData_RXStyle(volptr, targetptr, acall, Pos, Len, type,
&bytesToXfer, &bytesXferred);
#else
- if (errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len))
+ if (errorCode = FetchData_RXStyle(volptr, targetptr, acall, Pos, Len, type))
goto Bad_FetchData;
#endif /* FS_STATS_DETAILED */
SetCallBackStruct(AddCallBack(client->host, Fid), CallBack);
else {
struct AFSFid myFid;
- bzero(&myFid, sizeof(struct AFSFid));
+ memset(&myFid, 0, sizeof(struct AFSFid));
myFid.Volume = Fid->Volume;
SetCallBackStruct(AddVolCallBack(client->host, &myFid), CallBack);
}
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU (acall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END);
return(errorCode);
} /*SRXAFS_FetchData*/
-SRXAFS_FetchACL (tcon, Fid, AccessList, OutStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_FetchACL (acall, Fid, AccessList, OutStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of target dir */
struct AFSOpaque *AccessList; /* Returned contents of dir's ACL */
struct AFSFetchStatus *OutStatus; /* Returned status for the dir */
-
+ struct AFSVolSync *Sync;
{
Vnode * targetptr = 0; /* pointer to vnode to fetch */
Vnode * parentwhentargetnotdir = 0; /* parent vnode if targetptr is a file */
Volume * volptr = 0; /* pointer to the volume */
struct client *client; /* pointer to the client data */
afs_int32 rights, anyrights; /* rights for this and any user */
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
FS_LOCK
AFSCallStats.FetchACL++, AFSCallStats.TotalCalls++;
FS_UNLOCK
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_FetchACL;
/* Get ptr to client data for user Id for logging */
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU (acall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END);
return errorCode;
} /*SRXAFS_FetchACL*/
* This routine is called exclusively by SRXAFS_FetchStatus(), and should be
* merged into it when possible.
*/
-SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync)
+ struct rx_call *acall;
struct AFSFid *Fid; /* Fid of target file */
struct AFSFetchStatus *OutStatus; /* Returned status for the fid */
struct AFSCallBack *CallBack; /* if r/w, callback promise for Fid */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
/* Are we allowed to fetch Fid's status? */
if (targetptr->disk.type != vDirectory) {
if (errorCode = Check_PermissionRights(targetptr, client, rights,
- CHK_FETCHSTATUS, 0))
- goto Bad_FetchStatus;
+ CHK_FETCHSTATUS, 0)) {
+ if (rx_GetCallAbortCode(acall) == errorCode)
+ rx_SetCallAbortCode(acall, 0);
+ goto Bad_FetchStatus;
+ }
}
/* set OutStatus From the Fid */
SetCallBackStruct(AddCallBack(client->host, Fid), CallBack);
else {
struct AFSFid myFid;
- bzero(&myFid, sizeof(struct AFSFid));
+ memset(&myFid, 0, sizeof(struct AFSFid));
myFid.Volume = Fid->Volume;
SetCallBackStruct(AddVolCallBack(client->host, &myFid), CallBack);
}
} /*SAFSS_FetchStatus*/
-SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
- struct rx_connection *tcon;
+SRXAFS_BulkStatus(acall, Fids, OutStats, CallBacks, Sync)
+ struct rx_call *acall;
struct AFSCBFids *Fids;
struct AFSBulkStats *OutStats;
struct AFSCBs *CallBacks;
struct client *client; /* pointer to the client data */
afs_int32 rights, anyrights; /* rights for this and any user */
register struct AFSFid *tfid; /* file id we're dealing with now */
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
malloc(nfiles * sizeof(struct AFSCallBack));
CallBacks->AFSCBs_len = nfiles;
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_BulkStatus;
tfid = Fids->AFSCBFids_val;
/* Are we allowed to fetch Fid's status? */
if (targetptr->disk.type != vDirectory) {
- if (errorCode = Check_PermissionRights(targetptr, client, rights,
- CHK_FETCHSTATUS, 0))
- goto Bad_BulkStatus;
+ if (errorCode = Check_PermissionRights(targetptr, client, rights,
+ CHK_FETCHSTATUS, 0)) {
+ if (rx_GetCallAbortCode(acall) == errorCode)
+ rx_SetCallAbortCode(acall, 0);
+ goto Bad_BulkStatus;
+ }
}
/* set OutStatus From the Fid */
&CallBacks->AFSCBs_val[i]);
else {
struct AFSFid myFid;
- bzero(&myFid, sizeof(struct AFSFid));
+ memset(&myFid, 0, sizeof(struct AFSFid));
myFid.Volume = tfid->Volume;
SetCallBackStruct(AddVolCallBack(client->host, &myFid),
&CallBacks->AFSCBs_val[i]);
Audit_and_Return:
ViceLog(2, ("SAFS_BulkStatus returns %d\n", errorCode));
- osi_auditU (tcall, BulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
+ osi_auditU (acall, BulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
return errorCode;
} /*SRXAFS_BulkStatus*/
-SRXAFS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
+SRXAFS_InlineBulkStatus(acall, Fids, OutStats, CallBacks, Sync)
+ struct rx_call *acall;
+ struct AFSCBFids *Fids;
+ struct AFSBulkStats *OutStats;
+ struct AFSCBs *CallBacks;
struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+{
+ register int i;
+ afs_int32 nfiles;
+ Vnode * targetptr = 0; /* pointer to vnode to fetch */
+ Vnode * parentwhentargetnotdir = 0; /* parent vnode if targetptr is a file */
+ int errorCode = 0; /* return code to caller */
+ Volume * volptr = 0; /* pointer to the volume */
+ struct client *client; /* pointer to the client data */
+ afs_int32 rights, anyrights; /* rights for this and any user */
+ register struct AFSFid *tfid; /* file id we're dealing with now */
+ struct rx_connection *tcon;
+ AFSFetchStatus *tstatus;
+#if FS_STATS_DETAILED
+ struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
+ struct timeval opStartTime,
+ opStopTime; /* Start/stop times for RPC op*/
+ struct timeval elapsedTime; /* Transfer time */
+
+ /*
+ * Set our stats pointer, remember when the RPC operation started, and
+ * tally the operation.
+ */
+ opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_BULKSTATUS]);
+ FS_LOCK
+ (opP->numOps)++;
+ FS_UNLOCK
+ TM_GetTimeOfDay(&opStartTime, 0);
+#endif /* FS_STATS_DETAILED */
+
+ ViceLog(1, ("SAFS_InlineBulkStatus\n"));
+ FS_LOCK
+ AFSCallStats.TotalCalls++;
+ FS_UNLOCK
+
+ nfiles = Fids->AFSCBFids_len; /* # of files in here */
+ if (nfiles <= 0) { /* Sanity check */
+ errorCode = EINVAL;
+ goto Audit_and_Return;
+ }
+
+ /* allocate space for return output parameters */
+ OutStats->AFSBulkStats_val = (struct AFSFetchStatus *)
+ malloc(nfiles * sizeof(struct AFSFetchStatus));
+ OutStats->AFSBulkStats_len = nfiles;
+ CallBacks->AFSCBs_val = (struct AFSCallBack *)
+ malloc(nfiles * sizeof(struct AFSCallBack));
+ CallBacks->AFSCBs_len = nfiles;
+
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon)) {
+ goto Bad_InlineBulkStatus;
+ }
+
+ tfid = Fids->AFSCBFids_val;
+ for (i=0; i<nfiles; i++, tfid++) {
+ /*
+ * Get volume/vnode for the fetched file; caller's rights to it
+ * are also returned
+ */
+ if (errorCode =
+ GetVolumePackage(tcon, tfid, &volptr, &targetptr,
+ DONTCHECK, &parentwhentargetnotdir, &client,
+ READ_LOCK, &rights, &anyrights)) {
+ tstatus = &OutStats->AFSBulkStats_val[i];
+ tstatus->errorCode = errorCode;
+ parentwhentargetnotdir = (Vnode *) 0;
+ targetptr = (Vnode *) 0;
+ volptr = (Volume *) 0;
+ continue;
+ }
+
+ /* set volume synchronization information, but only once per call */
+ if (i == nfiles)
+ SetVolumeSync(Sync, volptr);
+
+ /* Are we allowed to fetch Fid's status? */
+ if (targetptr->disk.type != vDirectory) {
+ if (errorCode = Check_PermissionRights(targetptr, client, rights,
+ CHK_FETCHSTATUS, 0)) {
+ tstatus = &OutStats->AFSBulkStats_val[i];
+ tstatus->errorCode = errorCode;
+ PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+ parentwhentargetnotdir = (Vnode *) 0;
+ targetptr = (Vnode *) 0;
+ volptr = (Volume *) 0;
+ continue;
+ }
+ }
+
+ /* set OutStatus From the Fid */
+ GetStatus(targetptr, (struct AFSFetchStatus *) &OutStats->AFSBulkStats_val[i],
+ rights, anyrights, parentwhentargetnotdir);
+
+ /* If a r/w volume, also set the CallBack state */
+ if (VolumeWriteable(volptr))
+ SetCallBackStruct(AddBulkCallBack(client->host, tfid),
+ &CallBacks->AFSCBs_val[i]);
+ else {
+ struct AFSFid myFid;
+ memset(&myFid, 0, sizeof(struct AFSFid));
+ myFid.Volume = tfid->Volume;
+ SetCallBackStruct(AddVolCallBack(client->host, &myFid),
+ &CallBacks->AFSCBs_val[i]);
+ }
+
+ /* put back the file ID and volume */
+ PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+ parentwhentargetnotdir = (Vnode *) 0;
+ targetptr = (Vnode *) 0;
+ volptr = (Volume *) 0;
+ }
+
+Bad_InlineBulkStatus:
+ /* Update and store volume/vnode and parent vnodes back */
+ PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+ CallPostamble(tcon);
+
+#if FS_STATS_DETAILED
+ TM_GetTimeOfDay(&opStopTime, 0);
+ if (errorCode == 0) {
+ FS_LOCK
+ (opP->numSuccesses)++;
+ fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
+ fs_stats_AddTo((opP->sumTime), elapsedTime);
+ fs_stats_SquareAddTo((opP->sqrTime), elapsedTime);
+ if (fs_stats_TimeLessThan(elapsedTime, (opP->minTime))) {
+ fs_stats_TimeAssign((opP->minTime), elapsedTime);
+ }
+ if (fs_stats_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
+ fs_stats_TimeAssign((opP->maxTime), elapsedTime);
+ }
+ FS_UNLOCK
+ }
+
+#endif /* FS_STATS_DETAILED */
+
+Audit_and_Return:
+ ViceLog(2, ("SAFS_InlineBulkStatus returns %d\n", errorCode));
+ osi_auditU (acall, InlineBulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
+ return 0;
+
+} /*SRXAFS_InlineBulkStatus*/
+
+
+SRXAFS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of target file */
struct AFSFetchStatus *OutStatus; /* Returned status for the fid */
struct AFSCallBack *CallBack; /* if r/w, callback promise for Fid */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_FetchStatus;
- code = SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync);
+ code = SAFSS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync);
Bad_FetchStatus:
CallPostamble(tcon);
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END);
+ osi_auditU (acall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_FetchStatus*/
-SRXAFS_StoreData (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection Handle */
+SRXAFS_StoreData (acall, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of taret file */
struct AFSStoreStatus *InStatus; /* Input Status for Fid */
- afs_int32 Pos; /* Not implemented yet */
- afs_int32 Length; /* Length of data to store */
- afs_int32 FileLength; /* Length of file after store */
+ afs_uint32 Pos; /* Not implemented yet */
+ afs_uint32 Length; /* Length of data to store */
+ afs_uint32 FileLength; /* Length of file after store */
struct AFSFetchStatus *OutStatus; /* Returned status for target fid */
-
+ struct AFSVolSync *Sync;
{
Vnode * targetptr = 0; /* pointer to input fid */
Vnode * parentwhentargetnotdir = 0; /* parent of Fid to get ACL */
int fileCode = 0; /* return code from vol package */
Volume * volptr = 0; /* pointer to the volume header */
struct client * client; /* pointer to client structure */
- struct rx_call *tcall; /* remember the call structure for ftp */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct fs_stats_xferData *xferP; /* Ptr to this op's byte size struct */
FS_LOCK
AFSCallStats.StoreData++, AFSCallStats.TotalCalls++;
FS_UNLOCK
- /* CallPreamble changes tcon from a call to a conn */
- tcall = (struct rx_call *) tcon;
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_StoreData;
/* Get ptr to client data for user Id for logging */
/* Do the actual storing of the data */
#if FS_STATS_DETAILED
- errorCode = StoreData_RXStyle(volptr, targetptr, Fid, client, tcall,
+ errorCode = StoreData_RXStyle(volptr, targetptr, Fid, client, acall,
Pos, Length, FileLength,
(InStatus->Mask & AFS_FSYNC),
&bytesToXfer, &bytesXferred);
#else
errorCode = StoreData_RXStyle(volptr, targetptr, Fid, client,
- tcall, Pos, Length, FileLength,
+ acall, Pos, Length, FileLength,
(InStatus->Mask & AFS_FSYNC));
if (errorCode && (!targetptr->changed_newTime))
goto Bad_StoreData;
}
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU (acall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END);
return(errorCode);
} /*SRXAFS_StoreData*/
-
-SRXAFS_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
+SRXAFS_StoreData64 (acall, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
+ struct rx_call *acall; /* Rx call */
+ struct AFSFid *Fid; /* Fid of taret file */
+ struct AFSStoreStatus *InStatus; /* Input Status for Fid */
+ afs_uint64 Pos; /* Not implemented yet */
+ afs_uint64 Length; /* Length of data to store */
+ afs_uint64 FileLength; /* Length of file after store */
+ struct AFSFetchStatus *OutStatus; /* Returned status for target fid */
struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+{
+ int code;
+ afs_int32 tPos;
+ afs_int32 tLength;
+ afs_int32 tFileLength;
+
+#ifdef AFS_64BIT_ENV
+ if (FileLength > 0x7fffffff)
+ return E2BIG;
+ tPos = Pos;
+ tLength = Length;
+ tFileLength = FileLength;
+#else /* AFS_64BIT_ENV */
+ if (FileLength.high)
+ return E2BIG;
+ tPos = Pos.low;
+ tLength = Length.low;
+ tFileLength = FileLength.low;
+#endif /* AFS_64BIT_ENV */
+
+ code = SRXAFS_StoreData (acall, Fid, InStatus, tPos, tLength, tFileLength,
+ OutStatus, Sync);
+ return code;
+}
+
+SRXAFS_StoreACL (acall, Fid, AccessList, OutStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Target dir's fid */
struct AFSOpaque *AccessList; /* Access List's contents */
struct AFSFetchStatus *OutStatus; /* Returned status of fid */
-
+ struct AFSVolSync *Sync;
{
Vnode * targetptr = 0; /* pointer to input fid */
Vnode * parentwhentargetnotdir = 0; /* parent of Fid to get ACL */
Volume * volptr = 0; /* pointer to the volume header */
struct client * client; /* pointer to client structure */
afs_int32 rights, anyrights; /* rights for this and any user */
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
FS_UNLOCK
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_StoreACL;
/* Get ptr to client data for user Id for logging */
BreakCallBack(client->host, Fid, 0);
/* Get the updated dir's status back to the caller */
- GetStatus(targetptr, OutStatus, rights, anyrights, (struct vnode *)0);
+ GetStatus(targetptr, OutStatus, rights, anyrights, 0);
Bad_StoreACL:
/* Update and store volume/vnode and parent vnodes back */
}
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU (acall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END);
return errorCode;
} /*SRXAFS_StoreACL*/
* Note: This routine is called exclusively from SRXAFS_StoreStatus(), and
* should be merged when possible.
*/
-SAFSS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync)
- struct rx_connection *tcon; /* Rx connection Handle */
+SAFSS_StoreStatus (acall, Fid, InStatus, OutStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Target file's fid */
struct AFSStoreStatus *InStatus; /* Input status for Fid */
struct AFSFetchStatus *OutStatus; /* Output status for fid */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
} /*SAFSS_StoreStatus*/
-SRXAFS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection Handle */
+SRXAFS_StoreStatus (acall, Fid, InStatus, OutStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Target file's fid */
struct AFSStoreStatus *InStatus; /* Input status for Fid */
struct AFSFetchStatus *OutStatus; /* Output status for fid */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_StoreStatus;
- code = SAFSS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync);
+ code = SAFSS_StoreStatus (acall, Fid, InStatus, OutStatus, Sync);
Bad_StoreStatus:
CallPostamble(tcon);
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END);
+ osi_auditU (acall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_StoreStatus*/
* This routine is called exclusively by SRXAFS_RemoveFile(), and should be
* merged in when possible.
*/
-SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_RemoveFile (acall, DirFid, Name, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Dir fid for file to remove */
char *Name; /* File name to remove */
struct AFSFetchStatus *OutDirStatus; /* Output status for dir fid's */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
#endif /* FS_STATS_DETAILED */
/* Return the updated parent dir's status back to caller */
- GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+ GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
/* Handle internal callback state for the parent and the deleted file */
if (targetptr->disk.linkCount == 0) {
} /*SAFSS_RemoveFile*/
-SRXAFS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_RemoveFile (acall, DirFid, Name, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Dir fid for file to remove */
char *Name; /* File name to remove */
struct AFSFetchStatus *OutDirStatus; /* Output status for dir fid's */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_RemoveFile;
- code = SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync);
+ code = SAFSS_RemoveFile (acall, DirFid, Name, OutDirStatus, Sync);
Bad_RemoveFile:
CallPostamble(tcon);
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ osi_auditU (acall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_RemoveFile*/
* This routine is called exclusively from SRXAFS_CreateFile(), and should
* be merged in when possible.
*/
-SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
+SAFSS_CreateFile (acall, DirFid, Name, InStatus, OutFid, OutFidStatus,
OutDirStatus, CallBack, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent Dir fid */
char *Name; /* File name to be created */
struct AFSStoreStatus *InStatus; /* Input status for newly created file */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
/* set up the return status for the parent dir and the newly created file */
GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
- GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+ GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
} /*SAFSS_CreateFile*/
-SRXAFS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_CreateFile (acall, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent Dir fid */
char *Name; /* File name to be created */
struct AFSStoreStatus *InStatus; /* Input status for newly created file */
struct AFSFetchStatus *OutFidStatus; /* Output status for new file */
struct AFSFetchStatus *OutDirStatus; /* Ouput status for the parent dir */
struct AFSCallBack *CallBack; /* Return callback promise for new file */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_CreateFile;
- code = SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid,
+ code = SAFSS_CreateFile (acall, DirFid, Name, InStatus, OutFid,
OutFidStatus, OutDirStatus, CallBack, Sync);
Bad_CreateFile:
}
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ osi_auditU (acall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_CreateFile*/
* This routine is called exclusively from SRXAFS_Rename(), and should be
* merged in when possible.
*/
-SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
+SAFSS_Rename (acall, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
OutNewDirStatus, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+ struct rx_call *acall; /* Rx call */
struct AFSFid *OldDirFid; /* From parent dir's fid */
char *OldName; /* From file name */
struct AFSFid *NewDirFid; /* To parent dir's fid */
int code;
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
V_parentId(volptr));
IH_RELEASE(newfileptr->handle);
if (errorCode == -1) {
- ViceLog(0, ("Del: inode=%d, name=%s, errno=%d\n",
+ ViceLog(0, ("Del: inode=%s, name=%s, errno=%d\n",
PrintInode(NULL, VN_GET_INO(newfileptr)),
NewName, errno));
if ((errno != ENOENT) && (errno != EIO) && (errno != ENXIO))
}
/* set up return status */
- GetStatus(oldvptr, OutOldDirStatus, rights, anyrights, (struct vnode *)0);
- GetStatus(newvptr, OutNewDirStatus, newrights, newanyrights, (struct vnode *)0);
+ GetStatus(oldvptr, OutOldDirStatus, rights, anyrights, 0);
+ GetStatus(newvptr, OutNewDirStatus, newrights, newanyrights, 0);
if (newfileptr && doDelete) {
DeleteFileCallBacks(&newFileFid); /* no other references */
}
} /*SAFSS_Rename*/
-SRXAFS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus, OutNewDirStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_Rename (acall, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus, OutNewDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *OldDirFid; /* From parent dir's fid */
char *OldName; /* From file name */
struct AFSFid *NewDirFid; /* To parent dir's fid */
char *NewName; /* To new file name */
struct AFSFetchStatus *OutOldDirStatus; /* Output status for From parent dir */
struct AFSFetchStatus *OutNewDirStatus; /* Output status for To parent dir */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_Rename;
- code = SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName,
+ code = SAFSS_Rename (acall, OldDirFid, OldName, NewDirFid, NewName,
OutOldDirStatus, OutNewDirStatus, Sync);
Bad_Rename:
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR, OldName, AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
+ osi_auditU (acall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR, OldName, AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
return code;
} /*SRXAFS_Rename*/
* This routine is called exclusively by SRXAFS_Symlink(), and should be
* merged into it when possible.
*/
-SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_Symlink (acall, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* File name to create */
char *LinkContents; /* Contents of the new created file */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
FdHandle_t *fdP;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
}
/*
- * If we're creating a mount point (owner mode bits sans x bit), we must
- * have administer access to the directory, too. Always allow sysadmins
+ * If we're creating a mount point (any x bits clear), we must have
+ * administer access to the directory, too. Always allow sysadmins
* to do this.
*/
- if ((InStatus->Mask & AFS_SETMODE) && !(InStatus->UnixModeBits & 0100)) {
+ if ((InStatus->Mask & AFS_SETMODE) && !(InStatus->UnixModeBits & 0111)) {
/*
- * We have a symlink, 'cause we're trying to set the Unix mode bits
- * to something without the owner x bits (default mode bits if
- * AFS_SETMODE is false is 0777)
+ * We have a mountpoint, 'cause we're trying to set the Unix mode
+ * bits to something with some x bits missing (default mode bits
+ * if AFS_SETMODE is false is 0777)
*/
if (VanillaUser(client) && !(rights & PRSFS_ADMINISTER)) {
errorCode = EACCES;
* to caller.
*/
GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
- GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+ GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
} /*SAFSS_Symlink*/
-SRXAFS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
+SRXAFS_Symlink (acall, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* File name to create */
char *LinkContents; /* Contents of the new created file */
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_Symlink;
- code = SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid,
+ code = SAFSS_Symlink (acall, DirFid, Name, LinkContents, InStatus, OutFid,
OutFidStatus, OutDirStatus, Sync);
Bad_Symlink:
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ osi_auditU (acall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_Symlink*/
* This routine is called exclusively by SRXAFS_Link(), and should be
* merged into it when possible.
*/
-SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_Link (acall, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* File name to create */
struct AFSFid *ExistingFid; /* Fid of existing fid we'll make link to */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
/* set up return status */
GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
- GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+ GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
/* convert the write locks to read locks before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
} /*SAFSS_Link*/
-SRXAFS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_Link (acall, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* File name to create */
struct AFSFid *ExistingFid; /* Fid of existing fid we'll make link to */
struct AFSFetchStatus *OutFidStatus; /* Output status for newly created file */
struct AFSFetchStatus *OutDirStatus; /* Outpout status for parent dir */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_Link;
- code = SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus,
+ code = SAFSS_Link (acall, DirFid, Name, ExistingFid, OutFidStatus,
OutDirStatus, Sync);
Bad_Link:
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_FID, ExistingFid, AUD_END);
+ osi_auditU (acall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_FID, ExistingFid, AUD_END);
return code;
} /*SRXAFS_Link*/
* This routine is called exclusively by SRXAFS_MakeDir(), and should be
* merged into it when possible.
*/
-SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
+SAFSS_MakeDir (acall, DirFid, Name, InStatus, OutFid, OutFidStatus,
OutDirStatus, CallBack, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* Name of dir to be created */
struct AFSStoreStatus *InStatus; /* Input status for new dir */
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
assert((SetAccessList(&targetptr, &volptr, &newACL, &newACLSize,
&parentwhentargetnotdir, (AFSFid *)0, 0)) == 0);
assert(parentwhentargetnotdir == 0);
- bcopy((char *)VVnodeACL(parentptr), (char *)newACL, VAclSize(parentptr));
+ memcpy((char *)newACL, (char *)VVnodeACL(parentptr), VAclSize(parentptr));
/* update the status for the target vnode */
Update_TargetVnodeStatus(targetptr, TVS_MKDIR, client, InStatus,
} /*SAFSS_MakeDir*/
-SRXAFS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_MakeDir (acall, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* Name of dir to be created */
struct AFSStoreStatus *InStatus; /* Input status for new dir */
struct AFSFetchStatus *OutFidStatus; /* Output status for new directory */
struct AFSFetchStatus *OutDirStatus; /* Output status for parent dir */
struct AFSCallBack *CallBack; /* Returned callback promise for new dir */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
FS_UNLOCK
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_MakeDir;
code = SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid,
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ osi_auditU (acall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_MakeDir*/
* This routine is called exclusively by SRXAFS_RemoveDir(), and should be
* merged into it when possible.
*/
-SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_RemoveDir (acall, DirFid, Name, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* (Empty) dir's name to be removed */
struct AFSFetchStatus *OutDirStatus; /* Output status for the parent dir */
Vnode debugvnode1, debugvnode2;
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
} /*SAFSS_RemoveDir*/
-SRXAFS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_RemoveDir (acall, DirFid, Name, OutDirStatus, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* (Empty) dir's name to be removed */
struct AFSFetchStatus *OutDirStatus; /* Output status for the parent dir */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_RemoveDir;
code = SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync);
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ osi_auditU (acall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_RemoveDir*/
* This routine is called exclusively by SRXAFS_SetLock(), and should be
* merged into it when possible.
*/
-SAFSS_SetLock (tcon, Fid, type, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_SetLock (acall, Fid, type, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to lock */
ViceLockType type; /* Type of lock (Read or write) */
struct AFSVolSync *Sync;
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
static char * locktype[2] = {"LockRead","LockWrite"};
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
if (type != LockRead && type != LockWrite) {
errorCode = EINVAL;
} /*SAFSS_SetLock*/
-SRXAFS_OldSetLock(tcon, Fid, type, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_OldSetLock(acall, Fid, type, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to lock */
ViceLockType type; /* Type of lock (Read or write) */
-
+ struct AFSVolSync *Sync;
{
- return SRXAFS_SetLock(tcon, Fid, type, Sync);
+ return SRXAFS_SetLock(acall, Fid, type, Sync);
} /*SRXAFS_OldSetLock*/
-SRXAFS_SetLock (tcon, Fid, type, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_SetLock (acall, Fid, type, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to lock */
ViceLockType type; /* Type of lock (Read or write) */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_SetLock;
code = SAFSS_SetLock (tcon, Fid, type, Sync);
}
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type, AUD_END);
+ osi_auditU (acall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type, AUD_END);
return code;
} /*SRXAFS_SetLock*/
* This routine is called exclusively by SRXAFS_ExtendLock(), and should be
* merged into it when possible.
*/
-SAFSS_ExtendLock (tcon, Fid, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_ExtendLock (acall, Fid, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file whose lock we extend */
struct AFSVolSync *Sync;
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
} /*SAFSS_ExtendLock*/
-SRXAFS_OldExtendLock (tcon, Fid, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_OldExtendLock (acall, Fid, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file whose lock we extend */
-
+ struct AFSVolSync *Sync;
{
- return SRXAFS_ExtendLock(tcon, Fid, Sync);
+ return SRXAFS_ExtendLock(acall, Fid, Sync);
} /*SRXAFS_OldExtendLock*/
-SRXAFS_ExtendLock (tcon, Fid, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_ExtendLock (acall, Fid, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file whose lock we extend */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_ExtendLock;
code = SAFSS_ExtendLock (tcon, Fid, Sync);
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, ExtendLockEvent, code, AUD_FID, Fid , AUD_END);
+ osi_auditU (acall, ExtendLockEvent, code, AUD_FID, Fid , AUD_END);
return code;
} /*SRXAFS_ExtendLock*/
* This routine is called exclusively by SRXAFS_ReleaseLock(), and should be
* merged into it when possible.
*/
-SAFSS_ReleaseLock (tcon, Fid, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_ReleaseLock (acall, Fid, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to release lock */
struct AFSVolSync *Sync;
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
/* Get ptr to client data for user Id for logging */
t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key);
} /*SAFSS_ReleaseLock*/
-SRXAFS_OldReleaseLock (tcon, Fid, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_OldReleaseLock (acall, Fid, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to release lock */
-
+ struct AFSVolSync *Sync;
{
- return SRXAFS_ReleaseLock(tcon, Fid, Sync);
+ return SRXAFS_ReleaseLock(acall, Fid, Sync);
} /*SRXAFS_OldReleaseLock*/
-SRXAFS_ReleaseLock (tcon, Fid, Sync)
- struct AFSVolSync *Sync;
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_ReleaseLock (acall, Fid, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *Fid; /* Fid of file to release lock */
-
+ struct AFSVolSync *Sync;
{
afs_int32 code;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_ReleaseLock;
code = SAFSS_ReleaseLock (tcon, Fid, Sync);
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, ReleaseLockEvent, code, AUD_FID, Fid , AUD_END);
+ osi_auditU (acall, ReleaseLockEvent, code, AUD_FID, Fid , AUD_END);
return code;
} /*SRXAFS_ReleaseLock*/
* This routine is called exclusively by SRXAFS_GetStatistics(), and should be
* merged into it when possible.
*/
-static GetStatistics (tcon, Statistics)
- struct rx_connection *tcon; /* Rx connection handle */
+static GetStatistics (acall, Statistics)
+ struct rx_call *acall; /* Rx call */
struct AFSStatistics *Statistics; /* Placeholder for returned AFS statistics */
{
ViceLog(1, ("SAFS_GetStatistics Received\n"));
FS_LOCK
AFSCallStats.GetStatistics++, AFSCallStats.TotalCalls++;
FS_UNLOCK
- bzero(Statistics, sizeof(*Statistics));
+ memset(Statistics, 0, sizeof(*Statistics));
SetAFSStats(Statistics);
SetVolumeStats(Statistics);
SetSystemStats(Statistics);
} /*GetStatistics*/
-SRXAFS_GetStatistics (tcon, Statistics)
- struct rx_connection *tcon; /* Rx connection handle */
- struct AFSStatistics *Statistics; /* Placeholder for returned AFS statistics */
+SRXAFS_GetStatistics (acall, Statistics)
+ struct rx_call *acall; /* Rx call */
+ struct ViceStatistics *Statistics; /* Placeholder for returned AFS statistics */
{
afs_int32 code;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, NOTACTIVECALL))
+ if (code = CallPreamble(acall, NOTACTIVECALL, &tcon))
goto Bad_GetStatistics;
code = GetStatistics (tcon, Statistics);
*/
dataBytes = sizeof(struct afs_Stats);
dataBuffP = (afs_int32 *)malloc(dataBytes);
- bcopy(&afs_cmstats, dataBuffP, dataBytes);
+ memcpy(dataBuffP, &afs_cmstats, dataBytes);
a_dataP->AFS_CollData_len = dataBytes>>2;
a_dataP->AFS_CollData_val = dataBuffP;
#else
dataBytes = sizeof(struct afs_PerfStats);
dataBuffP = (afs_int32 *)osi_Alloc(dataBytes);
- bcopy(&afs_perfstats, dataBuffP, dataBytes);
+ memcpy(dataBuffP, &afs_perfstats, dataBytes);
a_dataP->AFS_CollData_len = dataBytes>>2;
a_dataP->AFS_CollData_val = dataBuffP;
break;
dataBytes = sizeof(struct fs_stats_FullPerfStats);
dataBuffP = (afs_int32 *)osi_Alloc(dataBytes);
- bcopy(&afs_FullPerfStats, dataBuffP, dataBytes);
+ memcpy(dataBuffP, &afs_FullPerfStats, dataBytes);
a_dataP->AFS_CollData_len = dataBytes>>2;
a_dataP->AFS_CollData_val = dataBuffP;
#endif
} /*SRXAFS_GetXStats*/
-SRXAFS_GiveUpCallBacks (tcon, FidArray, CallBackArray)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_GiveUpCallBacks (acall, FidArray, CallBackArray)
+ struct rx_call *acall; /* Rx call */
struct AFSCBFids *FidArray; /* Array of Fids entries */
struct AFSCBs *CallBackArray; /* array of callbacks */
afs_int32 errorCode;
register int i;
struct client *client;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
FS_LOCK
AFSCallStats.GiveUpCallBacks++, AFSCallStats.TotalCalls++;
FS_UNLOCK
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_GiveUpCallBacks;
if (FidArray->AFSCBFids_len < CallBackArray->AFSCBs_len) {
} /*SRXAFS_GiveUpCallBacks*/
-SRXAFS_NGetVolumeInfo (tcon, avolid, avolinfo)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_NGetVolumeInfo (acall, avolid, avolinfo)
+ struct rx_call *acall; /* Rx call */
char *avolid; /* Volume name/id */
struct AFSVolumeInfo *avolinfo; /* Returned volume's specific info */
}
-SRXAFS_FlushCPS(tcon, vids, addrs, spare1, spare2, spare3)
- struct rx_connection *tcon;
+SRXAFS_FlushCPS(acall, vids, addrs, spare1, spare2, spare3)
+ struct rx_call *acall;
struct ViceIds *vids;
struct IPAddrs *addrs;
afs_int32 spare1, *spare2, *spare3;
afs_int32 *vd, *addr;
int errorCode = 0; /* return code to caller */
struct client *client;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
ViceLog(1, ("SRXAFS_FlushCPS\n"));
FS_LOCK
-static GetVolumeInfo (tcon, avolid, avolinfo)
- struct rx_connection *tcon; /* Rx Connection handle */
+static GetVolumeInfo (acall, avolid, avolinfo)
+ struct rx_call *acall; /* Rx call */
char *avolid; /* Volume name/id */
struct VolumeInfo *avolinfo; /* Returned volume's specific info */
}
-SRXAFS_GetVolumeInfo (tcon, avolid, avolinfo)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_GetVolumeInfo (acall, avolid, avolinfo)
+ struct rx_call *acall; /* Rx call */
char *avolid; /* Volume name/id */
struct VolumeInfo *avolinfo; /* Returned volume's specific info */
{
afs_int32 code;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
FS_UNLOCK
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_GetVolumeInfo;
code = GetVolumeInfo (tcon, avolid, avolinfo);
} /*SRXAFS_GetVolumeInfo*/
-SRXAFS_GetVolumeStatus (tcon, avolid, FetchVolStatus, Name, OfflineMsg, Motd)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_GetVolumeStatus (acall, avolid, FetchVolStatus, Name, OfflineMsg, Motd)
+ struct rx_call *acall; /* Rx call */
afs_int32 avolid; /* Volume's id */
AFSFetchVolumeStatus *FetchVolStatus; /* Place to hold volume's status info */
char **Name; /* Returned volume's name */
struct client * client; /* pointer to client entry */
afs_int32 rights, anyrights; /* rights for this and any user */
AFSFid dummyFid;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
#endif /* FS_STATS_DETAILED */
ViceLog(1,("SAFS_GetVolumeStatus for volume %u\n", avolid));
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_GetVolumeStatus;
FS_LOCK
} /*SRXAFS_GetVolumeStatus*/
-SRXAFS_SetVolumeStatus (tcon, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_SetVolumeStatus (acall, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
+ struct rx_call *acall; /* Rx call */
afs_int32 avolid; /* Volume's id */
AFSStoreVolumeStatus *StoreVolStatus; /* Adjusted output volume's status */
char *Name; /* Set new volume's name, if applicable */
struct client * client; /* pointer to client entry */
afs_int32 rights, anyrights; /* rights for this and any user */
AFSFid dummyFid;
- struct rx_call *tcall = (struct rx_call *) tcon;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
#endif /* FS_STATS_DETAILED */
ViceLog(1,("SAFS_SetVolumeStatus for volume %u\n", avolid));
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_SetVolumeStatus;
FS_LOCK
#endif /* FS_STATS_DETAILED */
- osi_auditU (tcall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid, AUD_STR, Name, AUD_END);
+ osi_auditU (acall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid, AUD_STR, Name, AUD_END);
return(errorCode);
} /*SRXAFS_SetVolumeStatus*/
#define DEFAULTVOLUME "root.afs"
-SRXAFS_GetRootVolume (tcon, VolumeName)
- struct rx_connection * tcon; /* R-Connection handle */
+SRXAFS_GetRootVolume (acall, VolumeName)
+ struct rx_call *acall; /* Rx call */
char **VolumeName; /* Returned AFS's root volume name */
{
int len;
char *temp;
int errorCode = 0; /* error code */
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
return FSERR_EOPNOTSUPP;
#ifdef notdef
- if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_GetRootVolume;
FS_LOCK
AFSCallStats.GetRootVolume++, AFSCallStats.TotalCalls++;
/* still works because a struct CBS is the same as a struct AFSOpaque */
-SRXAFS_CheckToken (tcon, AfsId, Token)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_CheckToken (acall, AfsId, Token)
+ struct rx_call *acall; /* Rx call */
afs_int32 AfsId; /* AFS id whose token we verify */
- struct CBS *Token; /* Token value for used Afsid */
+ struct AFSOpaque *Token; /* Token value for used Afsid */
{
afs_int32 code;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+ if (code = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_CheckToken;
code = FSERR_ECONNREFUSED;
} /*SRXAFS_CheckToken*/
-static GetTime (tcon, Seconds, USeconds)
- struct rx_connection *tcon; /* R-Connection handle */
+static GetTime (acall, Seconds, USeconds)
+ struct rx_call *acall; /* Rx call */
afs_uint32 *Seconds; /* Returned time in seconds */
afs_uint32 *USeconds; /* Returned leftovers in useconds */
} /*GetTime*/
-SRXAFS_GetTime (tcon, Seconds, USeconds)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_GetTime (acall, Seconds, USeconds)
+ struct rx_call *acall; /* Rx call */
afs_uint32 *Seconds; /* Returned time in seconds */
afs_uint32 *USeconds; /* Returned leftovers in useconds */
{
afs_int32 code;
+ struct rx_connection *tcon;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
struct timeval opStartTime,
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if (code = CallPreamble((struct rx_call **) &tcon, NOTACTIVECALL))
+ if (code = CallPreamble(acall, NOTACTIVECALL, &tcon))
goto Bad_GetTime;
code = GetTime (tcon, Seconds, USeconds);
# the File Server.
*/
-FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, a_bytesToFetchP, a_bytesFetchedP)
+FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, Int64Mode, a_bytesToFetchP, a_bytesFetchedP)
#else
-FetchData_RXStyle(volptr, targetptr, Call, Pos, Len)
+FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, Int64Mode)
#endif /* FS_STATS_DETAILED */
Volume * volptr;
Vnode * targetptr;
register struct rx_call * Call;
afs_int32 Pos;
afs_int32 Len;
+afs_int32 Int64Mode;
#if FS_STATS_DETAILED
afs_int32 *a_bytesToFetchP;
afs_int32 *a_bytesFetchedP;
* back to make the cache manager happy...
*/
tlen = htonl(0);
+ if (Int64Mode)
+ rx_Write(Call, &tlen, sizeof(afs_int32)); /* send 0-length */
rx_Write(Call, &tlen, sizeof(afs_int32)); /* send 0-length */
return (0);
}
if (Pos + Len > tlen) Len = tlen - Pos; /* get length we should send */
FDH_SEEK(fdP, Pos, 0);
tlen = htonl(Len);
+ if (Int64Mode) {
+ afs_int32 zero = 0;
+ rx_Write(Call, &zero, sizeof(afs_int32)); /* High order bits */
+ }
rx_Write(Call, &tlen, sizeof(afs_int32)); /* send length on fetch */
#if FS_STATS_DETAILED
(*a_bytesToFetchP) = Len;
struct AFSFid *Fid;
struct client *client;
register struct rx_call *Call;
- afs_int32 Pos;
- afs_int32 Length;
- afs_int32 FileLength;
+ afs_uint32 Pos;
+ afs_uint32 Length;
+ afs_uint32 FileLength;
int sync;
#if FS_STATS_DETAILED
afs_int32 *a_bytesToStoreP;
return(EINVAL);
if ((newACL->size + 4) > VAclSize(targetptr))
return(E2BIG);
- bcopy((char *) newACL,(char *) VVnodeACL(targetptr),(int)(newACL->size));
+ memcpy((char *) VVnodeACL(targetptr), (char *) newACL, (int)(newACL->size));
acl_FreeACL(&newACL);
return(0);
return(EINVAL);
if ((newACL->size + 4) > VAclSize(targetptr))
return(E2BIG);
- bcopy((char *) newACL,(char *) VVnodeACL(targetptr),(int)(newACL->size));
+ memcpy((char *) VVnodeACL(targetptr), (char *) newACL, (int)(newACL->size));
acl_FreeACL(&newACL);
return(0);
{
/* initialize return status from a vnode */
status->InterfaceVersion = 1;
- status->SyncCounter = status->dataVersionHigh = status->spare2 =
- status->spare3 = status->spare4 = 0;
+ status->SyncCounter = status->dataVersionHigh = status->lockCount =
+ status->errorCode = 0;
+ status->ResidencyMask = 1; /* means for MR-AFS: file in /vicepr-partition */
if (targetptr->disk.type == vFile)
status->FileType = File;
else if (targetptr->disk.type == vDirectory)
else
status->FileType = Invalid; /*invalid type field */
status->LinkCount = targetptr->disk.linkCount;
+ status->Length_hi = 0;
status->Length = targetptr->disk.length;
status->DataVersion = targetptr->disk.dataVersion;
status->Author = targetptr->disk.author;
status->ClientModTime = targetptr->disk.unixModifyTime; /* This might need rework */
status->ParentVnode = (status->FileType == Directory ? targetptr->vnodeNumber : parentptr->vnodeNumber);
status->ParentUnique = (status->FileType == Directory ? targetptr->disk.uniquifier : parentptr->disk.uniquifier);
- status->SegSize = 0;
status->ServerModTime = targetptr->disk.serverModifyTime;
status->Group = targetptr->disk.group;
- status->spare2 = targetptr->disk.lock.lockCount;
+ status->lockCount = targetptr->disk.lock.lockCount;
+ status->errorCode = 0;
} /*GetStatus*/
rc = IH_DEC(V_linkHandle(volptr), ino,
V_parentId(volptr));
if (!rc ) {
- ViceLog(0,("CopyOnWrite failed: volume %u in partition %s needs salvage\n",
- V_id(volptr), volptr->partition->name));
+ ViceLog(0,("CopyOnWrite failed: error %u after i_dec on disk full, volume %u in partition %s needs salvage\n",
+ rc, V_id(volptr),
+ volptr->partition->name));
VTakeOffline (volptr);
}
free(buff);
return ENOSPC;
}
else {
- ViceLog(0,("CopyOnWrite failed: volume %u in partition %s needs salvage\n",
- V_id(volptr), volptr->partition->name));
- /* Decrement this inode so salvager doesn't find it. */
+ ViceLog(0,("CopyOnWrite failed: volume %u in partition %s (tried reading %u, read %u, wrote %u, errno %u) volume needs salvage\n",
+ V_id(volptr), volptr->partition->name, length,
+ rdlen, wrlen, errno));
+ /* Decrement this inode so salvager doesn't find it. */
FDH_REALLYCLOSE(newFdP);
IH_RELEASE(newH);
FDH_REALLYCLOSE(targFdP);
for (part = DiskPartitionList; part && i < AFS_MSTATDISKS; part = part->next) {
stats->Disks[i].TotalBlocks = part->totalUsable;
stats->Disks[i].BlocksAvailable = part->free;
- bzero(stats->Disks[i].Name, AFS_DISKNAMESIZE);
+ memset(stats->Disks[i].Name, 0, AFS_DISKNAMESIZE);
strncpy(stats->Disks[i].Name, part->name, AFS_DISKNAMESIZE);
i++;
}
* and is not supported by the AFS fileserver. We just return EINVAL.
* The cache manager should not generate this call to an AFS cache manager.
*/
-SRXAFS_DFSSymlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
- struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_DFSSymlink (acall, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
+ struct rx_call *acall; /* Rx call */
struct AFSFid *DirFid; /* Parent dir's fid */
char *Name; /* File name to create */
char *LinkContents; /* Contents of the new created file */
return EINVAL;
}
-SRXAFS_ResidencyCmd (tcon, Fid, Inputs, Outputs)
- struct rx_connection *tcon;
+SRXAFS_ResidencyCmd (acall, Fid, Inputs, Outputs)
+ struct rx_call *acall;
struct AFSFid *Fid;
struct ResidencyCmdInputs *Inputs;
struct ResidencyCmdOutputs *Outputs;