Whamcloud - gitweb
LU-12542 handles: discard h_owner in favour of h_ops 39/35739/3
authorNeilBrown <neilb@suse.com>
Fri, 9 Aug 2019 00:02:43 +0000 (20:02 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Aug 2019 07:55:48 +0000 (07:55 +0000)
commit9bda0a5cad190f33571ff6bce4235cd7fc4f76fd
treed99501482957f8ee38f85f3860e6dc8a09da6e34
parentf36a5491d0bf4d861dc3332a600fca5a450afcb6
LU-12542 handles: discard h_owner in favour of h_ops

lustre_handles assigned a 64bit unique identifier (a 'cookie') to
objects of various types and stored them in a hash table, allowing
them to be accessed by the cookie.

There is a facility for type checking by recording an 'owner' for each
object, and checking the owner on lookup. Unfortunately this is not
used - owner is always zero for the client.

Each object also contains an h_ops pointer which can be used to
reliably identify an owner.

So discard h_owner, pass and 'ops' pointer to class_handle2object(),
and only return objects for which the h_ops matches.

Note: this h_owner is now quiet different from the similar h_owner
in the server code.  When the server code is merged the "med" pointer
should be stored in the "mfd" and validated separately.

This reduces the size of the portals_handle by one pointer, which
benefits various other structures including struct ldlm_lock which can
be very populous and so is best keep small.

Change-Id: I9cf2b32f8b0ea7c188888301fb6130818b3d5ae9
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-on: https://review.whamcloud.com/35739
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_handles.h
lustre/ldlm/ldlm_lock.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_open.c
lustre/obdclass/genops.c
lustre/obdclass/lustre_handles.c