# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1183799942 -3600
# Node ID 3ac668c7e1aec4e5a7a572e689adb2dab5b90f8d
# Parent a2acc03e8a4d776b84405f62568442c1bd764dd3
Revert unnecessary locking changes in privcmd_ioctl().
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
drivers/xen/privcmd/privcmd.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff -r a2acc03e8a4d -r 3ac668c7e1ae drivers/xen/privcmd/privcmd.c
--- a/drivers/xen/privcmd/privcmd.c Fri Jul 06 15:52:42 2007 -0500
+++ b/drivers/xen/privcmd/privcmd.c Sat Jul 07 10:19:02 2007 +0100
@@ -112,7 +112,7 @@ static int privcmd_ioctl(struct inode *i
if (copy_from_user(&msg, p, sizeof(msg)))
return -EFAULT;
- down_write(&mm->mmap_sem);
+ down_read(&mm->mmap_sem);
vma = find_vma(mm, msg.va);
rc = -EINVAL;
@@ -154,7 +154,7 @@ static int privcmd_ioctl(struct inode *i
rc = 0;
mmap_out:
- up_write(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
ret = rc;
}
break;
@@ -177,14 +177,14 @@ static int privcmd_ioctl(struct inode *i
if ((m.num <= 0) || (nr_pages > (LONG_MAX >> PAGE_SHIFT)))
return -EINVAL;
- down_write(&mm->mmap_sem);
+ down_read(&mm->mmap_sem);
vma = find_vma(mm, m.addr);
if (!vma ||
(m.addr != vma->vm_start) ||
((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
!privcmd_enforce_singleshot_mapping(vma)) {
- up_write(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
return -EINVAL;
}
@@ -192,7 +192,7 @@ static int privcmd_ioctl(struct inode *i
addr = m.addr;
for (i = 0; i < nr_pages; i++, addr += PAGE_SIZE, p++) {
if (get_user(mfn, p)) {
- up_write(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
return -EFAULT;
}
@@ -203,7 +203,7 @@ static int privcmd_ioctl(struct inode *i
put_user(0xF0000000 | mfn, p);
}
- up_write(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
ret = 0;
}
break;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|