Whamcloud - gitweb
LU-11085 mdt: revise recording of hsm progress updates. 25/39725/11
authorMr NeilBrown <neilb@suse.de>
Mon, 24 Aug 2020 22:28:18 +0000 (08:28 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 10 Mar 2021 08:02:20 +0000 (08:02 +0000)
commitf684172237e99b8064a68bd6e53bcbb915c663c5
treefb10444b57035355e8f2e6ae082e97671aac417d
parent0d2fb010279e1ac5e2c0f2c97b0ccb9ba27c4c51
LU-11085 mdt: revise recording of hsm progress updates.

When copy tool is migrating a file for HSM purposes it can report
progress as individual intervals, and the total covered by all the
intervals can be requested.

This patch makes various changes to the code for recording the
intervals.

- switch to the Linux interval-tree implementation rather than the
  lustre one.
- detect overlapping intervals as well as duplicates.  Any overlapping
  or adjacent intervals are removed and the space which they covered
  is added the the new interval.
- keep track of the total of all current intervals, so that it can be
  returned on request without needing to examine the interval tree.
- use a spinlock rather than a mutex to protect against parallel
  updates, as all operations are non-blocking.

Also add a test to llapi_hsm_test.c to send overlapping intervals and
check the result is as expected.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Id300b64949a3416ee3282c5e4ce82122c9e4e2f0
Reviewed-on: https://review.whamcloud.com/39725
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs.h
lustre/mdt/mdt_hsm_cdt_client.c
lustre/mdt/mdt_hsm_cdt_requests.c
lustre/mdt/mdt_internal.h
lustre/tests/llapi_hsm_test.c