Skip to content

Commit

Permalink
[PATCH] switch pf
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 21, 2008
1 parent b6a8953 commit 8cfc7ca
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/block/paride/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ module_param_array(drive3, int, NULL, 0);
#define ATAPI_READ_10 0x28
#define ATAPI_WRITE_10 0x2a

static int pf_open(struct inode *inode, struct file *file);
static int pf_open(struct block_device *bdev, fmode_t mode);
static void do_pf_request(struct request_queue * q);
static int pf_ioctl(struct inode *inode, struct file *file,
static int pf_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg);
static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo);

static int pf_release(struct inode *inode, struct file *file);
static int pf_release(struct gendisk *disk, fmode_t mode);

static int pf_detect(void);
static void do_pf_read(void);
Expand Down Expand Up @@ -264,9 +264,9 @@ static char *pf_buf; /* buffer for request in progress */

static struct block_device_operations pf_fops = {
.owner = THIS_MODULE,
.__open = pf_open,
.__release = pf_release,
.__ioctl = pf_ioctl,
.open = pf_open,
.release = pf_release,
.locked_ioctl = pf_ioctl,
.getgeo = pf_getgeo,
.media_changed = pf_check_media,
};
Expand Down Expand Up @@ -296,16 +296,16 @@ static void __init pf_init_units(void)
}
}

static int pf_open(struct inode *inode, struct file *file)
static int pf_open(struct block_device *bdev, fmode_t mode)
{
struct pf_unit *pf = inode->i_bdev->bd_disk->private_data;
struct pf_unit *pf = bdev->bd_disk->private_data;

pf_identify(pf);

if (pf->media_status == PF_NM)
return -ENODEV;

if ((pf->media_status == PF_RO) && (file->f_mode & FMODE_WRITE))
if ((pf->media_status == PF_RO) && (mode & FMODE_WRITE))
return -EROFS;

pf->access++;
Expand Down Expand Up @@ -333,9 +333,9 @@ static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo)
return 0;
}

static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
static int pf_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
{
struct pf_unit *pf = inode->i_bdev->bd_disk->private_data;
struct pf_unit *pf = bdev->bd_disk->private_data;

if (cmd != CDROMEJECT)
return -EINVAL;
Expand All @@ -346,9 +346,9 @@ static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
return 0;
}

static int pf_release(struct inode *inode, struct file *file)
static int pf_release(struct gendisk *disk, fmode_t mode)
{
struct pf_unit *pf = inode->i_bdev->bd_disk->private_data;
struct pf_unit *pf = disk->private_data;

if (pf->access <= 0)
return -EINVAL;
Expand Down

0 comments on commit 8cfc7ca

Please sign in to comment.