X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fseq_file.h;h=83783ab0f5524d7ad5e4e3092aa1790cdec527c9;hb=7616ee95f27a04fd5a6434e9ef4a82cec4b2807c;hp=850a974ee505e614060bd48d2cd9ee1958405a55;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6 diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 850a974ee5..83783ab0f5 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -4,7 +4,7 @@ #include #include -#include +#include struct seq_operations; struct file; @@ -19,8 +19,8 @@ struct seq_file { size_t count; loff_t index; loff_t version; - struct semaphore sem; - struct seq_operations *op; + struct mutex lock; + const struct seq_operations *op; void *private; }; @@ -31,7 +31,7 @@ struct seq_operations { int (*show) (struct seq_file *m, void *v); }; -int seq_open(struct file *, struct seq_operations *); +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); int seq_release(struct inode *, struct file *); @@ -50,5 +50,16 @@ int seq_release_private(struct inode *, struct file *); #define SEQ_START_TOKEN ((void *)1) +/* + * Helpers for iteration over list_head-s in seq_files + */ + +extern struct list_head *seq_list_start(struct list_head *head, + loff_t pos); +extern struct list_head *seq_list_start_head(struct list_head *head, + loff_t pos); +extern struct list_head *seq_list_next(void *v, struct list_head *head, + loff_t *ppos); + #endif #endif