lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1274269126-3274-2-git-send-regression-fweisbec@gmail.com>
Date:	Wed, 19 May 2010 13:38:43 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Hans Verkuil <hverkuil@...all.nl>,
	Arnd Bergmann <arnd@...db.de>, John Kacur <jkacur@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jan Blunck <jblunck@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: [PATCH 1/4] v4l: Introduce video_ioctl2_bkl

video_ioctl2 is a generic ioctl helper used by a lot of drivers.
Most of them put it as their bkl'ed .ioctl callback, then provide
a bkl'ed version of this helper so that drivers can use it as an
unlocked_ioctl callback, making it easy to remove the .ioctl
field from the v4l fops.

Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Acked-by: Hans Verkuil <hverkuil@...all.nl>
---
 drivers/media/video/v4l2-ioctl.c |   14 ++++++++++++++
 include/media/v4l2-ioctl.h       |    3 +++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 0eeceae..154258e 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -16,6 +16,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/smp_lock.h>
 
 #define __OLD_VIDIOC_ /* To allow fixing old calls */
 #include <linux/videodev.h>
@@ -2156,3 +2157,16 @@ out:
 	return err;
 }
 EXPORT_SYMBOL(video_ioctl2);
+
+
+long video_ioctl2_bkl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+	long ret;
+
+	lock_kernel();
+	ret = video_ioctl2(file, cmd, arg);
+	unlock_kernel();
+
+	return ret;
+}
+EXPORT_SYMBOL(video_ioctl2_bkl);
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 06daa6e..a128ed4 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -324,4 +324,7 @@ extern long video_usercopy(struct file *file, unsigned int cmd,
 extern long video_ioctl2(struct file *file,
 			unsigned int cmd, unsigned long arg);
 
+extern long video_ioctl2_bkl(struct file *file,
+			     unsigned int cmd, unsigned long arg);
+
 #endif /* _V4L2_IOCTL_H */
-- 
1.6.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ