The patch number 9331 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Mauro Carvalho Chehab  <[EMAIL PROTECTED]>
Remove unused inode parameter from video_ioctl2


inode is never used on video_ioctl2. Remove it and rename the function to
__video_ioctl2. This allows its usage directly as a callback at
fops.unlocked_ioctl.

Since we still need a callback with inode to be used with fops.ioctl,
this patch adds video_ioctl2() that is just a call to __video_ioctl2().

Also, this patch adds some comments about video_ioctl2 and __video_ioctl2
usage at v4l2-ioctl.h.

Priority: normal

Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/ivtv/ivtv-ioctl.c |    2 +-
 linux/drivers/media/video/v4l2-ioctl.c      |   20 ++++++++------------
 linux/include/media/v4l2-ioctl.h            |   20 +++++++++++++++-----
 3 files changed, 24 insertions(+), 18 deletions(-)

diff -r 33731b680f25 -r e83513e77f0d linux/drivers/media/video/ivtv/ivtv-ioctl.c
--- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c       Tue Oct 21 12:27:20 
2008 -0200
+++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c       Tue Oct 21 12:58:39 
2008 -0200
@@ -1830,7 +1830,7 @@ static long ivtv_serialized_ioctl(struct
 
        if (ivtv_debug & IVTV_DBGFLG_IOCTL)
                vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
-       ret = video_ioctl2_unlocked(filp, cmd, arg);
+       ret = __video_ioctl2(filp, cmd, arg);
        vfd->debug = 0;
        return ret;
 }
diff -r 33731b680f25 -r e83513e77f0d linux/drivers/media/video/v4l2-ioctl.c
--- a/linux/drivers/media/video/v4l2-ioctl.c    Tue Oct 21 12:27:20 2008 -0200
+++ b/linux/drivers/media/video/v4l2-ioctl.c    Tue Oct 21 12:58:39 2008 -0200
@@ -1769,7 +1769,7 @@ static int __video_do_ioctl(struct file 
        return ret;
 }
 
-int video_ioctl2(struct inode *inode, struct file *file,
+int __video_ioctl2(struct file *file,
               unsigned int cmd, unsigned long arg)
 {
        char    sbuf[128];
@@ -1861,15 +1861,11 @@ out:
        kfree(mbuf);
        return err;
 }
+EXPORT_SYMBOL(__video_ioctl2);
+
+int video_ioctl2(struct inode *inode, struct file *file,
+              unsigned int cmd, unsigned long arg)
+{
+       return __video_ioctl2(file, cmd, arg);
+}
 EXPORT_SYMBOL(video_ioctl2);
-
-long video_ioctl2_unlocked(struct file *file,
-                unsigned int cmd, unsigned long arg)
-{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
-       return video_ioctl2(file->f_dentry->d_inode, file, cmd, arg);
-#else
-       return video_ioctl2(file->f_path.dentry->d_inode, file, cmd, arg);
-#endif
-}
-EXPORT_SYMBOL(video_ioctl2_unlocked);
diff -r 33731b680f25 -r e83513e77f0d linux/include/media/v4l2-ioctl.h
--- a/linux/include/media/v4l2-ioctl.h  Tue Oct 21 12:27:20 2008 -0200
+++ b/linux/include/media/v4l2-ioctl.h  Tue Oct 21 12:58:39 2008 -0200
@@ -284,15 +284,25 @@ extern long v4l_compat_ioctl32(struct fi
 extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
                                unsigned long arg);
 
-extern int video_ioctl2(struct inode *inode, struct file *file,
-                       unsigned int cmd, unsigned long arg);
-extern long video_ioctl2_unlocked(struct file *file,
-                       unsigned int cmd, unsigned long arg);
-
 /* Include support for obsoleted stuff */
 extern int video_usercopy(struct inode *inode, struct file *file,
                          unsigned int cmd, unsigned long arg,
                          int (*func)(struct inode *inode, struct file *file,
                                      unsigned int cmd, void *arg));
 
+/* Standard handlers for V4L ioctl's */
+
+/* This prototype is used on fops.unlocked_ioctl */
+extern int __video_ioctl2(struct file *file,
+                       unsigned int cmd, unsigned long arg);
+
+/* This prototype is used on fops.ioctl
+ * Since fops.ioctl enables Kernel Big Lock, it is preferred
+ * to use __video_ioctl2 instead.
+ * It should be noticed that there's no lock code inside
+ * video_ioctl2().
+ */
+extern int video_ioctl2(struct inode *inode, struct file *file,
+                       unsigned int cmd, unsigned long arg);
+
 #endif /* _V4L2_IOCTL_H */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/e83513e77f0dc2f6f03b8c1a72abe5e7fbd7695f

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to