aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-gd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:22:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:22:42 -0400
commit2f9e825d3e0e2b407ae8f082de5c00afcf7378fb (patch)
treef8b3ee40674ce4acd5508a0a0bf52a30904caf6c /drivers/ide/ide-gd.c
parent7ae0dea900b027cd90e8a3e14deca9a19e17638b (diff)
parentde75d60d5ea235e6e09f4962ab22541ce0fe176a (diff)
Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits) block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n xen-blkfront: fix missing out label blkdev: fix blkdev_issue_zeroout return value block: update request stacking methods to support discards block: fix missing export of blk_types.h writeback: fix bad _bh spinlock nesting drbd: revert "delay probes", feature is being re-implemented differently drbd: Initialize all members of sync_conf to their defaults [Bugz 315] drbd: Disable delay probes for the upcomming release writeback: cleanup bdi_register writeback: add new tracepoints writeback: remove unnecessary init_timer call writeback: optimize periodic bdi thread wakeups writeback: prevent unnecessary bdi threads wakeups writeback: move bdi threads exiting logic to the forker thread writeback: restructure bdi forker loop a little writeback: move last_active to bdi writeback: do not remove bdi from bdi_list writeback: simplify bdi code a little writeback: do not lose wake-ups in bdi threads ... Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and drivers/scsi/scsi_error.c as per Jens.
Diffstat (limited to 'drivers/ide/ide-gd.c')
-rw-r--r--drivers/ide/ide-gd.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 79399534782c..70aeeb18833e 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -1,3 +1,4 @@
1#include <linux/smp_lock.h>
1#include <linux/module.h> 2#include <linux/module.h>
2#include <linux/types.h> 3#include <linux/types.h>
3#include <linux/string.h> 4#include <linux/string.h>
@@ -237,6 +238,18 @@ out_put_idkp:
237 return ret; 238 return ret;
238} 239}
239 240
241static int ide_gd_unlocked_open(struct block_device *bdev, fmode_t mode)
242{
243 int ret;
244
245 lock_kernel();
246 ret = ide_gd_open(bdev, mode);
247 unlock_kernel();
248
249 return ret;
250}
251
252
240static int ide_gd_release(struct gendisk *disk, fmode_t mode) 253static int ide_gd_release(struct gendisk *disk, fmode_t mode)
241{ 254{
242 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); 255 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
@@ -244,6 +257,7 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode)
244 257
245 ide_debug_log(IDE_DBG_FUNC, "enter"); 258 ide_debug_log(IDE_DBG_FUNC, "enter");
246 259
260 lock_kernel();
247 if (idkp->openers == 1) 261 if (idkp->openers == 1)
248 drive->disk_ops->flush(drive); 262 drive->disk_ops->flush(drive);
249 263
@@ -255,6 +269,7 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode)
255 idkp->openers--; 269 idkp->openers--;
256 270
257 ide_disk_put(idkp); 271 ide_disk_put(idkp);
272 unlock_kernel();
258 273
259 return 0; 274 return 0;
260} 275}
@@ -321,9 +336,9 @@ static int ide_gd_ioctl(struct block_device *bdev, fmode_t mode,
321 336
322static const struct block_device_operations ide_gd_ops = { 337static const struct block_device_operations ide_gd_ops = {
323 .owner = THIS_MODULE, 338 .owner = THIS_MODULE,
324 .open = ide_gd_open, 339 .open = ide_gd_unlocked_open,
325 .release = ide_gd_release, 340 .release = ide_gd_release,
326 .locked_ioctl = ide_gd_ioctl, 341 .ioctl = ide_gd_ioctl,
327 .getgeo = ide_gd_getgeo, 342 .getgeo = ide_gd_getgeo,
328 .media_changed = ide_gd_media_changed, 343 .media_changed = ide_gd_media_changed,
329 .unlock_native_capacity = ide_gd_unlock_native_capacity, 344 .unlock_native_capacity = ide_gd_unlock_native_capacity,