diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/lov/lov_offset.c')
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_offset.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_offset.c b/drivers/staging/lustre/lustre/lov/lov_offset.c index aa520aa76e09..ae83eb0f6f36 100644 --- a/drivers/staging/lustre/lustre/lov/lov_offset.c +++ b/drivers/staging/lustre/lustre/lov/lov_offset.c @@ -43,8 +43,7 @@ #include "lov_internal.h" /* compute object size given "stripeno" and the ost size */ -u64 lov_stripe_size(struct lov_stripe_md *lsm, u64 ost_size, - int stripeno) +u64 lov_stripe_size(struct lov_stripe_md *lsm, u64 ost_size, int stripeno) { unsigned long ssize = lsm->lsm_stripe_size; unsigned long stripe_size; @@ -55,7 +54,6 @@ u64 lov_stripe_size(struct lov_stripe_md *lsm, u64 ost_size, if (ost_size == 0) return 0; - LASSERT(lsm_op_find(magic) != NULL); lsm_op_find(magic)->lsm_stripe_by_index(lsm, &stripeno, NULL, &swidth); /* lov_do_div64(a, b) returns a % b, and a = a / b */ @@ -115,7 +113,8 @@ u64 lov_stripe_size(struct lov_stripe_md *lsm, u64 ost_size, * this function returns < 0 when the offset was "before" the stripe and * was moved forward to the start of the stripe in question; 0 when it * falls in the stripe and no shifting was done; > 0 when the offset - * was outside the stripe and was pulled back to its final byte. */ + * was outside the stripe and was pulled back to its final byte. + */ int lov_stripe_offset(struct lov_stripe_md *lsm, u64 lov_off, int stripeno, u64 *obdoff) { @@ -129,8 +128,6 @@ int lov_stripe_offset(struct lov_stripe_md *lsm, u64 lov_off, return 0; } - LASSERT(lsm_op_find(magic) != NULL); - lsm_op_find(magic)->lsm_stripe_by_index(lsm, &stripeno, &lov_off, &swidth); @@ -183,7 +180,6 @@ u64 lov_size_to_stripe(struct lov_stripe_md *lsm, u64 file_size, if (file_size == OBD_OBJECT_EOF) return OBD_OBJECT_EOF; - LASSERT(lsm_op_find(magic) != NULL); lsm_op_find(magic)->lsm_stripe_by_index(lsm, &stripeno, &file_size, &swidth); @@ -213,7 +209,8 @@ u64 lov_size_to_stripe(struct lov_stripe_md *lsm, u64 file_size, /* 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. */ + * stripe does intersect with the lov extent. + */ int lov_stripe_intersects(struct lov_stripe_md *lsm, int stripeno, u64 start, u64 end, u64 *obd_start, u64 *obd_end) { @@ -227,7 +224,8 @@ int lov_stripe_intersects(struct lov_stripe_md *lsm, int stripeno, /* this stripe doesn't intersect the file extent when neither * start or the end intersected the stripe and obd_start and - * obd_end got rounded up to the save value. */ + * obd_end got rounded up to the save value. + */ if (start_side != 0 && end_side != 0 && *obd_start == *obd_end) return 0; @@ -238,7 +236,8 @@ int lov_stripe_intersects(struct lov_stripe_md *lsm, int stripeno, * in the wrong direction and touch it up. * interestingly, this can't underflow since end must be > start * if we passed through the previous check. - * (should we assert for that somewhere?) */ + * (should we assert for that somewhere?) + */ if (end_side != 0) (*obd_end)--; @@ -252,7 +251,6 @@ int lov_stripe_number(struct lov_stripe_md *lsm, u64 lov_off) u64 stripe_off, swidth; int magic = lsm->lsm_magic; - LASSERT(lsm_op_find(magic) != NULL); lsm_op_find(magic)->lsm_stripe_by_offset(lsm, NULL, &lov_off, &swidth); stripe_off = lov_do_div64(lov_off, swidth); |