Refactor afs_NewVCache
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Sat, 7 Nov 2009 00:16:28 +0000 (00:16 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 4 May 2010 00:11:20 +0000 (17:11 -0700)
commit9be76c0d312e9d4ba879d2f82a7c556bf8025da7
tree8e28885618c2fdba998463164c1750a9a39227d0
parent5e09bcd936f60a9b3f6547299ab2baf98111bba6
Refactor afs_NewVCache

afs_NewVCache was a twisty turny maze of #ifdefs and duplicated code.
This makes a number of sweeping changes to simplify this code, and to
move platform specific elements out into their own directories.

*) ShakeLooseVCaches is refactored so that the same code can be used
   both for platforms that support dynamic vcaches, and those which
   don't.
*) afs_NewVCache, ShakeLooseVCaches, and afs_AllocVCache are all
   modified to remove platform specific code, and to call platform
   specific functions.
*) A new platform file 'osi_vcache.c' is created to hold a number of
   platform specific vcache operations:
   *) osi_TryEvictVCache handles the decision of whether a vcache can
      be evicted or not, and does so if required
   *) osi_NewVnode allocates a new vnode
   *) osi_PrePopulateVCache does the necessary population of the
      vcache, before it's threaded onto the VLRUQ and associated hash
      tables.
   *) osi_AttachVnode handles attaching an OS vnode to our vcache,
      where that is necessary
   *) osi_PostPopulateVCache handles the vcache population that must
      occur after we're on the VLRUQ and have a vnode attached.

Change-Id: I368e5fb500d012b44141aa8f8cf0516e63e58f57
Reviewed-on: http://gerrit.openafs.org/1881
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
26 files changed:
src/afs/AIX/osi_vcache.c [new file with mode: 0644]
src/afs/DARWIN/osi_vcache.c [new file with mode: 0644]
src/afs/FBSD/osi_vcache.c [new file with mode: 0644]
src/afs/HPUX/osi_vcache.c [new file with mode: 0644]
src/afs/IRIX/osi_vcache.c [new file with mode: 0644]
src/afs/LINUX/osi_vcache.c [new file with mode: 0644]
src/afs/LINUX24/osi_vcache.c [new file with mode: 0644]
src/afs/NBSD/osi_vcache.c [new file with mode: 0644]
src/afs/OBSD/osi_vcache.c [new file with mode: 0644]
src/afs/SOLARIS/osi_vcache.c [new file with mode: 0644]
src/afs/UKERNEL/osi_vcache.c [new file with mode: 0644]
src/afs/afs_osi.h
src/afs/afs_vcache.c
src/libafs/Makefile.common.in
src/libafs/MakefileProto.AIX.in
src/libafs/MakefileProto.DARWIN.in
src/libafs/MakefileProto.DFBSD.in
src/libafs/MakefileProto.DUX.in
src/libafs/MakefileProto.FBSD.in
src/libafs/MakefileProto.HPUX.in
src/libafs/MakefileProto.IRIX.in
src/libafs/MakefileProto.LINUX.in
src/libafs/MakefileProto.NBSD.in
src/libafs/MakefileProto.OBSD.in
src/libafs/MakefileProto.SOLARIS.in
src/libuafs/Makefile.common.in