Next Previous Contents

## 5. The initialization of the volume package

VInitVolumePackage InitLRU InitVolTable VInitVnodes VInitVnodes InitLogStorage VCheckVLDB: checks header of disk VLDB, reports size check partitions and call: VInitPartition: puts partition in olist S_VolSalvage: FSYNC_fsInit: what are volume relocations???? attaches all volumes: GetVolPartition: check consistency of index and volid in RVM, return parti tions info. VAttachVolumeById Lookup in hash table if found take out of hash table sanity checks followed by attach2 callocs a volume structure GetVolumeHeader: take lru slot; the vp header appears to maybe re side in hash table VoldDiskInfoById: link the vp with the RVM information (looks up t he header in hashtable) if this fails the volume is freed up again. Tests if volume needs to be salvaged: ec set to VSALVAGE more of sanity and destroy AddVolumeToHashTable Set up uniquefier null VM bitmaps, then fill them in. If vp == NULL and other things: FSYNC_askfs else VUpdateVolume WriteVolumeHeader if error VForceOffline if error: VPutVolume VAddToVolumeUpdateList: update time stamps, calls VUpdateVolume (again ??) VAppenVolume is called to add to VolumeList if system is up and not li sted yet. InitVolLog V_VolLog VListVolumes: dump partitions and volumehash table to VolumeList

Finding volumes by name:

ViceGetVolumeInfo VRDB.find by name if not found try to find by id (VRDB.find nasty casts) if found: call vrent::GetVolumeInfo for the entry fills in VSGADD stuff special case for canonicalize fills in the replica volid's in INFO else VGetVolumeInfo gets it out of the VLDB_fd if successful and ROVOL: calculate GetVSGAddress elseif RWVOL lookup the volumeinfo for a replicated volume return information

VgetVolume and VPutVolume are probably like iget iput.

- Volume databases (text)
- `/vice/vol/VolumeList` Holds partition and volume information for volumes for which this server is custodian. This is file is generated by srv.
- `/vice/vol/groupid` is maximum replicated volume id allocated so far.
- HOSTS (text)
  - Entries describe volume storage groups: id hostname1 hostname2 etc. Stored in /vice/db/VSGDB
  - `/vice/db/hosts` servers should be in this file. Servers found in the VSGDB are checked to be in this file before proceeding to make a volume.
  - `/vice/db/servers` contains an id for each server.

Createvol_rep works as follows: Parameters are: volname vsgaddr partition-name [groupid]

- check we are the SCM
- Check that the volname doesn't appear in AllVolumes or VRList
- Get the list of servers from the vsgaddr using the VSGDB
- verify the servers against /vice/db/hosts
- get a new replicated id for this replicated volume using the `/vice/vol/groupid` file
- use volutil to create the volume on each host, using the partition, volumename and groupid acquired before. Note that each server now assigns a volume id for this newly created volume. It dumps

Next Previous Contents