[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 6 Jun 2011 23:26:44 +0200
From: Arnd Bergmann <arnd@...db.de>
To: H Hartley Sweeten <hartleys@...ionengravers.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] seq_file.h: introduce DECLARE_SEQ_FOPS_{RO,RW}
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists