[lustre-devel] Error checking for llapi_hsm_action_progress().

NeilBrown neilb at suse.de
Tue Sep 1 17:36:24 PDT 2020

On Tue, Sep 01 2020, quentin.bouget at cea.fr wrote:
> Ideally, there would be a standard data structure that automatically 
> merges overlapping/contiguous extents.
> But I don't know any, and I don't think it is worth coding one from scratch.

An interval tree is close enough that it would take .. uhmm....

 while ((overlap = interval_iter_first(
 			node->start == 0 ? 0 : node->start - 1,
                        node->end == LUSTRE_EOF ? LUSTRE_EOF : node->end + 1))
        != NULL) {
	node->start = min(node->start, overlap->start);
        node->end = max(node->end, overlap->end);
        interval_remove(node, &crp->crp_root);
 interval_insert(node, &crp->crp_root);

... 10 lines of code to merge overlapping regions.

Maybe I'll do that.

I get the general impression that while people don't see it as very
important to keep track of the reported ranges, they would probably feel
a little happier if we kept track than if we didn't.
Reporting errors on overlaps is definitely out, but merging overlaps
is widely seen as sensible.

Thanks everyone for the feedback.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 853 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20200902/5a48ce37/attachment.sig>

More information about the lustre-devel mailing list