Whamcloud - gitweb
LU-5946 lprocfs: cleanup stats locking code 72/12872/2
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 27 Nov 2014 23:48:33 +0000 (16:48 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 4 Jan 2015 18:38:59 +0000 (18:38 +0000)
commitc3e8e9d37fa6ea74d10b850a6e02af9fc477e719
tree9d0fb9a0a57af849a519e4b0af10053487c9cacf
parenta2cbc7d543a54f33d4e84bcd0465b7029aa1c82d
LU-5946 lprocfs: cleanup stats locking code

Add comment blocks on lprocfs_stats_lock() and lprocfs_stats_unlock().
Move common NOPERCPU code out of the switch() statements to reduce
code size and complexity, since it doesn't depend on the opc at all.

Replace switch() in lprocfs_stats_unlock() with a simple if/else,
since the lock opc was already checked in lprocfs_stats_lock().

Add an enum for the lprocfs_stats_lock() operations to make it clear
what the valid values are and allow compiler checking.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I1906d44981c025964d6a510000b217f10ca23031
Reviewed-on: http://review.whamcloud.com/12872
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lprocfs_status.h