Whamcloud - gitweb
LU-12678 lnet: me: discard struct lnet_handle_me
The Portals API uses a cookie 'handle' to identify an ME. This is
appropriate for a user-space API for objects maintained by the
kernel, but it brings no value when the API client and
implementation are both in the kernel, as is the case with Lustre
and LNet.
Instead of using a 'handle', a pointer to the 'struct lnet_me' can
be used. This object is not reference counted and is always freed
correctly, so there can be no case where the cookie becomes invalid
while it is still held - as can be seen by the fact that the return
value from LNetMEUnlink() is never used except to assert that it is
zero.
So use 'struct lnet_me *' directly instead of having indirection
through a 'struct lnet_handle_me'.
Also:
- change LNetMEUnlink() to return void as it cannot fail now.
- have LNetMEAttach() return the pointer, using ERR_PTR() to return
errors.
- discard ln_me_containers and don't store the me there-in.
- store an explicit 'cpt' in each me, we no longer store one
implicitly via the cookie.
Test-Parameters: trivial testlist=sanity-lnet
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I4e73e3217a244d8d15da90a8ba80371d1fd5f61f
Reviewed-on: https://review.whamcloud.com/36859
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>