From: Yann Droneaud Date: Tue, 30 Jun 2015 21:57:36 +0000 (-0700) Subject: fs: document seq_open()'s usage of file->private_data X-Git-Tag: v4.2-rc1~49^2~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=460b865e53c347ebf110e50d499718cd9b39d810;p=platform%2Fkernel%2Flinux-exynos.git 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 Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/seq_file.c b/fs/seq_file.c index 5f163c6..760e25d 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) {