From c67d29c676b02dc069d3c39f803b5ef6f7dbadca Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 21 Dec 2012 06:44:18 -0500 Subject: [PATCH] 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 Reviewed-by: Chas Williams - CONTRACTOR Tested-by: BuildBot --- src/viced/afsfileprocs.c | 4 ++-- src/vol/vnode.c | 6 +++--- src/vol/volume.c | 2 +- src/volser/volprocs.c | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 39a5342..adf653f 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -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 */ diff --git a/src/vol/vnode.c b/src/vol/vnode.c index f7026c2..a645be1 100644 --- a/src/vol/vnode.c +++ b/src/vol/vnode.c @@ -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); diff --git a/src/vol/volume.c b/src/vol/volume.c index 536785a..a83e777 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -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, diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index c9ad3d4..f24a9f2 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -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); -- 1.9.4