Received: by 10.213.65.68 with SMTP id h4csp470628imn; Wed, 4 Apr 2018 01:33:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+SkFpbSbpfcX23Cz+2AliOTEYU7fx4ViZb+BJ8uNiXrYdyn9hbpkjTxDCw5MBb8X5+Ot38 X-Received: by 10.98.85.197 with SMTP id j188mr13130425pfb.86.1522830786728; Wed, 04 Apr 2018 01:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522830786; cv=none; d=google.com; s=arc-20160816; b=JRfTSt/00K334A0qXUabHMTqWskHtTFhcDz2HfiXve81bWmiKXy/T1HtJrNcBR/h47 rc6eLX69nwd2gDn01F26tgKgg1NsZdO2CifD5tBSXm/v1d+OWKrSOenLPGiiaGlLqlQu dvvHOSStaUZVjUQxZykENfFS0zxZMKJ/UVTPCTrC7sb9UfmmSETHjy6/a2KvMX7fQKi1 o/uCw6i+56P60pvz9rt/SK905XstLCDawur+FGoBTBOofIvHGQpB5OtDkB/rwXO56EQI hfJ7HduP9oIvBVnQYoozSebylMj/9o3KwiyGe129+C2NvkO+zBgwGXKaaoEB4bTMR6R+ +bsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=z/rhb15JLwQIfzpWDk6NKHZSaRkKlsW1GfME0CL6Z0o=; b=m01fSb3J4z/lkOeYIlewAryj4Fo4RJH42XSV1+17hTOg7+X9MhX6Ix2O3RF2M5nIFb Dh/z4J/asrTTWsCPMl+yYRD6ggxYK93hxICKl5yOAHpD/nqXgeX12j2TAjhvh2JkgZ2h DvHvBRc8mxXC04OC7az4N/Ztn94XBIMJ09QCVF3YrPLQTh0PqudMyMEcZ6ecckb1uksX kVS3LOCFhkh/T//j+AjKh1bkzpeKX7AExMneKYi3k3AoHiPQYZy9wvY1SLHn/aYr4Ubx q79XIRKVHNQLZofjNCsT/TVHzBMxL801Z8je2LuvQGBCGDM0N14o5SdpPZ0fYBLfZkCa O7/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3-v6si4742795pll.15.2018.04.04.01.32.52; Wed, 04 Apr 2018 01:33:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751974AbeDDIbG (ORCPT + 99 others); Wed, 4 Apr 2018 04:31:06 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42458 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbeDDIbD (ORCPT ); Wed, 4 Apr 2018 04:31:03 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w348UXns026326 for ; Wed, 4 Apr 2018 04:31:03 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h4tq71e99-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 04 Apr 2018 04:30:55 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Apr 2018 09:28:51 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 4 Apr 2018 09:28:45 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w348Siv051707978; Wed, 4 Apr 2018 08:28:44 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE03611C064; Wed, 4 Apr 2018 09:20:59 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F84B11C052; Wed, 4 Apr 2018 09:20:55 +0100 (BST) Received: from bangoria.in.ibm.com (unknown [9.124.31.24]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 Apr 2018 09:20:55 +0100 (BST) From: Ravi Bangoria To: mhiramat@kernel.org, oleg@redhat.com, peterz@infradead.org, srikar@linux.vnet.ibm.com, rostedt@goodmis.org Cc: acme@kernel.org, ananth@linux.vnet.ibm.com, akpm@linux-foundation.org, alexander.shishkin@linux.intel.com, alexis.berlemont@gmail.com, corbet@lwn.net, dan.j.williams@intel.com, jolsa@redhat.com, kan.liang@intel.com, kjlx@templeofstupid.com, kstewart@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, milian.wolff@kdab.com, mingo@redhat.com, namhyung@kernel.org, naveen.n.rao@linux.vnet.ibm.com, pc@us.ibm.com, tglx@linutronix.de, yao.jin@linux.intel.com, fengguang.wu@intel.com, jglisse@redhat.com, Ravi Bangoria Subject: [PATCH v2 2/9] mm: Prefix vma_ to vaddr_to_offset() and offset_to_vaddr() Date: Wed, 4 Apr 2018 14:01:03 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404083110.18647-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180404083110.18647-1-ravi.bangoria@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18040408-0044-0000-0000-000005434467 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040408-0045-0000-0000-0000288359DE Message-Id: <20180404083110.18647-3-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-04-04_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804040090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make function names more meaningful by adding vma_ prefix to them. Signed-off-by: Ravi Bangoria Reviewed-by: Jérôme Glisse --- include/linux/mm.h | 4 ++-- kernel/events/uprobes.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 95909f2..d7ee526 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2275,13 +2275,13 @@ struct vm_unmapped_area_info { } static inline unsigned long -offset_to_vaddr(struct vm_area_struct *vma, loff_t offset) +vma_offset_to_vaddr(struct vm_area_struct *vma, loff_t offset) { return vma->vm_start + offset - ((loff_t)vma->vm_pgoff << PAGE_SHIFT); } static inline loff_t -vaddr_to_offset(struct vm_area_struct *vma, unsigned long vaddr) +vma_vaddr_to_offset(struct vm_area_struct *vma, unsigned long vaddr) { return ((loff_t)vma->vm_pgoff << PAGE_SHIFT) + (vaddr - vma->vm_start); } diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index bd6f230..535fd39 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -748,7 +748,7 @@ static inline struct map_info *free_map_info(struct map_info *info) curr = info; info->mm = vma->vm_mm; - info->vaddr = offset_to_vaddr(vma, offset); + info->vaddr = vma_offset_to_vaddr(vma, offset); } i_mmap_unlock_read(mapping); @@ -807,7 +807,7 @@ static inline struct map_info *free_map_info(struct map_info *info) goto unlock; if (vma->vm_start > info->vaddr || - vaddr_to_offset(vma, info->vaddr) != uprobe->offset) + vma_vaddr_to_offset(vma, info->vaddr) != uprobe->offset) goto unlock; if (is_register) { @@ -977,7 +977,7 @@ static int unapply_uprobe(struct uprobe *uprobe, struct mm_struct *mm) uprobe->offset >= offset + vma->vm_end - vma->vm_start) continue; - vaddr = offset_to_vaddr(vma, uprobe->offset); + vaddr = vma_offset_to_vaddr(vma, uprobe->offset); err |= remove_breakpoint(uprobe, mm, vaddr); } up_read(&mm->mmap_sem); @@ -1023,7 +1023,7 @@ static void build_probe_list(struct inode *inode, struct uprobe *u; INIT_LIST_HEAD(head); - min = vaddr_to_offset(vma, start); + min = vma_vaddr_to_offset(vma, start); max = min + (end - start) - 1; spin_lock(&uprobes_treelock); @@ -1076,7 +1076,7 @@ int uprobe_mmap(struct vm_area_struct *vma) list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) { if (!fatal_signal_pending(current) && filter_chain(uprobe, UPROBE_FILTER_MMAP, vma->vm_mm)) { - unsigned long vaddr = offset_to_vaddr(vma, uprobe->offset); + unsigned long vaddr = vma_offset_to_vaddr(vma, uprobe->offset); install_breakpoint(uprobe, vma->vm_mm, vma, vaddr); } put_uprobe(uprobe); @@ -1095,7 +1095,7 @@ int uprobe_mmap(struct vm_area_struct *vma) inode = file_inode(vma->vm_file); - min = vaddr_to_offset(vma, start); + min = vma_vaddr_to_offset(vma, start); max = min + (end - start) - 1; spin_lock(&uprobes_treelock); @@ -1730,7 +1730,7 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp) if (vma && vma->vm_start <= bp_vaddr) { if (valid_vma(vma, false)) { struct inode *inode = file_inode(vma->vm_file); - loff_t offset = vaddr_to_offset(vma, bp_vaddr); + loff_t offset = vma_vaddr_to_offset(vma, bp_vaddr); uprobe = find_uprobe(inode, offset); } -- 1.8.3.1