From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbaKIHcl (ORCPT ); Sun, 9 Nov 2014 02:32:41 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:39248 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbaKIHcj (ORCPT ); Sun, 9 Nov 2014 02:32:39 -0500 Date: Sat, 8 Nov 2014 23:32:34 -0800 From: Omar Sandoval To: Joe Perches Cc: Chris Mason , Josef Bacik , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH v6] Move BTRFS RCU string to common library Message-ID: <20141109073234.GA28668@mew.home.network> References: <1415407155.23530.24.camel@perches.com> <1415436384-13691-1-git-send-email-osandov@osandov.com> <1415463217.23530.26.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1415463217.23530.26.camel@perches.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 08, 2014 at 08:13:37AM -0800, Joe Perches wrote: > On Sat, 2014-11-08 at 00:46 -0800, Omar Sandoval wrote: > > The RCU-friendly string API used internally by BTRFS is generic enough for > > common use. This doesn't add any new functionality, but instead just moves the > > code and documents the existing API. > > Some more trivia, can be updated later if desired. > > > diff --git a/include/linux/rcustring.h b/include/linux/rcustring.h > > new file mode 100644 > [] > > + > > +/** > > + * printk_in_rcu() - printk in an RCU read-side critical section > > It'd be nice to show the arguments for kernel-doc here My impression is that referencing printk tells you everything you need to know, but for completeness' sake, that sounds fair. > > + */ > > +#define printk_in_rcu(fmt, ...) \ > > + do { \ > > + rcu_read_lock(); \ > > + printk(fmt, __VA_ARGS__); \ > > This should use ##__VA_ARGS__ to allow the > compiler to elide the comma when using > > printk_in_rcu("Hello World!"); > Luckily, there's probably no sane reason anyone would do a printk_in_rcu without the varargs, but once again, it's probably good hygiene. Anyone else have anything to add? Otherwise, I'll wrap this up in another iteration of the patch. Thanks! -- Omar