From 1a0df8ea8ba98ebef4b0f35ee5458dc1fbce8b59 Mon Sep 17 00:00:00 2001 From: rread Date: Sat, 17 Aug 2002 23:16:08 +0000 Subject: [PATCH] - writing data to lov stripes is beginning to work. still much to check --- lustre/lov/lov_obd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index eb2ad6e..b2cec2e 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -317,7 +317,10 @@ static int lov_getattr(struct lustre_handle *conn, struct obdo *oa, obd_id id = oa->o_id; memcpy(oa, &tmp, sizeof(tmp)); oa->o_id = id; + } else { + oa->o_size += tmp.o_size; } + } RETURN(rc); } @@ -436,8 +439,8 @@ __u64 lov_offset(struct lov_stripe_md *md, __u64 in, int i) return 0xffffffffffffffff; } - if ( (i+1) * ssz < off ) - out += ssz; + if ( (i+1) * ssz <= off ) + out += (i+1) * ssz; else if ( i * ssz > off ) out += 0; else @@ -583,7 +586,7 @@ static inline int lov_brw(int cmd, struct lustre_handle *conn, shift = stripeinfo[which].index; ioarr[shift + stripeinfo[which].subcount] = pga[i]; - pga[i].off = lov_offset(md, pga[i].pg->index * PAGE_SIZE, which); + ioarr[shift + stripeinfo[which].subcount].off = lov_offset(md, pga[i].pg->index * PAGE_SIZE, which); stripeinfo[which].subcount++; } -- 1.8.3.1