OpenAFS CVS Commit: openafs/src/WINNT/afsd by jaltman

cvs@GRAND.CENTRAL.ORG cvs@GRAND.CENTRAL.ORG
Sun, 10 Jun 2007 12:58:51 EDT


Update of /cvs/openafs/src/WINNT/afsd
In directory GRAND.CENTRAL.ORG:/home/jaltman/openafs/cvs-1-3/src/WINNT/afsd

Modified Files:
	afsd_init.c cm.h cm_buf.c cm_callback.c cm_cell.c cm_conn.c 
	cm_conn.h cm_daemon.c cm_dcache.c cm_freelance.c cm_ioctl.c 
	cm_memmap.c cm_memmap.h cm_scache.c cm_scache.h cm_server.c 
	cm_server.h cm_vnodeops.c cm_volume.c cm_volume.h smb_ioctl.c 
	smb_ioctl.h 
Log Message:
DELTA windows-volume-status-tracking-20070610
AUTHOR jaltman@secure-endpoints.com

* changed the enum values for cm_serverRef_t state info to use a 
  private name space to avoid collisions (srv_)

* added a srv_deleted state for cm_serverRef_t objects.  This 
  state is set when cm_FreeServerList() is called with the 
  CM_FREESERVERLIST_DELETE flag set.  cm_FreeServerList() may
  not always delete the cm_serverRef_t from the list if it is
  still in use by another thread.  the srv_deleted state means
  the object's contents are no longer valid and it must be 
  skipped.  It will be deleted the next time the object is 
  freed and the refcount hits zero.

* the srv_deleted state is also used when a file server reports
  either VNOVOL or VMOVED instead of marking the cm_serverRef_t
  as offline.  This is done to prevent additional usage of the 
  stale vldb data while waiting for the update volume request
  to complete.

* added a state field to the cm_volume_t object (enum volstate 
  vl_ name space) that maintains the state of the volume based
  upon the states of all of the cm_serverRef_t and cm_server_t
  objects.

* modified cm_UpdateVolume() to set the state of the cm_volume_t
  RW, RO, and BK to either vl_alldown or vl_online.  There can't
  be any other states because cm_UpdateVolume() destroys any  
  previous knowledge we might have had regarding busy or offline
  volume status

* modified cm_UpdateVolume() to update the volume name in the 
  cm_volume_t to the volume base name if the previous value was 
  a volume ID.

* modified cm_FollowMountPoint() to check to see if the volume
  name is a volume ID and if so call cm_GetVolumeByID instead 
  of cm_GetVolumeByName.  This ensures that volume IDs are always
  looked up as numeric values.  There is no longer a need to 
  maintain a separate cm_volume_t containing the string representation
  of the ID value.

* Added a flags parameter to cm_GetVolumeByName() and cm_GetVolumeByID().
  The first flag is a "CREATE" flag which is set by all existing
  calls.  The flag is not set by calls to cm_GetVolumeByID() from
  the server probe code when volume status is being updated.  We 
  do not want the server probe operation to result in additional 
  turnover in the cached volume data.  The second flag is NO_LRU_UPDATE 
  which is set when the server probe code updates the volume status.
  This flag will be used to prevent the server probe operation from
  changing the order of the least recently used queue.

* Modified cm_GetVolumeByName to ensure that only one cm_volume_t is 
  allocated for a given set of normal, readonly, and backup volumes
  regardless of whether or not the volume is accessed via name or 
  ID number.  The cm_volume_t namep field is always the base name
  of the volume. 

* Added a new volume state, vl_unknown.  This state is used as
  the initial state for all cm_volume_t when the cache manager starts, 
  for each cm_volume_t at creation, and for each cm_volume_t when
  recycling.  The cache manager does not know the state of all 
  volumes in the world, only those that are in the cache and for
  which it has queried the VLDB and hosting file servers.

* modified cm_GetVolumeByName() to initialize the state of a 
  volume to vl_unknown.  The actual state will be set when a 
  cm_VolumeUpdate() call completes successfully.

* changed name of scache hash table variables to avoid ambiguity
  when adding hash tables for volumes

* fix a buffer overrun in sys\pioctl_nt.c  pioctl().
  (thanks Asanka)

* modified cm_UpdateVolume() to handle the case in which there is
  no RW volume but there is are RO volumes for a given base name. 
  This is done by querying for the ".readonly" volume name if the 
  base name does not exist in the VLDB.  We never query for the
  .backup name because under the current usage model a .backup 
  volume may only exist on the server that the read-write volume
  is located.  If there is no RW volume, there can be no .backup.

* Added four hash tables for cm_volume_t objects to improve the 
  search time of cm_GetVolumeByID(), cm_GetVolumeByName() and
  cm_ForceUpdateVolume(). One each for Name, RWID, ROID, and 
  BKID.  Three ID hash tables are necessary as long as it is
  desireable to maintain a single cm_volume_t containing all
  of the related RW, RO, and BK volume data.  Having the RW and
  RO volume data in the same object is necessary for the 
  implementation of cm_GetROVolumeID() which returns either the
  RO or RW ID depending upon the existence of RO volume instances.  

* Added a volume LRU queue so that volume reuse becomes fairer.
  This does not replace the all Volumes list which is used when
  it is desireable to walk a list of all the volumes whose order
  is not going to change out from underneath you which makes it
  safe to drop the cm_volumeLock.

* handles volume hash table updates where volume name to 
  volume ID number changes.  The volume name remains 
  constant in the cm_volume_t.  if a vos rename is performed, 
  the name of the volume will change and the volume IDs will be 
  updated.  Subsequent access to the old volume ID will create a 
  new cm_volume_t with the new name.

* Added a daemon thread operation to query the state of volumes
  listed as busy or offline.  cm_CheckBusyVolumes() calls 
  RXAFS_GetVolumeStatus() for each volume ID that is marked vl_busy 
  or vl_offline.   If the volume is now online, the status on the
  volume is updated.  The default period is 600 seconds.  This can 
  be configured with the BusyVolumeCheckInterval registry value.  

* Added prototype for smb_IoctlPrepareRead() which was missing a
  return type in the function definition.

* Added volume id lists to the cm_server_t.  These lists are
  allocated in blocks of ~32 IDs.  When a cm_PingServer() 
  detects a change in server state, the state of the cm_volume_t
  is updated.  

* Added volID to the cm_serverRef_t object.  volID is used
  to identify the volume for which the object is a referral.
  cm_FreeServerList() uses the volID to remove the volume 
  from the cm_server_t.

* In cm_Analyze, when VNOVOL or VMOVED are received, 
  call cm_ForceVolumeUpdate() to force a refresh of the volume 
  location data.

* Added cm_VolumeStatusNotification() which is used at the moment
  to log volume status changes to the trace log.  It will also
  be used as the access point to the File System Filter driver
  notification engine.

* Added an all cm_scache_t list to cm_data.  This replaces the use
  of the stat cache LRU queue when we need to enumerate all 
  entries.  The LRU list order is not static and when using it to 
  enumerate all entries it can result in items being missed or
  items being processed more than once.

* Modified cm_Analyze(). Instead of reseting the busy or offline
  state of a volume and forcing a retry of the operation
  cm_Analyze will defer to the background daemon thread that will
  update the state once every 600 seconds.

* Added the automatic generation of a Freelance ".root" read-write
  mountpoint that refers to the root.afs volume of the workstation
  cellname at the time the mountpoint is created.




--- DELTA config follows ---
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/afsd_init.c 1.92 1.93
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm.h 1.20 1.21
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_buf.c 1.47 1.48
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_callback.c 1.53 1.54
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_cell.c 1.25 1.26
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_conn.c 1.63 1.64
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_conn.h 1.20 1.21
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_daemon.c 1.28 1.29
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_dcache.c 1.45 1.46
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_freelance.c 1.35 1.36
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_ioctl.c 1.86 1.87
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_memmap.c 1.11 1.12
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_memmap.h 1.5 1.6
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_scache.c 1.70 1.71
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_scache.h 1.33 1.34
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_server.c 1.30 1.31
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_server.h 1.17 1.18
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_vnodeops.c 1.100 1.101
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_volume.c 1.23 1.24
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/cm_volume.h 1.7 1.8
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/smb_ioctl.c 1.30 1.31
windows-volume-status-tracking-20070610 openafs/src/WINNT/afsd/smb_ioctl.h 1.7 1.8