lkml.org 
[lkml]   [2011]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] seq_file.h: introduce DECLARE_SEQ_FOPS_{RO,RW}
Date
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


\
 
 \ /
  Last update: 2011-06-06 23:29    [from the cache]
©2003-2011 Jasper Spaans