diff options
author | Sage Weil <sage@inktank.com> | 2013-02-25 19:13:08 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-02-26 18:02:37 -0500 |
commit | 2169aea649c08374bec7d220a3b8f64712275356 (patch) | |
tree | 8a287c8239a5e1fc47afae4fbec530a467825706 /fs/ceph | |
parent | 4f6a7e5ee1393ec4b243b39dac9f36992d161540 (diff) |
libceph: calculate placement based on the internal data types
Instead of using the old ceph_object_layout struct, update our internal
ceph_calc_object_layout method to use the ceph_pg type. This allows us to
pass the full 32-bit precision of the pgid.seed to the callers. It also
allows some callers to avoid reaching into the request structures for the
struct ceph_object_layout fields.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/ioctl.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index fb036ed3e129..7d85991fd647 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -185,7 +185,6 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
185 | &ceph_sb_to_client(inode->i_sb)->client->osdc; | 185 | &ceph_sb_to_client(inode->i_sb)->client->osdc; |
186 | u64 len = 1, olen; | 186 | u64 len = 1, olen; |
187 | u64 tmp; | 187 | u64 tmp; |
188 | struct ceph_object_layout ol; | ||
189 | struct ceph_pg pgid; | 188 | struct ceph_pg pgid; |
190 | int r; | 189 | int r; |
191 | 190 | ||
@@ -209,11 +208,9 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
209 | 208 | ||
210 | snprintf(dl.object_name, sizeof(dl.object_name), "%llx.%08llx", | 209 | snprintf(dl.object_name, sizeof(dl.object_name), "%llx.%08llx", |
211 | ceph_ino(inode), dl.object_no); | 210 | ceph_ino(inode), dl.object_no); |
212 | ceph_calc_object_layout(&ol, dl.object_name, &ci->i_layout, | 211 | ceph_calc_object_layout(&pgid, dl.object_name, &ci->i_layout, |
213 | osdc->osdmap); | 212 | osdc->osdmap); |
214 | 213 | ||
215 | pgid.pool = le32_to_cpu(ol.ol_pgid.pool); | ||
216 | pgid.seed = le16_to_cpu(ol.ol_pgid.ps); | ||
217 | dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid); | 214 | dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid); |
218 | if (dl.osd >= 0) { | 215 | if (dl.osd >= 0) { |
219 | struct ceph_entity_addr *a = | 216 | struct ceph_entity_addr *a = |