diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-02-03 08:24:49 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-07-27 20:55:36 -0400 |
commit | 7627151ea30bce2051e3cb27d7bb2c30083f86a5 (patch) | |
tree | 8a4c9422b30c3e50eb76923c746747f4e09d0bb5 /fs/ceph/ioctl.c | |
parent | 22748f9d617b8cd0a915c3a4c656c7232645b3b5 (diff) |
libceph: define new ceph_file_layout structure
Define new ceph_file_layout structure and rename old ceph_file_layout
to ceph_file_layout_legacy. This is preparation for adding namespace
to ceph_file_layout structure.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/ioctl.c')
-rw-r--r-- | fs/ceph/ioctl.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 0946f2d4a81f..843dd31a02cd 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -21,10 +21,10 @@ static long ceph_ioctl_get_layout(struct file *file, void __user *arg) | |||
21 | 21 | ||
22 | err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); | 22 | err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); |
23 | if (!err) { | 23 | if (!err) { |
24 | l.stripe_unit = ceph_file_layout_su(ci->i_layout); | 24 | l.stripe_unit = ci->i_layout.stripe_unit; |
25 | l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); | 25 | l.stripe_count = ci->i_layout.stripe_count; |
26 | l.object_size = ceph_file_layout_object_size(ci->i_layout); | 26 | l.object_size = ci->i_layout.object_size; |
27 | l.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool); | 27 | l.data_pool = ci->i_layout.pool_id; |
28 | l.preferred_osd = (s32)-1; | 28 | l.preferred_osd = (s32)-1; |
29 | if (copy_to_user(arg, &l, sizeof(l))) | 29 | if (copy_to_user(arg, &l, sizeof(l))) |
30 | return -EFAULT; | 30 | return -EFAULT; |
@@ -82,19 +82,19 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg) | |||
82 | if (l.stripe_count) | 82 | if (l.stripe_count) |
83 | nl.stripe_count = l.stripe_count; | 83 | nl.stripe_count = l.stripe_count; |
84 | else | 84 | else |
85 | nl.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); | 85 | nl.stripe_count = ci->i_layout.stripe_count; |
86 | if (l.stripe_unit) | 86 | if (l.stripe_unit) |
87 | nl.stripe_unit = l.stripe_unit; | 87 | nl.stripe_unit = l.stripe_unit; |
88 | else | 88 | else |
89 | nl.stripe_unit = ceph_file_layout_su(ci->i_layout); | 89 | nl.stripe_unit = ci->i_layout.stripe_unit; |
90 | if (l.object_size) | 90 | if (l.object_size) |
91 | nl.object_size = l.object_size; | 91 | nl.object_size = l.object_size; |
92 | else | 92 | else |
93 | nl.object_size = ceph_file_layout_object_size(ci->i_layout); | 93 | nl.object_size = ci->i_layout.object_size; |
94 | if (l.data_pool) | 94 | if (l.data_pool) |
95 | nl.data_pool = l.data_pool; | 95 | nl.data_pool = l.data_pool; |
96 | else | 96 | else |
97 | nl.data_pool = ceph_file_layout_pg_pool(ci->i_layout); | 97 | nl.data_pool = ci->i_layout.pool_id; |
98 | 98 | ||
99 | /* this is obsolete, and always -1 */ | 99 | /* this is obsolete, and always -1 */ |
100 | nl.preferred_osd = le64_to_cpu(-1); | 100 | nl.preferred_osd = le64_to_cpu(-1); |
@@ -202,8 +202,8 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
202 | return -EIO; | 202 | return -EIO; |
203 | } | 203 | } |
204 | dl.file_offset -= dl.object_offset; | 204 | dl.file_offset -= dl.object_offset; |
205 | dl.object_size = ceph_file_layout_object_size(ci->i_layout); | 205 | dl.object_size = ci->i_layout.object_size; |
206 | dl.block_size = ceph_file_layout_su(ci->i_layout); | 206 | dl.block_size = ci->i_layout.stripe_unit; |
207 | 207 | ||
208 | /* block_offset = object_offset % block_size */ | 208 | /* block_offset = object_offset % block_size */ |
209 | tmp = dl.object_offset; | 209 | tmp = dl.object_offset; |
@@ -212,7 +212,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
212 | snprintf(dl.object_name, sizeof(dl.object_name), "%llx.%08llx", | 212 | snprintf(dl.object_name, sizeof(dl.object_name), "%llx.%08llx", |
213 | ceph_ino(inode), dl.object_no); | 213 | ceph_ino(inode), dl.object_no); |
214 | 214 | ||
215 | oloc.pool = ceph_file_layout_pg_pool(ci->i_layout); | 215 | oloc.pool = ci->i_layout.pool_id; |
216 | ceph_oid_printf(&oid, "%s", dl.object_name); | 216 | ceph_oid_printf(&oid, "%s", dl.object_name); |
217 | 217 | ||
218 | r = ceph_object_locator_to_pg(osdc->osdmap, &oid, &oloc, &pgid); | 218 | r = ceph_object_locator_to_pg(osdc->osdmap, &oid, &oloc, &pgid); |