summaryrefslogtreecommitdiffstats
path: root/net/ceph/osdmap.c
diff options
context:
space:
mode:
authorIlya Dryomov2013-12-24 20:19:24 +0100
committerIlya Dryomov2013-12-31 19:32:14 +0100
commite8ef19c4ad161768e1d8309d5ae18481c098eb81 (patch)
tree9ba7cd6965c530228085fba2bf23dcc132ea94d3 /net/ceph/osdmap.c
parentcrush: fix some comments (diff)
downloadkernel-qcow2-linux-e8ef19c4ad161768e1d8309d5ae18481c098eb81.tar.gz
kernel-qcow2-linux-e8ef19c4ad161768e1d8309d5ae18481c098eb81.tar.xz
kernel-qcow2-linux-e8ef19c4ad161768e1d8309d5ae18481c098eb81.zip
crush: eliminate CRUSH_MAX_SET result size limitation
This is only present to size the temporary scratch arrays that we put on the stack. Let the caller allocate them as they wish and remove the limitation. Reflects ceph.git commit 1cfe140bf2dab99517589a82a916f4c75b9492d1. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/osdmap.c')
-rw-r--r--net/ceph/osdmap.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 6477a68ddecb..8b1a6b48bb5d 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -1110,6 +1110,16 @@ int ceph_calc_ceph_pg(struct ceph_pg *pg, const char *oid,
}
EXPORT_SYMBOL(ceph_calc_ceph_pg);
+static int crush_do_rule_ary(const struct crush_map *map, int ruleno, int x,
+ int *result, int result_max,
+ const __u32 *weight, int weight_max)
+{
+ int scratch[result_max * 3];
+
+ return crush_do_rule(map, ruleno, x, result, result_max,
+ weight, weight_max, scratch);
+}
+
/*
* Calculate raw osd vector for the given pgid. Return pointer to osd
* array, or NULL on failure.
@@ -1163,9 +1173,9 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
pool->pgp_num_mask) +
(unsigned)pgid.pool;
}
- r = crush_do_rule(osdmap->crush, ruleno, pps, osds,
- min_t(int, pool->size, *num),
- osdmap->osd_weight, osdmap->max_osd);
+ r = crush_do_rule_ary(osdmap->crush, ruleno, pps,
+ osds, min_t(int, pool->size, *num),
+ osdmap->osd_weight, osdmap->max_osd);
if (r < 0) {
pr_err("error %d from crush rule: pool %lld ruleset %d type %d"
" size %d\n", r, pgid.pool, pool->crush_ruleset,