aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/pktcdvd.c8
-rw-r--r--drivers/char/raw.c4
-rw-r--r--drivers/md/dm-table.c4
-rw-r--r--drivers/md/md.c4
-rw-r--r--drivers/s390/block/dasd_genhd.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 90548da9c1cb..ce8c71901923 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2381,7 +2381,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write)
2381out_unclaim: 2381out_unclaim:
2382 bd_release(pd->bdev); 2382 bd_release(pd->bdev);
2383out_putdev: 2383out_putdev:
2384 blkdev_put(pd->bdev); 2384 blkdev_put(pd->bdev, FMODE_READ);
2385out: 2385out:
2386 return ret; 2386 return ret;
2387} 2387}
@@ -2399,7 +2399,7 @@ static void pkt_release_dev(struct pktcdvd_device *pd, int flush)
2399 2399
2400 pkt_set_speed(pd, MAX_SPEED, MAX_SPEED); 2400 pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);
2401 bd_release(pd->bdev); 2401 bd_release(pd->bdev);
2402 blkdev_put(pd->bdev); 2402 blkdev_put(pd->bdev, FMODE_READ);
2403 2403
2404 pkt_shrink_pktlist(pd); 2404 pkt_shrink_pktlist(pd);
2405} 2405}
@@ -2790,7 +2790,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
2790 return 0; 2790 return 0;
2791 2791
2792out_mem: 2792out_mem:
2793 blkdev_put(bdev); 2793 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
2794 /* This is safe: open() is still holding a reference. */ 2794 /* This is safe: open() is still holding a reference. */
2795 module_put(THIS_MODULE); 2795 module_put(THIS_MODULE);
2796 return ret; 2796 return ret;
@@ -2975,7 +2975,7 @@ static int pkt_remove_dev(dev_t pkt_dev)
2975 pkt_debugfs_dev_remove(pd); 2975 pkt_debugfs_dev_remove(pd);
2976 pkt_sysfs_dev_remove(pd); 2976 pkt_sysfs_dev_remove(pd);
2977 2977
2978 blkdev_put(pd->bdev); 2978 blkdev_put(pd->bdev, FMODE_READ|FMODE_WRITE);
2979 2979
2980 remove_proc_entry(pd->name, pkt_proc); 2980 remove_proc_entry(pd->name, pkt_proc);
2981 DPRINTK(DRIVER_NAME": writer %s unmapped\n", pd->name); 2981 DPRINTK(DRIVER_NAME": writer %s unmapped\n", pd->name);
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index e139372d0e69..bfd59e6bf54f 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -87,7 +87,7 @@ static int raw_open(struct inode *inode, struct file *filp)
87out2: 87out2:
88 bd_release(bdev); 88 bd_release(bdev);
89out1: 89out1:
90 blkdev_put(bdev); 90 blkdev_put(bdev, filp->f_mode);
91out: 91out:
92 mutex_unlock(&raw_mutex); 92 mutex_unlock(&raw_mutex);
93 return err; 93 return err;
@@ -112,7 +112,7 @@ static int raw_release(struct inode *inode, struct file *filp)
112 mutex_unlock(&raw_mutex); 112 mutex_unlock(&raw_mutex);
113 113
114 bd_release(bdev); 114 bd_release(bdev);
115 blkdev_put(bdev); 115 blkdev_put(bdev, filp->f_mode);
116 return 0; 116 return 0;
117} 117}
118 118
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 7c8671b06fe3..dd8bd2e867cd 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -357,7 +357,7 @@ static int open_dev(struct dm_dev_internal *d, dev_t dev,
357 return PTR_ERR(bdev); 357 return PTR_ERR(bdev);
358 r = bd_claim_by_disk(bdev, _claim_ptr, dm_disk(md)); 358 r = bd_claim_by_disk(bdev, _claim_ptr, dm_disk(md));
359 if (r) 359 if (r)
360 blkdev_put(bdev); 360 blkdev_put(bdev, d->dm_dev.mode);
361 else 361 else
362 d->dm_dev.bdev = bdev; 362 d->dm_dev.bdev = bdev;
363 return r; 363 return r;
@@ -372,7 +372,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
372 return; 372 return;
373 373
374 bd_release_from_disk(d->dm_dev.bdev, dm_disk(md)); 374 bd_release_from_disk(d->dm_dev.bdev, dm_disk(md));
375 blkdev_put(d->dm_dev.bdev); 375 blkdev_put(d->dm_dev.bdev, d->dm_dev.mode);
376 d->dm_dev.bdev = NULL; 376 d->dm_dev.bdev = NULL;
377} 377}
378 378
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 06ea991c7a40..c1a837ca193c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1520,7 +1520,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared)
1520 if (err) { 1520 if (err) {
1521 printk(KERN_ERR "md: could not bd_claim %s.\n", 1521 printk(KERN_ERR "md: could not bd_claim %s.\n",
1522 bdevname(bdev, b)); 1522 bdevname(bdev, b));
1523 blkdev_put(bdev); 1523 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
1524 return err; 1524 return err;
1525 } 1525 }
1526 if (!shared) 1526 if (!shared)
@@ -1536,7 +1536,7 @@ static void unlock_rdev(mdk_rdev_t *rdev)
1536 if (!bdev) 1536 if (!bdev)
1537 MD_BUG(); 1537 MD_BUG();
1538 bd_release(bdev); 1538 bd_release(bdev);
1539 blkdev_put(bdev); 1539 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
1540} 1540}
1541 1541
1542void md_autodetect_dev(dev_t dev); 1542void md_autodetect_dev(dev_t dev);
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index aee6565aaf98..3c1b6915c9ad 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -152,7 +152,7 @@ void dasd_destroy_partitions(struct dasd_block *block)
152 152
153 invalidate_partition(block->gdp, 0); 153 invalidate_partition(block->gdp, 0);
154 /* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */ 154 /* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */
155 blkdev_put(bdev); 155 blkdev_put(bdev, FMODE_READ);
156 set_capacity(block->gdp, 0); 156 set_capacity(block->gdp, 0);
157} 157}
158 158