All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] Error checking for llapi_hsm_action_progress().
Date: Wed, 02 Sep 2020 10:36:24 +1000	[thread overview]
Message-ID: <87imcxxbef.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <3df93cf2-1a94-f7bf-e073-29bf0c8c985a@cea.fr>

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(
                        &crp->crp_root,
 			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.

NeilBrown
-------------- 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>

  parent reply	other threads:[~2020-09-02  0:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31  4:03 [lustre-devel] Error checking for llapi_hsm_action_progress() NeilBrown
2020-08-31 12:53 ` quentin.bouget at cea.fr
2020-09-01  0:58   ` NeilBrown
2020-09-01  9:33     ` quentin.bouget at cea.fr
2020-09-01 12:07       ` Degremont, Aurelien
2020-09-02  0:36       ` NeilBrown [this message]
2020-08-31 15:36 ` Joseph Benjamin Evans
2020-09-01  1:27   ` NeilBrown
2020-09-01  7:41     ` Degremont, Aurelien
2020-09-01 13:10       ` Joseph Benjamin Evans
2020-09-18 17:33 Nathan Rutman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imcxxbef.fsf@notabene.neil.brown.name \
    --to=neilb@suse.de \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.