Whamcloud - gitweb
LU-12542 handle: move refcount into the lustre_handle. 94/35794/15
authorNeilBrown <neilb@suse.com>
Wed, 11 Sep 2019 15:34:54 +0000 (11:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 6 Dec 2019 01:04:15 +0000 (01:04 +0000)
commitae22814bccc6dfa3b72b15cef45ed7c2731d4e3e
tree8575438dae35540b74cf4881cc78d8272d5e1ddb
parent21d671b3af09af65d38a454e677c5da9830e0c7a
LU-12542 handle: move refcount into the lustre_handle.

Most objects with a lustre_handle have a refcount. The exception
is mdt_mfd which uses locking (med_open_lock) to manage its
lifetime. The lustre_handles code currently needs a call-out to
increment its refcount. To simplify things, move the refcount
into the lustre_hanle (which will be largely ignored by mdt_mfd)
and discard the call-out.

To avoid warnings when refcount debugging is enabled the refcount
of mdt_mfd is initialized to 1, and decremeneted after any
class_handle2object() call which would have incremented it.

In order to preserve the same debug messages, we store an object type
name in the portals_handle_ops, and use that in a CDEBUG() when
incrementing the ref count.

Change-Id: I1920330b2aeffd4b865cb9b249997aa28b209c33
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-on: https://review.whamcloud.com/35794
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/Makefile.am
libcfs/include/libcfs/linux/linux-refcount.h [new file with mode: 0644]
lustre/include/lustre_dlm.h
lustre/include/lustre_export.h
lustre/include/lustre_handles.h
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lock.c
lustre/mdt/mdt_open.c
lustre/obdclass/genops.c
lustre/obdclass/lustre_handles.c
lustre/obdecho/echo_client.c
lustre/ptlrpc/service.c