LINUX: consolidate duplicate code in osi_TryEvictDentries 92/12792/5
authorMark Vitale <mvitale@sinenomine.net>
Thu, 30 Nov 2017 22:56:13 +0000 (17:56 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Tue, 2 Jan 2018 03:05:09 +0000 (22:05 -0500)
commit5076dfc14b980aed310f3862875d5e9919fa199d
tree22d601805ff0fcbeb5bdb368ed25ca6faceab17f
parent0678ad26b6069040a6ea86866fb59ef5968ea343
LINUX: consolidate duplicate code in osi_TryEvictDentries

The two stanzas for HAVE_DCACHE_LOCK are now functionally identical;
remove the preprocessor conditionals and duplicate code.

Minor functional change is incurrred for very old (before 2.6.38) Linux
versions that have dcache_lock; we are now obtaining the d_lock as well.

This is safe because d_lock is also quite old (pre-git, 2.6.12), and it
is a spinlock that's only held for checking d_unhashed.  Therefore, it
should have negligible performance impact.  It cannot cause deadlocks or
violate locking order, because spinlocks can't be held across sleeps.

Change-Id: I08faf204e6bd82c4401cdf6048d12cd551dd18fc
Reviewed-on: https://gerrit.openafs.org/12792
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@dson.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/LINUX/osi_vcache.c