aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.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 /fs/block_dev.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 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 451afbd543b5..66411463b734 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1346,13 +1346,12 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1346 return ret; 1346 return ret;
1347 } 1347 }
1348 1348
1349 lock_kernel();
1350 restart: 1349 restart:
1351 1350
1352 ret = -ENXIO; 1351 ret = -ENXIO;
1353 disk = get_gendisk(bdev->bd_dev, &partno); 1352 disk = get_gendisk(bdev->bd_dev, &partno);
1354 if (!disk) 1353 if (!disk)
1355 goto out_unlock_kernel; 1354 goto out;
1356 1355
1357 mutex_lock_nested(&bdev->bd_mutex, for_part); 1356 mutex_lock_nested(&bdev->bd_mutex, for_part);
1358 if (!bdev->bd_openers) { 1357 if (!bdev->bd_openers) {
@@ -1432,7 +1431,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1432 if (for_part) 1431 if (for_part)
1433 bdev->bd_part_count++; 1432 bdev->bd_part_count++;
1434 mutex_unlock(&bdev->bd_mutex); 1433 mutex_unlock(&bdev->bd_mutex);
1435 unlock_kernel();
1436 return 0; 1434 return 0;
1437 1435
1438 out_clear: 1436 out_clear:
@@ -1445,9 +1443,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1445 bdev->bd_contains = NULL; 1443 bdev->bd_contains = NULL;
1446 out_unlock_bdev: 1444 out_unlock_bdev:
1447 mutex_unlock(&bdev->bd_mutex); 1445 mutex_unlock(&bdev->bd_mutex);
1448 out_unlock_kernel: 1446 out:
1449 unlock_kernel();
1450
1451 if (disk) 1447 if (disk)
1452 module_put(disk->fops->owner); 1448 module_put(disk->fops->owner);
1453 put_disk(disk); 1449 put_disk(disk);
@@ -1516,7 +1512,6 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1516 struct block_device *victim = NULL; 1512 struct block_device *victim = NULL;
1517 1513
1518 mutex_lock_nested(&bdev->bd_mutex, for_part); 1514 mutex_lock_nested(&bdev->bd_mutex, for_part);
1519 lock_kernel();
1520 if (for_part) 1515 if (for_part)
1521 bdev->bd_part_count--; 1516 bdev->bd_part_count--;
1522 1517
@@ -1541,7 +1536,6 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1541 victim = bdev->bd_contains; 1536 victim = bdev->bd_contains;
1542 bdev->bd_contains = NULL; 1537 bdev->bd_contains = NULL;
1543 } 1538 }
1544 unlock_kernel();
1545 mutex_unlock(&bdev->bd_mutex); 1539 mutex_unlock(&bdev->bd_mutex);
1546 bdput(bdev); 1540 bdput(bdev);
1547 if (victim) 1541 if (victim)