diff options
author | Sage Weil <sage@newdream.net> | 2009-12-02 14:42:39 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-12-03 14:59:48 -0800 |
commit | 33d4909ccc094b8262667bccdd52e01458bee0df (patch) | |
tree | 1943b9d2f1796566c827e317958c3bfa8c7dc14f /fs/ceph/ioctl.c | |
parent | 1d1de9160e0d8aff0d67a21137b62e63ffd6f184 (diff) | |
download | op-kernel-dev-33d4909ccc094b8262667bccdd52e01458bee0df.zip op-kernel-dev-33d4909ccc094b8262667bccdd52e01458bee0df.tar.gz |
ceph: allow preferred osd to be get/set via layout ioctl
There is certainly no reason not to report this.
The only real downside to allowing the user to set it is that you don't
get default values by zeroing the layout struct (the default is -1).
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/ioctl.c')
-rw-r--r-- | fs/ceph/ioctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 4c33e19..8a5bcae 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c @@ -24,6 +24,8 @@ static long ceph_ioctl_get_layout(struct file *file, void __user *arg) l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); l.object_size = ceph_file_layout_object_size(ci->i_layout); l.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool); + l.preferred_osd = + (s32)le32_to_cpu(ci->i_layout.fl_pg_preferred); if (copy_to_user(arg, &l, sizeof(l))) return -EFAULT; } @@ -79,7 +81,8 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg) req->r_args.setlayout.layout.fl_object_size = cpu_to_le32(l.object_size); req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool); - req->r_args.setlayout.layout.fl_pg_preferred = cpu_to_le32((s32)-1); + req->r_args.setlayout.layout.fl_pg_preferred = + cpu_to_le32(l.preferred_osd); err = ceph_mdsc_do_request(mdsc, parent_inode, req); ceph_mdsc_put_request(req); |