diff options
author | Yann Droneaud <ydroneaud@opteya.com> | 2015-06-30 14:57:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-30 19:44:57 -0700 |
commit | 460b865e53c347ebf110e50d499718cd9b39d810 (patch) | |
tree | fe8871e9c28acbad496efca46c87b9366c703267 /fs/seq_file.c | |
parent | 189f9841de23a58ecb4b2602db8581512ff08ba4 (diff) | |
download | lwn-460b865e53c347ebf110e50d499718cd9b39d810.tar.gz lwn-460b865e53c347ebf110e50d499718cd9b39d810.zip |
fs: document seq_open()'s usage of file->private_data
seq_open() stores its struct seq_file in file->private_data, thus it must
not be modified by user of seq_file.
Link: http://lkml.kernel.org/r/cover.1433193673.git.ydroneaud@opteya.com
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r-- | fs/seq_file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c index 5f163c6c821c..760e25dad985 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -48,6 +48,8 @@ static void *seq_buf_alloc(unsigned long size) * ERR_PTR(error). In the end of sequence they return %NULL. ->show() * returns 0 in case of success and negative number in case of error. * Returning SEQ_SKIP means "discard this element and move on". + * Note: seq_open() will allocate a struct seq_file and store its + * pointer in @file->private_data. This pointer should not be modified. */ int seq_open(struct file *file, const struct seq_operations *op) { |