summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2012-06-01 14:49:50 +0530
committerAnton Arapov <anton@redhat.com>2012-10-29 11:42:32 +0100
commit8d2285b75ed9bea84f9eae2cffa612b3a96f366a (patch)
tree09a2a38effac795db3a6c3ba8894add1c0bf7217
parent7f6dc119ae2a77a23a3c07ebefba6fd7df65a74c (diff)
downloadkernel-uprobes-8d2285b75ed9bea84f9eae2cffa612b3a96f366a.zip
kernel-uprobes-8d2285b75ed9bea84f9eae2cffa612b3a96f366a.tar.gz
kernel-uprobes-8d2285b75ed9bea84f9eae2cffa612b3a96f366a.tar.xz
uprobes: Remove redundant lock_page/unlock_page
Since read_opcode() reads from the referenced page and doesnt modify the page contents nor the page attributes, there is no need to lock the page. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
-rw-r--r--kernel/events/uprobes.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index c08a22d..7cff24c 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -280,12 +280,10 @@ static int read_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_
if (ret <= 0)
return ret;
- lock_page(page);
vaddr_new = kmap_atomic(page);
vaddr &= ~PAGE_MASK;
memcpy(opcode, vaddr_new + vaddr, UPROBE_SWBP_INSN_SIZE);
kunmap_atomic(vaddr_new);
- unlock_page(page);
put_page(page);