autofs-5.1.2 - create thread-local ID for mount attempts

This patch creates key_thread_attempt_id as a pthread key and populates it
in each new thread serving a mount attempt. This ID can be used in output logs
as an easy string to grep for, allowing admins to quickly see a mount attempt's
log entries without the messages from other attempts interleaved.

The contents of the ID are intended to be opaque, but to get a chance at
a unique value for each mount attempt, this patch does a very simple hash
computation of the thread's wait_queue_token, the pid of the requesting
process, and the key for the mount. The hash is based on the public domain
sdbm library.

Signed-off-by: Lars R. Damerow <lars@pixar.com>
Signed-off-by: Ian Kent <raven@themaw.net>
5 files changed