From: Arnd Bergmann <arnd@arndb.de>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] seq_file.h: introduce DECLARE_SEQ_FOPS_{RO,RW}
Date: Mon, 6 Jun 2011 23:26:44 +0200 [thread overview]
Message-ID: <201106062326.44103.arnd@arndb.de> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F001F3820B7C57@AUSP01VMBX24.collaborationhost.net>
On Monday 06 June 2011 23:19:15 H Hartley Sweeten wrote:
> Just an FYI, the exact same thing is being done with DEFINE_SIMPLE_ATTRIBUTE
> in fs.h:
>
> #define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \
> static int __fops ## _open(struct inode *inode, struct file *file) \
> { \
> __simple_attr_check_format(__fmt, 0ull); \
> return simple_attr_open(inode, file, __get, __set, __fmt); \
> } \
> static const struct file_operations __fops = { \
> .owner = THIS_MODULE, \
> .open = __fops ## _open, \
> .release = simple_attr_release, \
> .read = simple_attr_read, \
> .write = simple_attr_write, \
> .llseek = generic_file_llseek, \
> };
The main difference here is that the arguments to the macro are used directly
in the file operations, which makes it possible to grep for them.
Arnd
prev parent reply other threads:[~2011-06-06 21:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 20:19 [PATCH] seq_file.h: introduce DECLARE_SEQ_FOPS_{RO,RW} H Hartley Sweeten
2011-06-06 21:07 ` Al Viro
2011-06-06 21:18 ` Alexey Dobriyan
2011-06-06 21:19 ` H Hartley Sweeten
2011-06-06 21:22 ` Al Viro
2011-06-06 21:26 ` Arnd Bergmann [this message]
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=201106062326.44103.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=hartleys@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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