[PATCH v4 06/14] locks: encapsulate the fl_link list handling

Jeff Layton jlayton at redhat.com
Tue Jun 25 06:32:13 EDT 2013


On Tue, 25 Jun 2013 11:37:04 +1000
Stephen Rothwell <sfr at canb.auug.org.au> wrote:

> Hi Jeff,
> 
> Thanks for doing all this work!
> 
> Trivial comments below.
> 
> On Fri, 21 Jun 2013 08:58:14 -0400 Jeff Layton <jlayton at redhat.com> wrote:
> >
> > +static inline void
> > +locks_insert_global_locks(struct file_lock *fl)
> > +{
> > +	list_add_tail(&fl->fl_link, &file_lock_list);
> > +}
> 
> We generally do not use "inline" in C files any more and leave it to the
> compiler to do that.  Also, without the "inline" these function headers
> should all be able to fit on single lines like the others here i.e.
> 
> static void locks_insert_global_locks(struct file_lock *fl)
> 

Thanks for helping review.

Usually that makes sense, but doesn't the compiler generally determine
that by counting the number of call sites? In this case, we'll have
several call sites and it probably wouldn't inline the function. That
makes this a little less efficient since we'll have to jump to this
routine, do the list_add_tail and then jump back.

That said, I'm not opposed to doing that since these routines grow a
bit in size later and we'll only do this when a lock is acquired or
dropped. I think Al has already merged most of this set into his
for-next branch though. Perhaps I can do a patch on top of that set
that removes the inline keywords from those functions?

-- 
Jeff Layton <jlayton at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20130625/a9492a07/attachment.sig>


More information about the linux-afs mailing list