]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/block/pktcdvd.c
block: unify flags for struct bio and struct request
[net-next-2.6.git] / drivers / block / pktcdvd.c
index ddf19425245dd4004832cd6c7c4343f8ba8764ec..9f3e4454274b62748ecaf4663c79ac7608edac15 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/compat.h>
 #include <linux/kthread.h>
 #include <linux/errno.h>
 #include <linux/spinlock.h>
@@ -1220,7 +1221,7 @@ static int pkt_start_recovery(struct packet_data *pkt)
        pkt->bio->bi_flags = 1 << BIO_UPTODATE;
        pkt->bio->bi_idx = 0;
 
-       BUG_ON(pkt->bio->bi_rw != (1 << BIO_RW));
+       BUG_ON(pkt->bio->bi_rw != REQ_WRITE);
        BUG_ON(pkt->bio->bi_vcnt != pkt->frames);
        BUG_ON(pkt->bio->bi_size != pkt->frames * CD_FRAMESIZE);
        BUG_ON(pkt->bio->bi_end_io != pkt_end_io_packet_write);
@@ -2984,7 +2985,7 @@ static void pkt_get_status(struct pkt_ctrl_command *ctrl_cmd)
        mutex_unlock(&ctl_mutex);
 }
 
-static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long pkt_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        struct pkt_ctrl_command ctrl_cmd;
@@ -3021,10 +3022,20 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm
        return ret;
 }
 
+#ifdef CONFIG_COMPAT
+static long pkt_ctl_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       return pkt_ctl_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
+}
+#endif
 
 static const struct file_operations pkt_ctl_fops = {
-       .ioctl   = pkt_ctl_ioctl,
-       .owner   = THIS_MODULE,
+       .open           = nonseekable_open,
+       .unlocked_ioctl = pkt_ctl_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = pkt_ctl_compat_ioctl,
+#endif
+       .owner          = THIS_MODULE,
 };
 
 static struct miscdevice pkt_misc = {