*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*/
#define DEBUG_SUBSYSTEM S_LOV
#include "lov_internal.h"
-static loff_t stripe_width(struct lov_stripe_md *lsm, unsigned int index)
+loff_t stripe_width(struct lov_stripe_md *lsm, unsigned int index)
{
struct lov_stripe_md_entry *entry = lsm->lsm_entries[index];
* given an extent in an lov and a stripe, calculate the extent of the stripe
* that is contained within the lov extent. this returns true if the given
* stripe does intersect with the lov extent.
+ *
+ * Closed interval [@obd_start, @obd_end] will be returned if caller needs them.
*/
int lov_stripe_intersects(struct lov_stripe_md *lsm, int index, int stripeno,
struct lu_extent *ext, u64 *obd_start, u64 *obd_end)
struct lov_stripe_md_entry *entry = lsm->lsm_entries[index];
u64 start, end;
int start_side, end_side;
+ u64 loc_start, loc_end;
if (!lu_extent_is_overlapped(ext, &entry->lsme_extent))
return 0;
+ if (!obd_start)
+ obd_start = &loc_start;
+ if (!obd_end)
+ obd_end = &loc_end;
+
start = max_t(__u64, ext->e_start, entry->lsme_extent.e_start);
end = min_t(__u64, ext->e_end, entry->lsme_extent.e_end);
if (end != OBD_OBJECT_EOF)