[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4840cc5370d9b4e4cc9344da47ed3e1fb67e9a0a.1433193673.git.ydroneaud@opteya.com>
Date: Mon, 1 Jun 2015 23:32:15 +0200
From: Yann Droneaud <ydroneaud@...eya.com>
To: Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Yann Droneaud <ydroneaud@...eya.com>
Subject: [PATCH v1 3/3] fs: documents seq_open()'s usage of file->private_data
seq_open() store 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@...eya.com>
---
fs/seq_file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/seq_file.c b/fs/seq_file.c
index a909f12dad4d..e48ef5682bfa 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)
{
--
2.4.2
--
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