aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-02 17:42:39 -0500
committerSage Weil <sage@newdream.net>2009-12-03 17:59:48 -0500
commit33d4909ccc094b8262667bccdd52e01458bee0df (patch)
tree1943b9d2f1796566c827e317958c3bfa8c7dc14f /fs/ceph
parent1d1de9160e0d8aff0d67a21137b62e63ffd6f184 (diff)
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')
-rw-r--r--fs/ceph/ioctl.c5
-rw-r--r--fs/ceph/ioctl.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 4c33e19fc241..8a5bcae62846 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)
24 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); 24 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
25 l.object_size = ceph_file_layout_object_size(ci->i_layout); 25 l.object_size = ceph_file_layout_object_size(ci->i_layout);
26 l.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool); 26 l.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool);
27 l.preferred_osd =
28 (s32)le32_to_cpu(ci->i_layout.fl_pg_preferred);
27 if (copy_to_user(arg, &l, sizeof(l))) 29 if (copy_to_user(arg, &l, sizeof(l)))
28 return -EFAULT; 30 return -EFAULT;
29 } 31 }
@@ -79,7 +81,8 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
79 req->r_args.setlayout.layout.fl_object_size = 81 req->r_args.setlayout.layout.fl_object_size =
80 cpu_to_le32(l.object_size); 82 cpu_to_le32(l.object_size);
81 req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool); 83 req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool);
82 req->r_args.setlayout.layout.fl_pg_preferred = cpu_to_le32((s32)-1); 84 req->r_args.setlayout.layout.fl_pg_preferred =
85 cpu_to_le32(l.preferred_osd);
83 86
84 err = ceph_mdsc_do_request(mdsc, parent_inode, req); 87 err = ceph_mdsc_do_request(mdsc, parent_inode, req);
85 ceph_mdsc_put_request(req); 88 ceph_mdsc_put_request(req);
diff --git a/fs/ceph/ioctl.h b/fs/ceph/ioctl.h
index 3c511dab3730..25e4f1a9d059 100644
--- a/fs/ceph/ioctl.h
+++ b/fs/ceph/ioctl.h
@@ -10,6 +10,7 @@
10struct ceph_ioctl_layout { 10struct ceph_ioctl_layout {
11 __u64 stripe_unit, stripe_count, object_size; 11 __u64 stripe_unit, stripe_count, object_size;
12 __u64 data_pool; 12 __u64 data_pool;
13 __s64 preferred_osd;
13}; 14};
14 15
15#define CEPH_IOC_GET_LAYOUT _IOR(CEPH_IOCTL_MAGIC, 1, \ 16#define CEPH_IOC_GET_LAYOUT _IOR(CEPH_IOCTL_MAGIC, 1, \