From a443accfdf8771b90e2b06da04e7e3d1e88028fd Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 11 Jun 2015 11:02:20 -0400 Subject: [PATCH] libafs: rename volume accessTime to setupTime Since OpenAFS 1.0, the struct volume accessTime member has been the time time the volume structure is setup, not the last time the volume was used (as indicated by the comments). This time stamp is only used to find the oldest available volume slot in the disked backed volume cache. (Perhaps in pre-OpenAFS this was updated each time the volume was referenced.) Rename this structure member and update the comments for it. Change-Id: I33a6371e8800b2d0f7b2700db0785fc365a8649e Reviewed-on: https://gerrit.openafs.org/11896 Reviewed-by: Perry Ruiter Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/afs/afs.h | 2 +- src/afs/afs_volume.c | 6 +++--- src/venus/kdump.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/afs/afs.h b/src/afs/afs.h index f470947e1..bf2273dc9 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -603,7 +603,7 @@ struct volume { afs_int32 roVol; afs_int32 backVol; afs_int32 rwVol; /* For r/o vols, original read/write volume. */ - afs_int32 accessTime; /* last time we used it */ + afs_int32 setupTime; /* time volume was setup from vldb info */ afs_int32 vtix; /* volume table index */ afs_int32 copyDate; /* copyDate field, for tracking vol releases */ afs_int32 expireTime; /* for per-volume callbacks... */ diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index 3aa64b837..0dcab6b59 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -166,8 +166,8 @@ afs_UFSGetVolSlot(afs_int32 volid, struct cell *tcell) lv = &afs_volumes[i]; for (tv = *lv; tv; lv = &tv->next, tv = *lv) { if (tv->refCount == 0) { /* is this one available? */ - if (tv->accessTime < bestTime) { /* best one available? */ - bestTime = tv->accessTime; + if (tv->setupTime < bestTime) { /* best one available? */ + bestTime = tv->setupTime; bestLp = lv; bestVp = tv; } @@ -373,7 +373,7 @@ afs_SetupVolSlot(afs_int32 volid, struct cell *tcell) } tv->refCount++; tv->states &= ~VRecheck; /* just checked it */ - tv->accessTime = osi_Time(); + tv->setupTime = osi_Time(); ReleaseWriteLock(&afs_xvolume); return tv; } diff --git a/src/venus/kdump.c b/src/venus/kdump.c index aaa396356..4ed65c4d0 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -2656,13 +2656,13 @@ print_volume(int kmem, struct volume *vep, struct volume *ptr, int pnt) vep->backVol); #ifdef AFS33 printf - ("\trwVol=%d, AcTime=%d, copyDate=%d, expTime=%d, vtix=%d, refC=%d, states=%x\n", - vep->rwVol, vep->accessTime, vep->copyDate, vep->expireTime, + ("\trwVol=%d, setupTime=%d, copyDate=%d, expTime=%d, vtix=%d, refC=%d, states=%x\n", + vep->rwVol, vep->setupTime, vep->copyDate, vep->expireTime, vep->vtix, vep->refCount, vep->states); #else printf - ("\trwVol=%d, AcTime=%d, copyDate=%d, vtix=%d, refC=%d, states=%x\n", - vep->rwVol, vep->accessTime, vep->copyDate, vep->vtix, vep->refCount, + ("\trwVol=%d, setupTime=%d, copyDate=%d, vtix=%d, refC=%d, states=%x\n", + vep->rwVol, vep->setupTime, vep->copyDate, vep->vtix, vep->refCount, vep->states); #endif printf("\tVolume's statuses: "); -- 2.39.5