aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index e48a630ae266..67fe72ce6ac7 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -534,7 +534,6 @@ void __init bdev_cache_init(void)
534 if (err) 534 if (err)
535 panic("Cannot register bdev pseudo-fs"); 535 panic("Cannot register bdev pseudo-fs");
536 bd_mnt = kern_mount(&bd_type); 536 bd_mnt = kern_mount(&bd_type);
537 err = PTR_ERR(bd_mnt);
538 if (IS_ERR(bd_mnt)) 537 if (IS_ERR(bd_mnt))
539 panic("Cannot create bdev pseudo-fs"); 538 panic("Cannot create bdev pseudo-fs");
540 blockdev_superblock = bd_mnt->mnt_sb; /* For writeback */ 539 blockdev_superblock = bd_mnt->mnt_sb; /* For writeback */
@@ -1398,19 +1397,19 @@ struct block_device *lookup_bdev(const char *path)
1398 if (error) 1397 if (error)
1399 return ERR_PTR(error); 1398 return ERR_PTR(error);
1400 1399
1401 inode = nd.dentry->d_inode; 1400 inode = nd.path.dentry->d_inode;
1402 error = -ENOTBLK; 1401 error = -ENOTBLK;
1403 if (!S_ISBLK(inode->i_mode)) 1402 if (!S_ISBLK(inode->i_mode))
1404 goto fail; 1403 goto fail;
1405 error = -EACCES; 1404 error = -EACCES;
1406 if (nd.mnt->mnt_flags & MNT_NODEV) 1405 if (nd.path.mnt->mnt_flags & MNT_NODEV)
1407 goto fail; 1406 goto fail;
1408 error = -ENOMEM; 1407 error = -ENOMEM;
1409 bdev = bd_acquire(inode); 1408 bdev = bd_acquire(inode);
1410 if (!bdev) 1409 if (!bdev)
1411 goto fail; 1410 goto fail;
1412out: 1411out:
1413 path_release(&nd); 1412 path_put(&nd.path);
1414 return bdev; 1413 return bdev;
1415fail: 1414fail:
1416 bdev = ERR_PTR(error); 1415 bdev = ERR_PTR(error);