Skip to content

Commit

Permalink
[PATCH] switch ubd
Browse files Browse the repository at this point in the history
ubd_ioctl() doesn't need BKL, so unlocked_ioctl() it becomes...

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Oct 21, 2008
1 parent d4430d6 commit a625c99
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)

static DEFINE_MUTEX(ubd_lock);

static int ubd_open(struct inode * inode, struct file * filp);
static int ubd_release(struct inode * inode, struct file * file);
static int ubd_ioctl(struct inode * inode, struct file * file,
static int ubd_open(struct block_device *bdev, fmode_t mode);
static int ubd_release(struct gendisk *disk, fmode_t mode);
static int ubd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg);
static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);

#define MAX_DEV (16)

static struct block_device_operations ubd_blops = {
.owner = THIS_MODULE,
.__open = ubd_open,
.__release = ubd_release,
.__ioctl = ubd_ioctl,
.open = ubd_open,
.release = ubd_release,
.ioctl = ubd_ioctl,
.getgeo = ubd_getgeo,
};

Expand Down Expand Up @@ -1112,9 +1112,9 @@ static int __init ubd_driver_init(void){

device_initcall(ubd_driver_init);

static int ubd_open(struct inode *inode, struct file *filp)
static int ubd_open(struct block_device *bdev, fmode_t mode)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
struct gendisk *disk = bdev->bd_disk;
struct ubd *ubd_dev = disk->private_data;
int err = 0;

Expand All @@ -1131,17 +1131,16 @@ static int ubd_open(struct inode *inode, struct file *filp)

/* This should no more be needed. And it didn't work anyway to exclude
* read-write remounting of filesystems.*/
/*if((filp->f_mode & FMODE_WRITE) && !ubd_dev->openflags.w){
/*if((mode & FMODE_WRITE) && !ubd_dev->openflags.w){
if(--ubd_dev->count == 0) ubd_close_dev(ubd_dev);
err = -EROFS;
}*/
out:
return err;
}

static int ubd_release(struct inode * inode, struct file * file)
static int ubd_release(struct gendisk *disk, fmode_t mode)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
struct ubd *ubd_dev = disk->private_data;

if(--ubd_dev->count == 0)
Expand Down Expand Up @@ -1306,10 +1305,10 @@ static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
return 0;
}

static int ubd_ioctl(struct inode * inode, struct file * file,
static int ubd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
struct ubd *ubd_dev = inode->i_bdev->bd_disk->private_data;
struct ubd *ubd_dev = bdev->bd_disk->private_data;
struct hd_driveid ubd_id = {
.cyls = 0,
.heads = 128,
Expand Down

0 comments on commit a625c99

Please sign in to comment.