Received: by 10.213.65.68 with SMTP id h4csp331218imn; Tue, 13 Mar 2018 05:56:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELuTw/WP2IbNGv/bfobDdkpnak+Kd44XCvuBS7x+WKiP+YYqcaV3pjtshJwMcreVVKZwecIN X-Received: by 10.99.190.66 with SMTP id g2mr378535pgo.143.1520945801319; Tue, 13 Mar 2018 05:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520945801; cv=none; d=google.com; s=arc-20160816; b=J1z8tOztOCDm1HP/L7sxDVyg/u6B13XeTFF57WxfdF+TaafT2rtTnic4rLnCOO/Yaw 9mJG1xvpsCWAVDdJwjpKyUHQj1RTwR2AVG1udij+UCW8GyqzDIcSPUoCuv1BfEGMsWg0 eXE/yCETLm6dyNNQGj5/nKnBiFgr0wy8CA/wJhkuxlubqy42D59edPxwSw6pZAt30mp0 F8KBB9GlHTjD/5F3VbY8jsllI+RRKVhv2MvrxQ60ry1ZD8DSlEkca/EUqF50loetgrkN mrm/+Gboj0/OfKdtALe/5C0PPmLWPUqB44iNOVaJu6A1uK65fLPaq0G7es4GjEc8kGXs 4wJg== 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=KUFsgeDhP6bohsS82X89m8W3lm8lKKrQc7ypVc4wVww=; b=WiZyZxlhdfbhNde6ny5ScR46nHy0zUTZnK9TcFiXoIxFaI1/CcBsRci1Pzbcgy5qMu jFuA1CbHuURA4EMVriqCHUFy6msGfkZ7BDpqQrurtOZ5CH3WkU+UiphhsK29UV3hnCVv 1VeznHG2OrchJMyuB4f0LIHywRjrFYhMJofSqoLmPQvOAeLZ0zp6wDocce+vv/XJnNVl d1w6gqc8i+ffw4ehC+4rN8ykkAEGAGNnu3PseQvdWtO0KqKrLua9SlOlX+CB10uNcciI XHNto+ihlA1UAtpuTbiUNkHfKu6vd539+0iCANXcLyXsZt7nWeLDacwqHXIMVgv6dml4 /saA== 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 19si82133pgg.395.2018.03.13.05.56.27; Tue, 13 Mar 2018 05:56:41 -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 S1752630AbeCMMzH (ORCPT + 99 others); Tue, 13 Mar 2018 08:55:07 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47384 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbeCMMzD (ORCPT ); Tue, 13 Mar 2018 08:55:03 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2DCsw9F126337 for ; Tue, 13 Mar 2018 08:55:03 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gpddn4vt6-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 13 Mar 2018 08:55:02 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Mar 2018 12:54:43 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 13 Mar 2018 12:54:33 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2DCsX7V26083360; Tue, 13 Mar 2018 12:54:33 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EFCFC11C054; Tue, 13 Mar 2018 12:47:12 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D317911C04A; Tue, 13 Mar 2018 12:47:00 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.221.140]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Mar 2018 12:47:00 +0000 (GMT) From: Ravi Bangoria To: mhiramat@kernel.org, oleg@redhat.com, peterz@infradead.org, srikar@linux.vnet.ibm.com 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, gregkh@linuxfoundation.org, huawei.libin@huawei.com, hughd@google.com, jack@suse.cz, jglisse@redhat.com, jolsa@redhat.com, kan.liang@intel.com, kirill.shutemov@linux.intel.com, kjlx@templeofstupid.com, kstewart@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.com, milian.wolff@kdab.com, mingo@redhat.com, namhyung@kernel.org, naveen.n.rao@linux.vnet.ibm.com, pc@us.ibm.com, pombredanne@nexb.com, rostedt@goodmis.org, tglx@linutronix.de, tmricht@linux.vnet.ibm.com, willy@infradead.org, yao.jin@linux.intel.com, fengguang.wu@intel.com, Ravi Bangoria Subject: [PATCH 3/8] Uprobe: Rename map_info to uprobe_map_info Date: Tue, 13 Mar 2018 18:25:58 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313125603.19819-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180313125603.19819-1-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031312-0012-0000-0000-000005BD6631 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031312-0013-0000-0000-000019396961 Message-Id: <20180313125603.19819-4-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-13_06:,, 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-1803130154 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(). No functionality changes. 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 535fd39..081b88c1 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -695,27 +695,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 * +uprobe_free_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 * +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: @@ -729,7 +731,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; @@ -762,7 +764,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; @@ -774,7 +776,7 @@ static inline struct map_info *free_map_info(struct map_info *info) goto again; out: while (prev) - prev = free_map_info(prev); + prev = uprobe_free_map_info(prev); return curr; } @@ -782,11 +784,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); @@ -825,7 +827,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 = uprobe_free_map_info(info); } out: percpu_up_write(&dup_mmap_sem); -- 1.8.3.1