mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
vol: use header access macros everywhere
a couple direct references to diskstuff have crept in. push them back out Change-Id: I66c7a157aeb326dee17012d551c0f499bae35bc7 Reviewed-on: http://gerrit.openafs.org/8807 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
parent
2f087dc434
commit
c67d29c676
@ -245,7 +245,7 @@ SetVolumeSync(struct AFSVolSync *async, Volume * avol)
|
||||
/* date volume instance was created */
|
||||
if (async) {
|
||||
if (avol)
|
||||
async->spare1 = avol->header->diskstuff.creationDate;
|
||||
async->spare1 = V_creationDate(avol);
|
||||
else
|
||||
async->spare1 = 0;
|
||||
async->spare2 = 0;
|
||||
@ -1874,7 +1874,7 @@ Alloc_NewVnode(Vnode * parentptr, DirHandle * dir, Volume * volptr,
|
||||
if (!VALID_INO(inode)) {
|
||||
ViceLog(0,
|
||||
("Volume : %u vnode = %u Failed to create inode: errno = %d\n",
|
||||
(*targetptr)->volumePtr->header->diskstuff.id,
|
||||
V_id((*targetptr)->volumePtr),
|
||||
(*targetptr)->vnodeNumber, errno));
|
||||
VAdjustDiskUsage(&temp, volptr, -BlocksPreallocatedForVnode, 0);
|
||||
(*targetptr)->delete = 1; /* delete vnode */
|
||||
|
@ -908,7 +908,7 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type, VnodeId in_vnode, Unique
|
||||
vnp->disk.uniquifier = unique;
|
||||
vnp->handle = NULL;
|
||||
vcp->allocs++;
|
||||
vp->header->diskstuff.filecount++;
|
||||
V_filecount(vp)++;
|
||||
#ifdef AFS_DEMAND_ATTACH_FS
|
||||
VnChangeState_r(vnp, VN_STATE_EXCLUSIVE);
|
||||
#endif
|
||||
@ -1444,8 +1444,8 @@ VPutVnode_r(Error * ec, Vnode * vnp)
|
||||
* (doing so could cause a "addled bitmap" message).
|
||||
*/
|
||||
if (vnp->delete && !*ec) {
|
||||
if (Vn_volume(vnp)->header->diskstuff.filecount-- < 1)
|
||||
Vn_volume(vnp)->header->diskstuff.filecount = 0;
|
||||
if (V_filecount(Vn_volume(vnp))-- < 1)
|
||||
V_filecount(Vn_volume(vnp)) = 0;
|
||||
VFreeBitMapEntry_r(ec, vp, &vp->vnodeIndex[class],
|
||||
vnodeIdToBitNumber(Vn_id(vnp)),
|
||||
VOL_FREE_BITMAP_WAIT);
|
||||
|
@ -2940,7 +2940,7 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp,
|
||||
if (VCanUseFSSYNC() && (mode == V_PEEK || peek)) {
|
||||
SYNC_response res;
|
||||
res.payload.len = sizeof(VolumeDiskData);
|
||||
res.payload.buf = &vp->header->diskstuff;
|
||||
res.payload.buf = &(V_disk(vp));
|
||||
|
||||
if (FSYNC_VolOp(vp->hashid,
|
||||
partp->name,
|
||||
|
@ -819,7 +819,7 @@ VolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId,
|
||||
V_type(newvp) = backupVolume;
|
||||
V_backupId(originalvp) = newId;
|
||||
}
|
||||
strcpy(newvp->header->diskstuff.name, newName);
|
||||
strcpy(V_name(newvp), newName);
|
||||
V_creationDate(newvp) = V_copyDate(newvp);
|
||||
ClearVolumeStats(&V_disk(newvp));
|
||||
V_destroyMe(newvp) = DESTROY_ME;
|
||||
@ -1670,7 +1670,7 @@ VolGetStatus(struct rx_call *acid, afs_int32 atrans,
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
td = &tv->header->diskstuff;
|
||||
td = &(V_disk(tv));
|
||||
astatus->volID = td->id;
|
||||
astatus->nextUnique = td->uniquifier;
|
||||
astatus->type = td->type;
|
||||
@ -1733,7 +1733,7 @@ VolSetInfo(struct rx_call *acid, afs_int32 atrans,
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
td = &tv->header->diskstuff;
|
||||
td = &(V_disk(tv));
|
||||
/*
|
||||
* Add more fields as necessary
|
||||
*/
|
||||
@ -1793,7 +1793,7 @@ VolGetName(struct rx_call *acid, afs_int32 atrans, char **aname)
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
td = &tv->header->diskstuff;
|
||||
td = &(V_disk(tv));
|
||||
len = strlen(td->name) + 1; /* don't forget the null */
|
||||
if (len >= SIZE) {
|
||||
TClearRxCall(tt);
|
||||
@ -1993,7 +1993,7 @@ static int
|
||||
FillVolInfo(Volume * vp, volint_info_handle_t * handle)
|
||||
{
|
||||
unsigned int numStatBytes, now;
|
||||
struct VolumeDiskData *hdr = &vp->header->diskstuff;
|
||||
struct VolumeDiskData *hdr = &(V_disk(vp));
|
||||
|
||||
/*read in the relevant info */
|
||||
strcpy((char *)VOLINT_INFO_PTR(handle, name), hdr->name);
|
||||
@ -2247,7 +2247,7 @@ GetVolInfo(afs_uint32 partId,
|
||||
* -- tkeiser 11/28/2007
|
||||
*/
|
||||
|
||||
if (tv->header->diskstuff.destroyMe == DESTROY_ME) {
|
||||
if (V_destroyMe(tv) == DESTROY_ME) {
|
||||
switch (mode) {
|
||||
case VOL_INFO_LIST_MULTIPLE:
|
||||
code = -2;
|
||||
@ -2262,7 +2262,7 @@ GetVolInfo(afs_uint32 partId,
|
||||
}
|
||||
}
|
||||
|
||||
if (tv->header->diskstuff.needsSalvaged) {
|
||||
if (V_needsSalvaged(tv)) {
|
||||
/*this volume will be salvaged */
|
||||
Log("1 Volser: GetVolInfo: Volume %u (%s:%s) needs to be salvaged\n",
|
||||
volumeId, pname, volname);
|
||||
|
Loading…
Reference in New Issue
Block a user