Whamcloud - gitweb
LU-11085 ldlm: convert ldlm extent locks to linux extent-tree 92/41792/17
authorMr NeilBrown <neilb@suse.de>
Fri, 21 Aug 2020 00:28:53 +0000 (10:28 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 29 May 2024 04:44:22 +0000 (04:44 +0000)
commitd2ff746a997395e6a31d107e4026ae93c59aef87
treec305fe5f0ffcf2334de262a15bfa05cd60d67fe1
parentf5e73b3efb71b7d88d80389f84aef670a37210c3
LU-11085 ldlm: convert ldlm extent locks to linux extent-tree

As Linux has a fully customizable extent tree implementation, use that
instead of the one in lustre.  This removes the need to store the
extent endpoints in the lock twice, thus recovering some of the space
wasted in a previous patch.

It also allows iteration loops to be in-line rather than requiring a
callback - though in some cases we keep the callback.

Note that interval_expand() will not expand the lower boundary down if
the tree is not empty.  We now make that explicit in the loop in
ldlm_extent_internal_policy_granted().  Consequently testing of
'conflicting > 4' is irrelevant.

Linux extent-trees does not have a direct equivalent to
interval_is_overlapped(), however we can use extent_iter_first() to
achieve the same effect.

We ask for the first interval in the tree that covers the range of the
given interval with extent_iter_first().  If nothing is returned, then
nothing in the tree overlaps the interval and interval_is_overlapped()
would return false.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: Ie28c6fb0d40d2c92c7067c7a79f48ee1fc633ce9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/41792
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
libcfs/include/libcfs/linux/linux-misc.h
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_resource.c
lustre/ofd/ofd_dlm.c