Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbbEDWTu (ORCPT ); Mon, 4 May 2015 18:19:50 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:4487 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbbEDWTl (ORCPT ); Mon, 4 May 2015 18:19:41 -0400 From: Yann Droneaud To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yann Droneaud Subject: [PATCH 3/3] fs: documents seq_open()'s usage of file->private_data Date: Tue, 5 May 2015 00:19:15 +0200 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1164 Lines: 30 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.1430777196.git.ydroneaud@opteya.com Signed-off-by: Yann Droneaud --- fs/seq_file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/seq_file.c b/fs/seq_file.c index cb9c3dbd1a1e..69d13f62d885 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.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/