[PATCH] teach seq_file to discard entries

Allow ->show() return SEQ_SKIP; that will discard all
output from that element and move on.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2008-03-28 00:46:41 -04:00
parent 4e1b36fb48
commit 521b5d0c40
3 changed files with 15 additions and 4 deletions

View file

@ -30,6 +30,8 @@ struct seq_operations {
int (*show) (struct seq_file *m, void *v);
};
#define SEQ_SKIP 1
int seq_open(struct file *, const struct seq_operations *);
ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);
loff_t seq_lseek(struct file *, loff_t, int);