diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 29c80f6d8b27..cb10a06775e4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -657,7 +657,7 @@ static struct block_device *ext4_blkdev_get(dev_t dev, struct super_block *sb) | |||
657 | struct block_device *bdev; | 657 | struct block_device *bdev; |
658 | char b[BDEVNAME_SIZE]; | 658 | char b[BDEVNAME_SIZE]; |
659 | 659 | ||
660 | bdev = open_by_devnum(dev, FMODE_READ|FMODE_WRITE); | 660 | bdev = blkdev_get_by_dev(dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL, sb); |
661 | if (IS_ERR(bdev)) | 661 | if (IS_ERR(bdev)) |
662 | goto fail; | 662 | goto fail; |
663 | return bdev; | 663 | return bdev; |
@@ -673,8 +673,7 @@ fail: | |||
673 | */ | 673 | */ |
674 | static int ext4_blkdev_put(struct block_device *bdev) | 674 | static int ext4_blkdev_put(struct block_device *bdev) |
675 | { | 675 | { |
676 | bd_release(bdev); | 676 | return blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); |
677 | return blkdev_put(bdev, FMODE_READ|FMODE_WRITE); | ||
678 | } | 677 | } |
679 | 678 | ||
680 | static int ext4_blkdev_remove(struct ext4_sb_info *sbi) | 679 | static int ext4_blkdev_remove(struct ext4_sb_info *sbi) |
@@ -3778,13 +3777,6 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb, | |||
3778 | if (bdev == NULL) | 3777 | if (bdev == NULL) |
3779 | return NULL; | 3778 | return NULL; |
3780 | 3779 | ||
3781 | if (bd_claim(bdev, sb)) { | ||
3782 | ext4_msg(sb, KERN_ERR, | ||
3783 | "failed to claim external journal device"); | ||
3784 | blkdev_put(bdev, FMODE_READ|FMODE_WRITE); | ||
3785 | return NULL; | ||
3786 | } | ||
3787 | |||
3788 | blocksize = sb->s_blocksize; | 3780 | blocksize = sb->s_blocksize; |
3789 | hblock = bdev_logical_block_size(bdev); | 3781 | hblock = bdev_logical_block_size(bdev); |
3790 | if (blocksize < hblock) { | 3782 | if (blocksize < hblock) { |