td->maxquota = astatus->maxquota;
if (astatus->dayUse != -1)
td->dayUse = astatus->dayUse;
+ if (astatus->creationDate != -1)
+ td->creationDate = astatus->creationDate;
+ if (astatus->updateDate != -1)
+ td->updateDate = astatus->updateDate;
VUpdateVolume(&error, tv);
tt->rxCallPtr = (struct rx_call *)0;
if (TRELE(tt))
extern void MapPartIdIntoName(afs_int32 partId, char *partName);
extern int yesprompt(char *str);
extern int PrintError(char *msg, afs_int32 errcode);
+extern void init_volintInfo(struct volintInfo *vinfo);
extern int UV_SetSecurity(register struct rx_securityClass *as,
afs_int32 aindex);
extern struct rx_connection *UV_Bind(afs_int32 aserver, afs_int32 port);
fprintf(STDOUT, " Last Access %s",
ctime((time_t *) & pntr->accessDate));
#endif
- fprintf(STDOUT, " Last Update %s",
- ctime((time_t *) & pntr->updateDate));
- fprintf(STDOUT,
- " %d accesses in the past day (i.e., vnode references)\n",
- pntr->dayUse);
+ if (!pntr->updateDate)
+ fprintf(STDOUT, " Last Update Never\n");
+ else {
+ fprintf(STDOUT, " Last Update %s",
+ ctime((time_t *) & pntr->updateDate));
+ fprintf(STDOUT,
+ " %d accesses in the past day (i.e., vnode references)\n",
+ pntr->dayUse);
+ }
} else if (pntr->status == VBUSY) {
*totalBusy += 1;
qPut(&busyHead, pntr->volid);
fprintf(STDOUT, " Last Access %s",
ctime((time_t *) & a_xInfoP->accessDate));
#endif
- fprintf(STDOUT, " Last Update %s",
- ctime((time_t *) & a_xInfoP->updateDate));
- fprintf(STDOUT,
- " %d accesses in the past day (i.e., vnode references)\n",
- a_xInfoP->dayUse);
+ if (!a_xInfoP->updateDate)
+ fprintf(STDOUT, " Last Update Never\n");
+ else {
+ fprintf(STDOUT, " Last Update %s",
+ ctime((time_t *) & a_xInfoP->updateDate));
+ fprintf(STDOUT,
+ " %d accesses in the past day (i.e., vnode references)\n",
+ a_xInfoP->dayUse);
+ }
/*
* Print all the read/write and authorship stats.
return (ENOENT);
}
- memset(&info, 0, sizeof(info));
+ init_volintInfo(&info);
info.volid = volid;
info.type = RWVOL;
- info.dayUse = -1;
- info.maxquota = -1;
- info.flags = -1;
- info.spare0 = -1;
- info.spare1 = -1;
- info.spare2 = -1;
- info.spare3 = -1;
if (as->parms[1].items) {
/* -max <quota> */
return 0;
}
+void init_volintInfo(struct volintInfo *vinfo) {
+ memset(vinfo, 0, sizeof(struct volintInfo));
+
+ vinfo->maxquota = -1;
+ vinfo->dayUse = -1;
+ vinfo->creationDate = -1;
+ vinfo->updateDate = -1;
+ vinfo->flags = -1;
+ vinfo->spare0 = -1;
+ vinfo->spare1 = -1;
+ vinfo->spare2 = -1;
+ vinfo->spare3 = -1;
+}
static struct rx_securityClass *uvclass = 0;
static int uvindex = -1;
tid = 0;
aconn = (struct rx_connection *)0;
error = 0;
- memset(&tstatus, 0, sizeof(struct volintInfo));
- tstatus.dayUse = -1;
+
+ init_volintInfo(&tstatus);
tstatus.maxquota = aquota;
aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
infop = (volintInfo *) volumeInfo.volEntries_val;
infop->maxquota = -1; /* Else it will replace the default quota */
+ infop->creationDate = -1; /* Else it will use the source creation date */
+ infop->updateDate = -1; /* Else it will use the source update date */
#endif
/* create a volume on the target machine */
goto refail;
}
- memset(&vinfo, 0, sizeof(struct volintInfo));
- vinfo.dayUse = -1;
- vinfo.maxquota = -1;
+ init_volintInfo(&vinfo);
vinfo.creationDate = newCreateDate;
vinfo.updateDate = newUpdateDate;
code = AFSVolSetInfo(toconn, totid, &vinfo);