Received: by 10.223.185.116 with SMTP id b49csp5887178wrg; Tue, 27 Feb 2018 23:54:00 -0800 (PST) X-Google-Smtp-Source: AH8x225SeIKo9JOnT+BSjUJ1O8RL7kRFKl6jVWfbImUZ6bLVPJMLNd93Xb/KrQiuoPCJQXhz/orv X-Received: by 10.99.96.137 with SMTP id u131mr13793092pgb.103.1519804440389; Tue, 27 Feb 2018 23:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519804440; cv=none; d=google.com; s=arc-20160816; b=gXuEZELOw/5sS9mmxqiI88zjFsa2mBcHbsL3Uw2jB/a3K1zINuYg2VcNYuvNd20o3X plK1niBoxz9iiAPSObRypRiJMfYEZFHt+4Dd8jXMFBa+S/8gtuRu0yLXbh3cgNCMyjxF CaL7Lmn9hNQ8WyrdWrCsX87HeQNLYwBNMgA2tq8eoEHc3gXHIGE5PCEvuzJE+dNS4gxZ lSw3TCagFY34cRF+IhcM9f+VBKwnfcQW35slo2WAyaChL5zf4oMI/eqvevsVplPH3viv etUscLogUHCjncidlxKjuJHGxd99OTJ4WF62N/EmWDgSRxXW4lAAXH7Ai+d3uJrxR6BW sOWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=x5YYu2SQOBvGYaVv24Ja3vz24l1D1BIwDUMFgmUs6fc=; b=ULXs/oC5nW5pZ+6YeSE4p4KRezYZOsx56is5mEMgF3aFadBryAdbzICdEc+4VSWbCF 9sxqOhwteqZ74zgcB3hk9m9OWqd90gLLJ+A34u6ip+qBIS4cr0pBRO4jakz0fyBjnbcg X7dsWs/9HaVJmfb7G0Wx73dIDBUafzDIqu+UYtV2WUeO81gocfQPmumWnO8EjTzBPP/E Xg5O+xKK52osP9yGf6cAcX4YqVLD4brRZwwicyrRP5Nqbn3VcpmITGINtvOYBJUrVRni QvOYVkWaY0agL9f6J3nSv7kUop5vxPk5XA0/Hon4qb0eZjGjenYxL0w+7DufsqbSDAXP Aucg== 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 z16si701788pgc.464.2018.02.27.23.53.45; Tue, 27 Feb 2018 23:54:00 -0800 (PST) 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 S1752136AbeB1Hvx (ORCPT + 99 others); Wed, 28 Feb 2018 02:51:53 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49504 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbeB1Hvu (ORCPT ); Wed, 28 Feb 2018 02:51:50 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1S7ohjo047873 for ; Wed, 28 Feb 2018 02:51:50 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gdq1vtwgk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 28 Feb 2018 02:51:50 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Feb 2018 07:51:47 -0000 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, 28 Feb 2018 07:51:44 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1S7pir157016522; Wed, 28 Feb 2018 07:51:44 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD0D7A4040; Wed, 28 Feb 2018 07:44:47 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 997BCA4053; Wed, 28 Feb 2018 07:44:45 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.31.161]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 28 Feb 2018 07:44:45 +0000 (GMT) From: Ravi Bangoria To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mhiramat@kernel.org, ananth@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com, oleg@redhat.com Cc: Ravi Bangoria Subject: [RFC 1/4] Uprobe: Rename map_info to uprobe_map_info Date: Wed, 28 Feb 2018 13:23:42 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228075345.674-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180228075345.674-1-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18022807-0008-0000-0000-000004D55D1E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022807-0009-0000-0000-00001E688047 Message-Id: <20180228075345.674-2-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-28_04:,, 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-1802280094 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. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 267f6ef..fcce25dd 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -705,27 +705,29 @@ 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 * +free_uprobe_map_info(struct uprobe_map_info *info) { - struct map_info *next = info->next; + struct uprobe_map_info *next = info->next; 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 * +build_uprobe_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: @@ -739,7 +741,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; @@ -772,7 +774,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; @@ -784,7 +786,7 @@ static inline struct map_info *free_map_info(struct map_info *info) goto again; out: while (prev) - prev = free_map_info(prev); + prev = free_uprobe_map_info(prev); return curr; } @@ -792,11 +794,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 = build_uprobe_map_info(uprobe->inode->i_mapping, uprobe->offset, is_register); if (IS_ERR(info)) { err = PTR_ERR(info); @@ -835,7 +837,7 @@ static inline struct map_info *free_map_info(struct map_info *info) up_write(&mm->mmap_sem); free: mmput(mm); - info = free_map_info(info); + info = free_uprobe_map_info(info); } out: percpu_up_write(&dup_mmap_sem); -- 1.8.3.1