Commit efb00232 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (6/15) big struct block_device * push (first series)

 - switch loop_set_fd() to struct block_device
parent 3b57ec8d
...@@ -585,11 +585,12 @@ static int loop_thread(void *data) ...@@ -585,11 +585,12 @@ static int loop_thread(void *data)
return 0; return 0;
} }
static int loop_set_fd(struct loop_device *lo, struct file *lo_file, kdev_t dev, static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
unsigned int arg) struct block_device *bdev, unsigned int arg)
{ {
struct file *file; struct file *file;
struct inode *inode; struct inode *inode;
kdev_t dev = to_kdev_t(bdev->bd_dev);
kdev_t lo_device; kdev_t lo_device;
int lo_flags = 0; int lo_flags = 0;
int error; int error;
...@@ -613,7 +614,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, kdev_t dev, ...@@ -613,7 +614,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, kdev_t dev,
if (S_ISBLK(inode->i_mode)) { if (S_ISBLK(inode->i_mode)) {
lo_device = inode->i_rdev; lo_device = inode->i_rdev;
if (kdev_same(lo_device, dev)) { if (inode->i_bdev == bdev) {
error = -EBUSY; error = -EBUSY;
goto out; goto out;
} }
...@@ -828,7 +829,7 @@ static int lo_ioctl(struct inode * inode, struct file * file, ...@@ -828,7 +829,7 @@ static int lo_ioctl(struct inode * inode, struct file * file,
down(&lo->lo_ctl_mutex); down(&lo->lo_ctl_mutex);
switch (cmd) { switch (cmd) {
case LOOP_SET_FD: case LOOP_SET_FD:
err = loop_set_fd(lo, file, inode->i_rdev, arg); err = loop_set_fd(lo, file, inode->i_bdev, arg);
break; break;
case LOOP_CLR_FD: case LOOP_CLR_FD:
err = loop_clr_fd(lo, inode->i_bdev); err = loop_clr_fd(lo, inode->i_bdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment