Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 4364

kernel-2.6.18-194.11.1.el5.src.rpm

From: Tetsu Yamamoto <tyamamot@redhat.com>
Date: Tue, 12 Aug 2008 16:07:07 -0400
Subject: [xen] use unlocked_ioctl in evtchn, gntdev and privcmd
Message-id: 20080812200707.4832.98705.sendpatchset@pq0-1.lab.bos.redhat.com
O-Subject: [RHEL5.3 PATCH 2/7] xen: Use unlocked_ioctl in evtchn, gntdev and privcmd drivers to avoid
Bugzilla: 456171
RH-Acked-by: Chris Lalancette <clalance@redhat.com>
RH-Acked-by: Bill Burns <bburns@redhat.com>

bz456171
# HG changeset patch
# User kfraser@localhost.localdomain
# Date 1188553538 -3600
# Node ID f30b59f550c2ac03734c7a8cb63f658f16ca087a
# Parent  720571c2139e66aecb2552a59be897fda40238fa
xen: Use unlocked_ioctl in evtchn, gntdev and privcmd drivers to avoid
acquiring the BKL sempahore. Performance improvement is particularly
significant for heavy users of evtchn-notify ioctl.
Suggested by Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>

diff --git a/drivers/xen/evtchn/evtchn.c b/drivers/xen/evtchn/evtchn.c
index d9b95c3..1839a44 100644
--- a/drivers/xen/evtchn/evtchn.c
+++ b/drivers/xen/evtchn/evtchn.c
@@ -210,8 +210,8 @@ static void evtchn_bind_to_user(struct per_user_data *u, int port)
 	spin_unlock_irq(&port_user_lock);
 }
 
-static int evtchn_ioctl(struct inode *inode, struct file *file,
-			unsigned int cmd, unsigned long arg)
+static long evtchn_ioctl(struct file *file,
+			 unsigned int cmd, unsigned long arg)
 {
 	int rc;
 	struct per_user_data *u = file->private_data;
@@ -425,7 +425,7 @@ static struct file_operations evtchn_fops = {
 	.owner   = THIS_MODULE,
 	.read    = evtchn_read,
 	.write   = evtchn_write,
-	.ioctl   = evtchn_ioctl,
+	.unlocked_ioctl = evtchn_ioctl,
 	.poll    = evtchn_poll,
 	.fasync  = evtchn_fasync,
 	.open    = evtchn_open,
diff --git a/drivers/xen/privcmd/privcmd.c b/drivers/xen/privcmd/privcmd.c
index 1aacaa2..a45eb95 100644
--- a/drivers/xen/privcmd/privcmd.c
+++ b/drivers/xen/privcmd/privcmd.c
@@ -38,8 +38,8 @@ static struct proc_dir_entry *capabilities_intf;
 static int privcmd_enforce_singleshot_mapping(struct vm_area_struct *vma);
 #endif
 
-static int privcmd_ioctl(struct inode *inode, struct file *file,
-			 unsigned int cmd, unsigned long data)
+static long privcmd_ioctl(struct file *file,
+			  unsigned int cmd, unsigned long data)
 {
 	int ret = -ENOSYS;
 	void __user *udata = (void __user *) data;
@@ -248,8 +248,8 @@ static int privcmd_enforce_singleshot_mapping(struct vm_area_struct *vma)
 #endif
 
 static struct file_operations privcmd_file_ops = {
-	.ioctl = privcmd_ioctl,
-	.mmap  = privcmd_mmap,
+	.unlocked_ioctl = privcmd_ioctl,
+	.mmap = privcmd_mmap,
 };
 
 static int capabilities_read(char *page, char **start, off_t off,