Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188598
b: refs/heads/master
c: 645a102
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil committed Oct 29, 2009
1 parent e7213a1 commit 7a08a6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5600f5ebd318f7af6f4b19a29f08d18bb85264e5
refs/heads/master: 645a102581b3639836b17d147c35d574fd6e8267
11 changes: 7 additions & 4 deletions trunk/fs/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
*/
void ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
u64 off, u64 *plen,
u64 *bno,
u64 *ono,
u64 *oxoff, u64 *oxlen)
{
u32 osize = le32_to_cpu(layout->fl_object_size);
Expand All @@ -750,11 +750,14 @@ void ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
stripepos = bl % sc;
objsetno = stripeno / su_per_object;

*bno = objsetno * sc + stripepos;
dout("objset %u * sc %u = bno %u\n", objsetno, sc, (unsigned)*bno);
/* *oxoff = *off % layout->fl_stripe_unit; */
*ono = objsetno * sc + stripepos;
dout("objset %u * sc %u = ono %u\n", objsetno, sc, (unsigned)*ono);

/* *oxoff = *off % layout->fl_stripe_unit; # offset in su */
t = off;
*oxoff = do_div(t, su);
*oxoff += (stripeno % su_per_object) * su;

*oxlen = min_t(u64, *plen, su - *oxoff);
*plen = *oxlen;

Expand Down

0 comments on commit 7a08a6a

Please sign in to comment.