From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932359Ab3KFLsY (ORCPT ); Wed, 6 Nov 2013 06:48:24 -0500 Received: from mail-la0-f49.google.com ([209.85.215.49]:50219 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932236Ab3KFLsR (ORCPT ); Wed, 6 Nov 2013 06:48:17 -0500 Message-Id: <20131106114812.474330639@openvz.org> User-Agent: quilt/0.60-1 Date: Wed, 06 Nov 2013 15:47:43 +0400 From: Cyrill Gorcunov To: linux-kernel@vger.kernel.org Cc: Cyrill Gorcunov , Pavel Emelyanov , Oleg Nesterov , Andrey Vagin , Al Viro , Alexey Dobriyan , James Bottomley , "Aneesh Kumar K.V" , Matthew Helsley , "J. Bruce Fields" , Andrew Morton Subject: [patch 1/7] seq-file: Export single_ helpers References: <20131106114742.988532945@openvz.org> Content-Disposition: inline; filename=0000-seq-export-single Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The single_ helpers will be used in fdinfo output to eliminate code duplication. Signed-off-by: Cyrill Gorcunov Cc: Pavel Emelyanov Cc: Oleg Nesterov Cc: Andrey Vagin Cc: Al Viro Cc: Alexey Dobriyan Cc: James Bottomley Cc: "Aneesh Kumar K.V" Cc: Alexey Dobriyan Cc: Matthew Helsley Cc: "J. Bruce Fields" Cc: "Aneesh Kumar K.V" Cc: Andrew Morton --- fs/seq_file.c | 9 ++++++--- include/linux/seq_file.h | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) Index: linux-2.6.git/fs/seq_file.c =================================================================== --- linux-2.6.git.orig/fs/seq_file.c +++ linux-2.6.git/fs/seq_file.c @@ -565,20 +565,23 @@ int seq_bitmap_list(struct seq_file *m, } EXPORT_SYMBOL(seq_bitmap_list); -static void *single_start(struct seq_file *p, loff_t *pos) +void *single_start(struct seq_file *p, loff_t *pos) { return NULL + (*pos == 0); } +EXPORT_SYMBOL(single_start); -static void *single_next(struct seq_file *p, void *v, loff_t *pos) +void *single_next(struct seq_file *p, void *v, loff_t *pos) { ++*pos; return NULL; } +EXPORT_SYMBOL(single_next); -static void single_stop(struct seq_file *p, void *v) +void single_stop(struct seq_file *p, void *v) { } +EXPORT_SYMBOL(single_stop); int single_open(struct file *file, int (*show)(struct seq_file *, void *), void *data) Index: linux-2.6.git/include/linux/seq_file.h =================================================================== --- linux-2.6.git.orig/include/linux/seq_file.h +++ linux-2.6.git/include/linux/seq_file.h @@ -122,6 +122,9 @@ static inline int seq_nodemask_list(stru return seq_bitmap_list(m, mask->bits, MAX_NUMNODES); } +void *single_start(struct seq_file *, loff_t *); +void *single_next(struct seq_file *, void *, loff_t *); +void single_stop(struct seq_file *, void *); int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t); int single_release(struct inode *, struct file *);