diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 12:11:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 12:11:28 -0500 |
commit | 51b736b85155a56543fda8aeca5f8592795d7983 (patch) | |
tree | 937c8be978bf66084128cd62fca3e94fa50c3f36 /drivers/block | |
parent | a8aa1ebdf880ebe7b5738ccebf67e18d62cbdc0b (diff) | |
parent | 66ae291978177d5c012015f12b8fbc76dc7d0965 (diff) |
Merge branch 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block:
cfq: set workload as expired if it doesn't have any slice left
Fix a CFQ crash in "for-2.6.33" branch of block tree
cfq: Remove wait_request flag when idle time is being deleted
cfq-iosched: commenting non-obvious initialization
cfq-iosched: Take care of corner cases of group losing share due to deletion
cfq-iosched: Get rid of cfqq wait_busy_done flag
cfq: Optimization for close cooperating queue searching
block,xd: Delay allocation of DMA buffers until device is known
drbd: Following the hmac change to SHASH (see linux commit 8bd1209cfff)
cfq-iosched: reduce write depth only if sync was delayed
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 3 | ||||
-rw-r--r-- | drivers/block/xd.c | 30 |
2 files changed, 20 insertions, 13 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 436a090b532b..4e0726aa53b0 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -1271,8 +1271,7 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, | |||
1271 | goto fail; | 1271 | goto fail; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | if (crypto_tfm_alg_type(crypto_hash_tfm(tfm)) | 1274 | if (crypto_tfm_alg_type(crypto_hash_tfm(tfm)) != CRYPTO_ALG_TYPE_SHASH) { |
1275 | != CRYPTO_ALG_TYPE_HASH) { | ||
1276 | retcode = ERR_AUTH_ALG_ND; | 1275 | retcode = ERR_AUTH_ALG_ND; |
1277 | goto fail; | 1276 | goto fail; |
1278 | } | 1277 | } |
diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 0877d3628fda..d1fd032e7514 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c | |||
@@ -169,13 +169,6 @@ static int __init xd_init(void) | |||
169 | 169 | ||
170 | init_timer (&xd_watchdog_int); xd_watchdog_int.function = xd_watchdog; | 170 | init_timer (&xd_watchdog_int); xd_watchdog_int.function = xd_watchdog; |
171 | 171 | ||
172 | if (!xd_dma_buffer) | ||
173 | xd_dma_buffer = (char *)xd_dma_mem_alloc(xd_maxsectors * 0x200); | ||
174 | if (!xd_dma_buffer) { | ||
175 | printk(KERN_ERR "xd: Out of memory.\n"); | ||
176 | return -ENOMEM; | ||
177 | } | ||
178 | |||
179 | err = -EBUSY; | 172 | err = -EBUSY; |
180 | if (register_blkdev(XT_DISK_MAJOR, "xd")) | 173 | if (register_blkdev(XT_DISK_MAJOR, "xd")) |
181 | goto out1; | 174 | goto out1; |
@@ -202,6 +195,19 @@ static int __init xd_init(void) | |||
202 | xd_drives,xd_drives == 1 ? "" : "s",xd_irq,xd_dma); | 195 | xd_drives,xd_drives == 1 ? "" : "s",xd_irq,xd_dma); |
203 | } | 196 | } |
204 | 197 | ||
198 | /* | ||
199 | * With the drive detected, xd_maxsectors should now be known. | ||
200 | * If xd_maxsectors is 0, nothing was detected and we fall through | ||
201 | * to return -ENODEV | ||
202 | */ | ||
203 | if (!xd_dma_buffer && xd_maxsectors) { | ||
204 | xd_dma_buffer = (char *)xd_dma_mem_alloc(xd_maxsectors * 0x200); | ||
205 | if (!xd_dma_buffer) { | ||
206 | printk(KERN_ERR "xd: Out of memory.\n"); | ||
207 | goto out3; | ||
208 | } | ||
209 | } | ||
210 | |||
205 | err = -ENODEV; | 211 | err = -ENODEV; |
206 | if (!xd_drives) | 212 | if (!xd_drives) |
207 | goto out3; | 213 | goto out3; |
@@ -249,15 +255,17 @@ out4: | |||
249 | for (i = 0; i < xd_drives; i++) | 255 | for (i = 0; i < xd_drives; i++) |
250 | put_disk(xd_gendisk[i]); | 256 | put_disk(xd_gendisk[i]); |
251 | out3: | 257 | out3: |
252 | release_region(xd_iobase,4); | 258 | if (xd_maxsectors) |
259 | release_region(xd_iobase,4); | ||
260 | |||
261 | if (xd_dma_buffer) | ||
262 | xd_dma_mem_free((unsigned long)xd_dma_buffer, | ||
263 | xd_maxsectors * 0x200); | ||
253 | out2: | 264 | out2: |
254 | blk_cleanup_queue(xd_queue); | 265 | blk_cleanup_queue(xd_queue); |
255 | out1a: | 266 | out1a: |
256 | unregister_blkdev(XT_DISK_MAJOR, "xd"); | 267 | unregister_blkdev(XT_DISK_MAJOR, "xd"); |
257 | out1: | 268 | out1: |
258 | if (xd_dma_buffer) | ||
259 | xd_dma_mem_free((unsigned long)xd_dma_buffer, | ||
260 | xd_maxsectors * 0x200); | ||
261 | return err; | 269 | return err; |
262 | Enomem: | 270 | Enomem: |
263 | err = -ENOMEM; | 271 | err = -ENOMEM; |