Received: by 10.192.165.156 with SMTP id m28csp1411137imm; Mon, 16 Apr 2018 21:35:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx49e4yshvFHcspr9HbBwSEIl1dGiVE/s+uoE3EKqrC9RuvVl3Xw2CStT2oaXxtZ5iCPFq4T4 X-Received: by 10.99.102.195 with SMTP id a186mr520767pgc.207.1523939718981; Mon, 16 Apr 2018 21:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523939718; cv=none; d=google.com; s=arc-20160816; b=rcmyafTw7N30OsKkccqJBdGR6ap/dJTCw5lDHy4VVP2Fr+4xJg5UDr6XKqtF2CvjsE 8CFWKO92dTNMqoXwJ0HXO1FE2+NuHNM/FktuiWUZZUG8SicEr3kla5h5ZP5T0QkCL+ci SBkL88aUVDXNNjLXlvm7/Q1RyuFEaiTYoqJJKaz4eyXI2Kcp4/CSz/LBQsMCnSWY2dPL Map1AM+Hcs52WLdYe8qw5dfRrHW1Hpm/Bwj2tPZDOI5vXDeJr9BOR8En6AjuuBSCVygf 0TS+6PsCDeyXYiEAQCm2aw6ORAQSPjS2e8xU3aVorPkuiDKRQ9d9Q/9oST71kw1kwic4 onjg== 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=8bpqIiOXNH+e7qKcYbbWbPupnSXXU9FD/LbyJEgeI90=; b=k09nw0letwvr5B6YbVW6Htwzq9ipYTipvOZrvt0iw4P50sqeecmd/nYRFUVw+mC359 PLGmklxEsXriJKScEy6Fu6qkaz+IM8Zf0QJ+iRTirJhNxV99658D3OlYtlrEolP6afu+ XasYut8fErQ6tQy5I9Rn5+XLB8NmGQGE6ZbTsB4ZzVQmei+72U9bWvDArJJeikOPGBn4 0HsKu8dPwEgLPPjm9LKyIr4vHj7EvLySnUyfGdxyZZ9Fp2UjSZ8ljvHoOlSGEo/dvbLc +4gosNlaSzk/zDxpthRrVweY0IcbI8noW2nImzPNLQdhk500f04R+vzoNTM4nYyRlBRs 2IqQ== 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 l7si11081988pgs.615.2018.04.16.21.35.05; Mon, 16 Apr 2018 21:35:18 -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 S1752359AbeDQEdu (ORCPT + 99 others); Tue, 17 Apr 2018 00:33:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55522 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250AbeDQEdq (ORCPT ); Tue, 17 Apr 2018 00:33:46 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3H4SvZW121661 for ; Tue, 17 Apr 2018 00:33:45 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hd491mehk-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 17 Apr 2018 00:33:45 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Apr 2018 05:33:43 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Apr 2018 05:33:36 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3H4XZ8P56885414; Tue, 17 Apr 2018 04:33:35 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30CCEAE04D; Tue, 17 Apr 2018 05:23:26 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BF6BAE045; Tue, 17 Apr 2018 05:23:21 +0100 (BST) Received: from bangoria.in.ibm.com (unknown [9.124.31.151]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 17 Apr 2018 05:23:21 +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 v3 4/9] Uprobe: Rename map_info to uprobe_map_info Date: Tue, 17 Apr 2018 10:02:39 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180417043244.7501-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180417043244.7501-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: 18041704-0020-0000-0000-00000412B1D5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041704-0021-0000-0000-000042A6EF4B Message-Id: <20180417043244.7501-5-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-17_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-1804170041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ravi Bangoria map_info is very generic name, rename it to uprobe_map_info. Renaming will help to export this structure outside of the file. Also rename free_map_info() to uprobe_free_map_info() and build_map_info() to uprobe_build_map_info(). Signed-off-by: Ravi Bangoria Reviewed-by: Jérôme Glisse --- kernel/events/uprobes.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 1d439c7..477dc42 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -695,28 +695,30 @@ static void delete_uprobe(struct uprobe *uprobe) put_uprobe(uprobe); } -struct map_info { - struct map_info *next; +struct uprobe_map_info { + struct uprobe_map_info *next; struct mm_struct *mm; unsigned long vaddr; }; -static inline struct map_info *free_map_info(struct map_info *info) +static inline struct uprobe_map_info * +uprobe_free_map_info(struct uprobe_map_info *info) { - struct map_info *next = info->next; + struct uprobe_map_info *next = info->next; mmput(info->mm); kfree(info); return next; } -static struct map_info * -build_map_info(struct address_space *mapping, loff_t offset, bool is_register) +static struct uprobe_map_info * +uprobe_build_map_info(struct address_space *mapping, loff_t offset, + bool is_register) { unsigned long pgoff = offset >> PAGE_SHIFT; struct vm_area_struct *vma; - struct map_info *curr = NULL; - struct map_info *prev = NULL; - struct map_info *info; + struct uprobe_map_info *curr = NULL; + struct uprobe_map_info *prev = NULL; + struct uprobe_map_info *info; int more = 0; again: @@ -730,7 +732,7 @@ static inline struct map_info *free_map_info(struct map_info *info) * Needs GFP_NOWAIT to avoid i_mmap_rwsem recursion through * reclaim. This is optimistic, no harm done if it fails. */ - prev = kmalloc(sizeof(struct map_info), + prev = kmalloc(sizeof(struct uprobe_map_info), GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN); if (prev) prev->next = NULL; @@ -763,7 +765,7 @@ static inline struct map_info *free_map_info(struct map_info *info) } do { - info = kmalloc(sizeof(struct map_info), GFP_KERNEL); + info = kmalloc(sizeof(struct uprobe_map_info), GFP_KERNEL); if (!info) { curr = ERR_PTR(-ENOMEM); goto out; @@ -786,11 +788,11 @@ static inline struct map_info *free_map_info(struct map_info *info) register_for_each_vma(struct uprobe *uprobe, struct uprobe_consumer *new) { bool is_register = !!new; - struct map_info *info; + struct uprobe_map_info *info; int err = 0; percpu_down_write(&dup_mmap_sem); - info = build_map_info(uprobe->inode->i_mapping, + info = uprobe_build_map_info(uprobe->inode->i_mapping, uprobe->offset, is_register); if (IS_ERR(info)) { err = PTR_ERR(info); @@ -828,7 +830,7 @@ static inline struct map_info *free_map_info(struct map_info *info) unlock: up_write(&mm->mmap_sem); free: - info = free_map_info(info); + info = uprobe_free_map_info(info); } out: percpu_up_write(&dup_mmap_sem); -- 1.8.3.1