Whamcloud - gitweb
LU-6142 lustre: don't take spinlock to read a 'long'.
Reading a 'long' (or unsigned long) is always an atomic operation.
There is never a need to take a spinlock to just read a single 'long'.
There are several procfs/debugfs/sysfs handlers which needlessly take
a spinlock for this purpose.
This patch:
- removes the taking of the spinlock
- changes the printf to scnprintf() as appropriate
- directly returns the value returned by scnprintf rather than
storing it in a variable
- accesses the 'long' as an arg to the scnprintf(), rather than
introducing a variabe to hold it.
Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If4a6454b46844864e1177536a9c7b91e4c97de86
Reviewed-on: https://review.whamcloud.com/39743
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>