osc_extent_is_overlapped() open-codes exactly the test that
overlapped() performs.
So use overlapped() instead, to make the code more obviously
consistent.
Linux-Commit:
270995b08634 ("lustre: osc: use overlapped()
consistently.")
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I3a3ed2ee04343a294ae94f205f5d12be98f99bf3
Reviewed-on: https://review.whamcloud.com/37602
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
__res; \
})
+static inline bool
+overlapped(const struct osc_extent *ex1, const struct osc_extent *ex2)
+{
+ return !(ex1->oe_end < ex2->oe_start || ex2->oe_end < ex1->oe_start);
+}
/**
* sanity check - to make sure there is no overlapped extent in the tree.
for (tmp = first_extent(obj); tmp != NULL; tmp = next_extent(tmp)) {
if (tmp == ext)
continue;
- if (tmp->oe_end >= ext->oe_start &&
- tmp->oe_start <= ext->oe_end)
+ if (overlapped(tmp, ext))
return 1;
}
return 0;
RETURN(rc);
}
-static inline bool
-overlapped(const struct osc_extent *ex1, const struct osc_extent *ex2)
-{
- return !(ex1->oe_end < ex2->oe_start || ex2->oe_end < ex1->oe_start);
-}
-
/**
* Find or create an extent which includes @index, core function to manage
* extent tree.