All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Souptick Joarder <jrdr.linux@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Alex Shi <alex.shi@linux.alibaba.com>
Subject: Re: [PATCH] mm: add prototype for __add_to_page_cache_locked()
Date: Tue, 22 Dec 2020 15:53:45 -0800	[thread overview]
Message-ID: <20201222155345.e7086ad37967c9b7feae29e4@linux-foundation.org> (raw)
In-Reply-To: <20201222204000.GN874@casper.infradead.org>

On Tue, 22 Dec 2020 20:40:00 +0000 Matthew Wilcox <willy@infradead.org> wrote:

> On Tue, Dec 22, 2020 at 07:49:52PM +0530, Souptick Joarder wrote:
> > Otherwise it cause gcc warning:
> >           ^~~~~~~~~~~~~~~
> 
> That line is just confusing.

I cleaned up the changelog.  It is presently

: Subject: include/linux/mm.h: add prototype for __add_to_page_cache_locked()
: 
: Otherwise it causes a gcc warning:
: 
: ../mm/filemap.c:830:14: warning: no previous prototype for
: `__add_to_page_cache_locked' [-Wmissing-prototypes]
: 
: A previous attempt to make this function static led to compilation
: errors for a few architectures, because __add_to_page_cache_locked() is
: referred to by BPF code.
: 
: Adding a prototype will silence the warning.

> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -216,6 +216,12 @@ int overcommit_kbytes_handler(struct ctl_table *, int, void *, size_t *,
> >  		loff_t *);
> >  int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *,
> >  		loff_t *);
> > +/*
> > + * Any attempt to mark this function as static leads to build failure
> > + * for few architectures. Adding a prototype to silence gcc warning.
> > + */
> 
> We don't need a comment here for this.  The commit log is enough.

I think it's OK - people do send patches which remove a prototype and
also make the function static.  A tree-wide grep would catch the bpf
reference but I suspect people tend to grep for "foo(" rather then
"foo".

> > +int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
> > +		pgoff_t offset, gfp_t gfp, void **shadowp);
> 
> Please name that 'index', not 'offset'.

I too prefer index over offset.  

X1:/usr/src/linux-5.10> grep -r "pgoff_t offset" . | wc -l
52
X1:/usr/src/linux-5.10> grep -r "pgoff_t index" . | wc -l 
250

But renaming this arg should be a separate patch.

And I don't think we should be preparing large "rename offset to index"
patches, please.  The value/noise ratio is too low.

  reply	other threads:[~2020-12-22 23:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 14:19 [PATCH] mm: add prototype for __add_to_page_cache_locked() Souptick Joarder
2020-12-22 20:40 ` Matthew Wilcox
2020-12-22 23:53   ` Andrew Morton [this message]
2020-12-23  1:19     ` Matthew Wilcox
2020-12-23  8:31     ` Christoph Hellwig
2020-12-23 12:11       ` Matthew Wilcox
2020-12-23 15:52         ` Christoph Hellwig
2020-12-28  0:59           ` Alexei Starovoitov
2020-12-28  0:59             ` Alexei Starovoitov
2020-12-23  3:16 Souptick Joarder
2020-12-23  3:18 ` Souptick Joarder
2020-12-23  3:18   ` Souptick Joarder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201222155345.e7086ad37967c9b7feae29e4@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alex.shi@linux.alibaba.com \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.