aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-07 18:33:36 -0400
committerSage Weil <sage@inktank.com>2012-05-07 18:33:36 -0400
commit3469ac1aa3a2f1e2586a412923c414779a0af854 (patch)
treeb271456518130622e6d394cf50939c132f1a1d0d /fs/ceph
parentcd9d9f5df6098c50726200d4185e9e8da32785b3 (diff)
ceph: drop support for preferred_osd pgs
This was an ill-conceived feature that has been removed from Ceph. Do this gracefully: - reject attempts to specify a preferred_osd via the ioctl - stop exposing this information via virtual xattrs - always fill in -1 for requests, in case we talk to an older server - don't calculate preferred_osd placements/pgids Reviewed-by: Alex Elder <elder@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/file.c1
-rw-r--r--fs/ceph/ioctl.c15
-rw-r--r--fs/ceph/xattr.c9
3 files changed, 5 insertions, 20 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index ed72428d9c75..988d4f302e48 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -54,7 +54,6 @@ prepare_open_request(struct super_block *sb, int flags, int create_mode)
54 req->r_fmode = ceph_flags_to_mode(flags); 54 req->r_fmode = ceph_flags_to_mode(flags);
55 req->r_args.open.flags = cpu_to_le32(flags); 55 req->r_args.open.flags = cpu_to_le32(flags);
56 req->r_args.open.mode = cpu_to_le32(create_mode); 56 req->r_args.open.mode = cpu_to_le32(create_mode);
57 req->r_args.open.preferred = cpu_to_le32(-1);
58out: 57out:
59 return req; 58 return req;
60} 59}
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 790914a598dd..4feab52c5bff 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -26,8 +26,7 @@ static long ceph_ioctl_get_layout(struct file *file, void __user *arg)
26 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); 26 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
27 l.object_size = ceph_file_layout_object_size(ci->i_layout); 27 l.object_size = ceph_file_layout_object_size(ci->i_layout);
28 l.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool); 28 l.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool);
29 l.preferred_osd = 29 l.preferred_osd = (s32)-1;
30 (s32)le32_to_cpu(ci->i_layout.fl_pg_preferred);
31 if (copy_to_user(arg, &l, sizeof(l))) 30 if (copy_to_user(arg, &l, sizeof(l)))
32 return -EFAULT; 31 return -EFAULT;
33 } 32 }
@@ -49,6 +48,10 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
49 if (copy_from_user(&l, arg, sizeof(l))) 48 if (copy_from_user(&l, arg, sizeof(l)))
50 return -EFAULT; 49 return -EFAULT;
51 50
51 /* preferred_osd is no longer supported */
52 if (l.preferred_osd != -1)
53 return -EINVAL;
54
52 /* validate changed params against current layout */ 55 /* validate changed params against current layout */
53 err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); 56 err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT);
54 if (!err) { 57 if (!err) {
@@ -56,8 +59,6 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
56 nl.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); 59 nl.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
57 nl.object_size = ceph_file_layout_object_size(ci->i_layout); 60 nl.object_size = ceph_file_layout_object_size(ci->i_layout);
58 nl.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool); 61 nl.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool);
59 nl.preferred_osd =
60 (s32)le32_to_cpu(ci->i_layout.fl_pg_preferred);
61 } else 62 } else
62 return err; 63 return err;
63 64
@@ -69,8 +70,6 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
69 nl.object_size = l.object_size; 70 nl.object_size = l.object_size;
70 if (l.data_pool) 71 if (l.data_pool)
71 nl.data_pool = l.data_pool; 72 nl.data_pool = l.data_pool;
72 if (l.preferred_osd)
73 nl.preferred_osd = l.preferred_osd;
74 73
75 if ((nl.object_size & ~PAGE_MASK) || 74 if ((nl.object_size & ~PAGE_MASK) ||
76 (nl.stripe_unit & ~PAGE_MASK) || 75 (nl.stripe_unit & ~PAGE_MASK) ||
@@ -106,8 +105,6 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
106 req->r_args.setlayout.layout.fl_object_size = 105 req->r_args.setlayout.layout.fl_object_size =
107 cpu_to_le32(l.object_size); 106 cpu_to_le32(l.object_size);
108 req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool); 107 req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool);
109 req->r_args.setlayout.layout.fl_pg_preferred =
110 cpu_to_le32(l.preferred_osd);
111 108
112 parent_inode = ceph_get_dentry_parent_inode(file->f_dentry); 109 parent_inode = ceph_get_dentry_parent_inode(file->f_dentry);
113 err = ceph_mdsc_do_request(mdsc, parent_inode, req); 110 err = ceph_mdsc_do_request(mdsc, parent_inode, req);
@@ -171,8 +168,6 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
171 cpu_to_le32(l.object_size); 168 cpu_to_le32(l.object_size);
172 req->r_args.setlayout.layout.fl_pg_pool = 169 req->r_args.setlayout.layout.fl_pg_pool =
173 cpu_to_le32(l.data_pool); 170 cpu_to_le32(l.data_pool);
174 req->r_args.setlayout.layout.fl_pg_preferred =
175 cpu_to_le32(l.preferred_osd);
176 171
177 err = ceph_mdsc_do_request(mdsc, inode, req); 172 err = ceph_mdsc_do_request(mdsc, inode, req);
178 ceph_mdsc_put_request(req); 173 ceph_mdsc_put_request(req);
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
index 35b86331d8a5..785cb3057c95 100644
--- a/fs/ceph/xattr.c
+++ b/fs/ceph/xattr.c
@@ -118,15 +118,6 @@ static size_t ceph_vxattrcb_file_layout(struct ceph_inode_info *ci, char *val,
118 (unsigned long long)ceph_file_layout_su(ci->i_layout), 118 (unsigned long long)ceph_file_layout_su(ci->i_layout),
119 (unsigned long long)ceph_file_layout_stripe_count(ci->i_layout), 119 (unsigned long long)ceph_file_layout_stripe_count(ci->i_layout),
120 (unsigned long long)ceph_file_layout_object_size(ci->i_layout)); 120 (unsigned long long)ceph_file_layout_object_size(ci->i_layout));
121
122 if (ceph_file_layout_pg_preferred(ci->i_layout) >= 0) {
123 val += ret;
124 size -= ret;
125 ret += snprintf(val, size, "preferred_osd=%lld\n",
126 (unsigned long long)ceph_file_layout_pg_preferred(
127 ci->i_layout));
128 }
129
130 return ret; 121 return ret;
131} 122}
132 123