X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flov_offset.c;h=86d4ae9745e07557bffffe0a5b3569c1ee971e81;hb=3c69d46e1766480c0ffd1bef840b4e167b4cf88e;hp=0c9d6683183e2ff91760632a24ca8089017d1cf6;hpb=225e7b8c70fb68bc3aa3a6d88c5e9bda322c9cc9;p=fs%2Flustre-release.git diff --git a/lustre/lov/lov_offset.c b/lustre/lov/lov_offset.c index 0c9d668..86d4ae9 100644 --- a/lustre/lov/lov_offset.c +++ b/lustre/lov/lov_offset.c @@ -27,7 +27,6 @@ */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. */ #define DEBUG_SUBSYSTEM S_LOV @@ -38,7 +37,7 @@ #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]; @@ -238,7 +237,7 @@ loff_t lov_size_to_stripe(struct lov_stripe_md *lsm, int index, u64 file_size, * 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. + * 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) @@ -246,10 +245,16 @@ int lov_stripe_intersects(struct lov_stripe_md *lsm, int index, int stripeno, 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)