lkml.org 
[lkml]   [2009]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Separate FMODE_PREAD/FMODE_PWRITE into separate flags
On Wed, 4 Feb 2009 19:42:03 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> And I updated seq_file-properly-cope-with-pread.patch thusly:
>
> --- a/fs/seq_file.c~seq_file-properly-cope-with-pread-fix
> +++ a/fs/seq_file.c
> @@ -48,6 +48,16 @@ int seq_open(struct file *file, const st
> */
> file->f_version = 0;
>
> + /*
> + * seq_files support lseek() and pread(). They do not implement
> + * write() at all, but we clear FMODE_PWRITE here for historical
> + * reasons.
> + *
> + * If a client of seq_files a) implements file.write() and b) wishes to
> + * support pwrite() then that client will need to implement its own
> + * file.open() which calls seq_open() and then sets FMODE_WRITE.
^P
> + */
> + file->f_mode &= ~FMODE_PWRITE;
> return 0;
> }
> EXPORT_SYMBOL(seq_open);


\
 
 \ /
  Last update: 2009-02-05 04:45    [W:0.038 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site