Received: by 10.213.65.68 with SMTP id h4csp68583imn; Thu, 15 Mar 2018 09:46:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELssZ6uYnl2LNK3rVTzcw4TdZZP2plKOkcZD3G/eGdkgzdCqjJAEM3rp1Pp+GoTE++T3/n7p X-Received: by 10.98.108.2 with SMTP id h2mr8190106pfc.43.1521132371266; Thu, 15 Mar 2018 09:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521132371; cv=none; d=google.com; s=arc-20160816; b=CxkbL0f+oZCHD1jk/IlDKzermDBpKAdDXPHiJl+Pac5D1ID1e9mQHpNfTpSTArypP9 +5A3S1M3TkCVpIm92h9oI/EgfWLN2/3iRQd696HnituAQMZv0hv4+95RbcsfYMmbTil7 PpjxxAgGAxgpyxQealbGoWMd+JY0e2ZknSNr8AtTakzKlCVb5BuxbeMcLEFrtTVzLVKd hqwYOZK+5TsC4nThHxRr3fegBLr9XnEwyDgvrBmkVeTRr1WR6zNblGaGgPKGl746yE2I WjZt5N/i3lXfvXqx9/iK70nZa3MTBwUx2eqHHZxjUQu8jvikr2cV4bDdiG7o7+Qb2DPS 6YBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=irUzNzyTwelT9JS4LWfhHG8DnVdAuEK4MBEWNDWQVUE=; b=fRicY7sKeakekLFziSDywMtRl/f420GVeH6NloLtez1wPEneU/RWQTrPBsfdCmPz55 Sx6mDobSPgKWdhd16a5WBWrL/Ojf4u/gUQyXyto06xSSkPvzoGd6saLPx3uuHJQTyaw2 JdEZ7ojiYHYmbuFnYA9/hDmSz/gsW4/bVFHSWAalU9s0d9/fih38JL4WDsKwr6F9CJYF UJZW79YSbhjuPI4TiWj2+FU15nTKhif80Je7WYDtaKiPJv8tpyZmrMcCj66NN/1vxFIq PX5AzgZmRICkOREb29KeFmXR20lLA+DPqA7EqpV9ZF7Y7Lm/zwrIQd//+7RdAPhERzzB jUnw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7si3710652pgf.622.2018.03.15.09.45.56; Thu, 15 Mar 2018 09:46:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbeCOQo4 (ORCPT + 99 others); Thu, 15 Mar 2018 12:44:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbeCOQoy (ORCPT ); Thu, 15 Mar 2018 12:44:54 -0400 Received: from vmware.local.home (ip-64-134-136-2.public.wayport.net [64.134.136.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C2C420779; Thu, 15 Mar 2018 16:44:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C2C420779 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Thu, 15 Mar 2018 12:44:49 -0400 From: Steven Rostedt To: Ravi Bangoria Cc: mhiramat@kernel.org, oleg@redhat.com, peterz@infradead.org, srikar@linux.vnet.ibm.com, 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, tglx@linutronix.de, tmricht@linux.vnet.ibm.com, willy@infradead.org, yao.jin@linux.intel.com, fengguang.wu@intel.com Subject: Re: [PATCH 3/8] Uprobe: Rename map_info to uprobe_map_info Message-ID: <20180315124449.7d92c06b@vmware.local.home> In-Reply-To: <20180313125603.19819-4-ravi.bangoria@linux.vnet.ibm.com> References: <20180313125603.19819-1-ravi.bangoria@linux.vnet.ibm.com> <20180313125603.19819-4-ravi.bangoria@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Mar 2018 18:25:58 +0530 Ravi Bangoria wrote: > -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, Also, as these functions have side effects (like you need to perform a mmput(info->mm), you need to add kerneldoc type comments to these functions, explaining how to use them. When you upgrade a function from static to use cases outside the file, it requires documenting that function for future users. -- Steve > + 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);