diff options
author | Alex Elder <elder@dreamhost.com> | 2012-02-02 09:13:30 -0500 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-22 11:47:48 -0400 |
commit | 60571c7d556b10db7e555bd4b6765647af5c41e8 (patch) | |
tree | 34e5f4f677693791efc489ca9005356cd4477a01 /drivers/block/rbd.c | |
parent | d720bcb0a8f246eb441ba9d4f341bc16746556c6 (diff) |
rbd: reduce memory used for rbd_dev fields
The length of the string containing the monitor address
specification(s) will never exceed the length of the string passed
in to rbd_add(). The same holds true for the ceph + rbd options
string. So reduce the amount of memory allocated for these to
that length rather than the maximum (1024 bytes).
Signed-off-by: Alex Elder <elder@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 3e6f300ba9f1..606d59aece2b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -2234,11 +2234,11 @@ static ssize_t rbd_add(struct bus_type *bus, | |||
2234 | if (!try_module_get(THIS_MODULE)) | 2234 | if (!try_module_get(THIS_MODULE)) |
2235 | return -ENODEV; | 2235 | return -ENODEV; |
2236 | 2236 | ||
2237 | mon_dev_name = kmalloc(RBD_MAX_OPT_LEN, GFP_KERNEL); | 2237 | mon_dev_name = kmalloc(count, GFP_KERNEL); |
2238 | if (!mon_dev_name) | 2238 | if (!mon_dev_name) |
2239 | goto err_out_mod; | 2239 | goto err_out_mod; |
2240 | 2240 | ||
2241 | options = kmalloc(RBD_MAX_OPT_LEN, GFP_KERNEL); | 2241 | options = kmalloc(count, GFP_KERNEL); |
2242 | if (!options) | 2242 | if (!options) |
2243 | goto err_mon_dev; | 2243 | goto err_mon_dev; |
2244 | 2244 | ||