aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index aaa3d465de4e..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);
@@ -4785,7 +4785,7 @@ static int md_getgeo(struct block_device *bdev, struct hd_geometry *geo)
4785 return 0; 4785 return 0;
4786} 4786}
4787 4787
4788static int md_ioctl(struct inode *inode, struct file *file, 4788static int md_ioctl(struct block_device *bdev, fmode_t mode,
4789 unsigned int cmd, unsigned long arg) 4789 unsigned int cmd, unsigned long arg)
4790{ 4790{
4791 int err = 0; 4791 int err = 0;
@@ -4823,7 +4823,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
4823 * Commands creating/starting a new array: 4823 * Commands creating/starting a new array:
4824 */ 4824 */
4825 4825
4826 mddev = inode->i_bdev->bd_disk->private_data; 4826 mddev = bdev->bd_disk->private_data;
4827 4827
4828 if (!mddev) { 4828 if (!mddev) {
4829 BUG(); 4829 BUG();
@@ -4996,13 +4996,13 @@ abort:
4996 return err; 4996 return err;
4997} 4997}
4998 4998
4999static int md_open(struct inode *inode, struct file *file) 4999static int md_open(struct block_device *bdev, fmode_t mode)
5000{ 5000{
5001 /* 5001 /*
5002 * Succeed if we can lock the mddev, which confirms that 5002 * Succeed if we can lock the mddev, which confirms that
5003 * it isn't being stopped right now. 5003 * it isn't being stopped right now.
5004 */ 5004 */
5005 mddev_t *mddev = inode->i_bdev->bd_disk->private_data; 5005 mddev_t *mddev = bdev->bd_disk->private_data;
5006 int err; 5006 int err;
5007 5007
5008 if ((err = mutex_lock_interruptible_nested(&mddev->reconfig_mutex, 1))) 5008 if ((err = mutex_lock_interruptible_nested(&mddev->reconfig_mutex, 1)))
@@ -5013,14 +5013,14 @@ static int md_open(struct inode *inode, struct file *file)
5013 atomic_inc(&mddev->openers); 5013 atomic_inc(&mddev->openers);
5014 mddev_unlock(mddev); 5014 mddev_unlock(mddev);
5015 5015
5016 check_disk_change(inode->i_bdev); 5016 check_disk_change(bdev);
5017 out: 5017 out:
5018 return err; 5018 return err;
5019} 5019}
5020 5020
5021static int md_release(struct inode *inode, struct file * file) 5021static int md_release(struct gendisk *disk, fmode_t mode)
5022{ 5022{
5023 mddev_t *mddev = inode->i_bdev->bd_disk->private_data; 5023 mddev_t *mddev = disk->private_data;
5024 5024
5025 BUG_ON(!mddev); 5025 BUG_ON(!mddev);
5026 atomic_dec(&mddev->openers); 5026 atomic_dec(&mddev->openers);
@@ -5048,7 +5048,7 @@ static struct block_device_operations md_fops =
5048 .owner = THIS_MODULE, 5048 .owner = THIS_MODULE,
5049 .open = md_open, 5049 .open = md_open,
5050 .release = md_release, 5050 .release = md_release,
5051 .ioctl = md_ioctl, 5051 .locked_ioctl = md_ioctl,
5052 .getgeo = md_getgeo, 5052 .getgeo = md_getgeo,
5053 .media_changed = md_media_changed, 5053 .media_changed = md_media_changed,
5054 .revalidate_disk= md_revalidate, 5054 .revalidate_disk= md_revalidate,