From: Joe Perches <joe@perches.com>
To: Omar Sandoval <osandov@osandov.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v6] Move BTRFS RCU string to common library
Date: Sat, 08 Nov 2014 08:13:37 -0800 [thread overview]
Message-ID: <1415463217.23530.26.camel@perches.com> (raw)
In-Reply-To: <1415436384-13691-1-git-send-email-osandov@osandov.com>
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
> + */
> +#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!");
> + rcu_read_unlock(); \
> + } while (0)
> +
> +/**
> + * printk_ratelimited_in_rcu() - printk_ratelimited in an RCU read-side critical
> + * section
> + */
> +#define printk_ratelimited_in_rcu(fmt, ...) \
> + do { \
> + rcu_read_lock(); \
> + printk_ratelimited(fmt, __VA_ARGS__); \
> + rcu_read_unlock(); \
> + } while (0)
> +
> +#endif
Here too
next prev parent reply other threads:[~2014-11-08 16:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 20:17 [PATCH v5] Move BTRFS RCU string to common library Omar Sandoval
2014-11-07 20:21 ` Chris Mason
2014-11-08 0:39 ` Joe Perches
2014-11-08 8:46 ` [PATCH v6] " Omar Sandoval
2014-11-08 16:13 ` Joe Perches [this message]
2014-11-09 7:32 ` Omar Sandoval
2014-11-13 10:18 ` [PATCH v7] " Omar Sandoval
2014-11-20 22:10 ` Omar Sandoval
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=1415463217.23530.26.camel@perches.com \
--to=joe@perches.com \
--cc=clm@fb.com \
--cc=jbacik@fb.com \
--cc=josh@joshtriplett.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=osandov@osandov.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox