Received: by 10.213.65.68 with SMTP id h4csp469874imn; Wed, 4 Apr 2018 01:32:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49912icItkL56vr+1I4gJ5l8B7+taZ1S4L+CQqp6ipbpiOb08vFqour/XU5HhaoHi9NG4yq X-Received: by 10.98.141.205 with SMTP id p74mr13161494pfk.210.1522830727933; Wed, 04 Apr 2018 01:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522830727; cv=none; d=google.com; s=arc-20160816; b=sT5LkUaRI5UNq1qIjKfgIjqX0rqz6MNlmu0Rkc3ZYs1IVx6649FlwiaLWaHeAUHfIZ /lOKkECuvtM3bi5Gna2WuatWLcZaqjo9IOnOIvmwAko+dBWD8rC/JNbxgMB9ewgRr5r4 LQSJiV23YYSM0Dv3SCgZOYholhhW1kux+pqG8lNnqX4F30obO+jgDBr8rZ30h9MQt1BY JSym3CCVNGLggPExYVqhS6GnNLMKYpQj/TVfSkADM8locyQw/4Lgvisc3fsJR8HblbTr y+jrNbDw1TYo1FmV0KhB0mBGG/aOpJmleacRvk3IdyB3q9xduxeG0N3WHzRb4nqOPlHr 6GUw== 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=RFvSO2RIjvcuAB/poZD2eAgIQDmyE3iZxF8vwUwpTkE=; b=YY7Ho2mOQp7hKHstKitoOBenubGHE99YiHbl7kP2klM1hXyp+FcoYPUU2e5hUYSjkD 4HlWMp5greQnsUuYWRBk+VER8zAYvplFUFDmJBKTtDSYORE5iBv2NAfltlBJxswH0b7H 024NHWPpwClyYN+u7HmdejS3BB9DMNAnGa4AwSS2C4szzVH+qI+XA38oHR5x6FHYY90+ I1cr0EmEtoP38oGXz7dDMqh5DBa8Hj8GwfUqlTYYWLJFClI/ELBiesm5ArZilqQMe+34 3dK/SPDlRFHg/rwwjV4V765jQohS/tbhSIjB7ApoCvDQ+ILk2igtvO8+4YqalyomWJcQ uwPA== 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 d2-v6si2579432plh.44.2018.04.04.01.31.54; Wed, 04 Apr 2018 01:32:07 -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 S1751517AbeDDI3N (ORCPT + 99 others); Wed, 4 Apr 2018 04:29:13 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60942 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbeDDI3I (ORCPT ); Wed, 4 Apr 2018 04:29:08 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w348Sve1130535 for ; Wed, 4 Apr 2018 04:29:08 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h4puj2d8e-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 04 Apr 2018 04:29:07 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Apr 2018 09:29:05 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 4 Apr 2018 09:28:56 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w348SuLR57540710; Wed, 4 Apr 2018 08:28:56 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92F6611C054; Wed, 4 Apr 2018 09:21:11 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0444E11C052; Wed, 4 Apr 2018 09:21:07 +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:21:06 +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 4/9] Uprobe: Rename map_info to uprobe_map_info Date: Wed, 4 Apr 2018 14:01:05 +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-0008-0000-0000-000004E68850 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040408-0009-0000-0000-00001E799638 Message-Id: <20180404083110.18647-5-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 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