Next
Previous
Contents
The following volume related structures are around:
- Volume: defined in volume.h. A VM structure held in a hash
table. Contains quite a lot of information, such as a pointer to a
volHeader, Device, partition, vol_index, vnodeIndex, locks and other
run time data.
- VolumeDiskData: defined in volume.h. An RVM structure holding
the persistent data associated with the volume.
- volHeader: defined in volume. h, appears to be a VM structure
sitting on a dlist. Contains a VolumeDiskData structure and points to
a Volume structure.
- VolumeData: defined in camprivate.h. An RVM structure, points
to VolumeDiskData and points to SmallVnodeLists (with some contstants
related to these, and to BigVnodeLists.
- VolHead: defined in camprivate.h. An RVM structure containing a
VolumeHeader and VolumeData.
- VolumeHeader: defined in volume.h. Contains the volumeid, type
and parentid.
In RVM an array is set up at initialization time: VolHead
VolumeList[MAXVOLS].
The VInitVolumePackage sets up a lot of other structures related to
volumes and vnodes.
- InitLRU: calloc a sequence of volHeader's, then call
ReleaseVolumeHeader to put it at the head of the volumeLRU.
- InitVolTable: sets up a volhash table, hashing volid's to get
the index in the VolumeList.
- VolumeHashTable: Hash table used to store pointers to the
Volume structure
- VInitVnodes: setup of the vnode VM lru caches for small and
large vnodes. Store summary
information in the VnodeClassInfoArray for both small and large
vnodes. The way to reach allocated vnode arrays is through the
VnodeClassInfoArray.
- InitLogStorage: go through the VolumeList and assign
VM resolution log memory for every volume; store the pointer
in VolLog[i]. The number of rlentries assigned is
VolumeList[ i].data.volumeInfo->maxlogentries.
- Check the vldb.
- Find server partitions.
- Run S_VolSalvage: this goes directly through the directory
contents, without invoking the buffer cache.
- FSYNC_fsInit: sets up a thread to watch over volume relocation
issues. No idea if this still works.
- Now iterate through all volumes and call VAttachVolumeById, to
instantiate the VM volume information and attach the volumes. When
attached, call InitVolLog which initialize pointers in VM for
resolution. The pointers give olists, whose elements correspond to the
vnode rec_smolists. Finally create a VNResLog for each of the olist.
entries.
Set the RVM log transients for this volume.
- Finally write out the /vice/vol/VolumeList file (VListVolumes).
- The Vinit variable is now set to 1.
Attaching a volume is described in AttachVolumebyId and
attach2. It means allocating a Volume structure in VM, finding its
partition, finding its VolHeader on the LRU, locating the
VolumeDiskData. If the volume needs salvaging, or appears to be inuse
already, or not blessed don't attach it. Now insert the Volume
structure into the hash table, and initialize some vnode information
in the volume structure.
Creating a volume
The start of this is found in vol-create.cc in the volutil
directory.
- We first initialize the volumeid with VAllocateVolumeId.
- VCreateVolume (vol/vutil.cc) now build a VolumeDiskData
structure vol in VM. The recoverable resolution log
vol.log is generated with recov_vol_log which does a RVMLIB_REC_MALLOC
to allocate a certain number of pointers to recle's.
Next
Previous
Contents