Currently code dealing with changing unixuser structs does not obtain
any locks protecting the contents of the unixuser struct, though some
functions like afs_GetUser have a parameter indicating what type of
lock should be obtained. This can result in the token data for a user
being changed at the same time another thread tries to use the token
data.
To ensure mutual exclusion of such operations, add a lock field to the
unixuser struct, and actually lock it according to the intentions of
the relevant code.
Change-Id: Idd66d72f716b7e7dc08faa31ae43e9a23639bae3
Reviewed-on: http://gerrit.openafs.org/4636
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This patch implements more fine-grained locking for dcache entries.
The main advantage is that multiple chunks of the same file can be
fetched at once. This means that an incorrectly-guessed prefetch
won't block other fetches, prefetches of multiple chunks can occur
in parallel, and multiple processes sharing the same file can read
from different parts of the file at once.