Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38082
b: refs/heads/master
c: 9af4aa3
h: refs/heads/master
v: v3
  • Loading branch information
Milan Broz authored and Linus Torvalds committed Oct 3, 2006
1 parent 3e35be4 commit cbe6f49
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab17ffa440cb54ca64111fa4922ba12496fcc8af
refs/heads/master: 9af4aa30b713a58e5952045f52c41a6e3baa2fdc
30 changes: 29 additions & 1 deletion trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,12 +1266,39 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
return -EINVAL;
}

static int multipath_ioctl(struct dm_target *ti, struct inode *inode,
struct file *filp, unsigned int cmd,
unsigned long arg)
{
struct multipath *m = (struct multipath *) ti->private;
struct block_device *bdev = NULL;
unsigned long flags;
int r = 0;

spin_lock_irqsave(&m->lock, flags);

if (!m->current_pgpath)
__choose_pgpath(m);

if (m->current_pgpath)
bdev = m->current_pgpath->path.dev->bdev;

if (m->queue_io)
r = -EAGAIN;
else if (!bdev)
r = -EIO;

spin_unlock_irqrestore(&m->lock, flags);

return r ? : blkdev_ioctl(bdev->bd_inode, filp, cmd, arg);
}

/*-----------------------------------------------------------------
* Module setup
*---------------------------------------------------------------*/
static struct target_type multipath_target = {
.name = "multipath",
.version = {1, 0, 4},
.version = {1, 0, 5},
.module = THIS_MODULE,
.ctr = multipath_ctr,
.dtr = multipath_dtr,
Expand All @@ -1281,6 +1308,7 @@ static struct target_type multipath_target = {
.resume = multipath_resume,
.status = multipath_status,
.message = multipath_message,
.ioctl = multipath_ioctl,
};

static int __init dm_multipath_init(void)
Expand Down

0 comments on commit cbe6f49

Please sign in to comment.