Whamcloud - gitweb
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>