From 32ccd2b61dfd05401528b27770ab3cd22b143641 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Tue, 20 May 2003 06:58:17 -0700 Subject: [PATCH] seq_path(), /proc/mounts and /proc/swaps This adds a new seq_...() helper: seq_path(seq_file, mnt, dentry, escape) It spits the pathname into seq_file, does octal escapes for given set of characters, returns the number of characters it'd produced or -1 in case of error. Long names are handled gracefully - you don't need anything to do, generic seq_file logics will do the right thing. /proc/mounts and /proc/swaps are converted to use of seq_path(), some junk removed. /proc/pid/maps will be converted next. --- include/linux/seq_file.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/seq_file.h') diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index a704ab14e499..13df4750a271 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -8,6 +8,8 @@ struct seq_operations; struct file; +struct vfsmount; +struct dentry; struct inode; struct seq_file { @@ -58,6 +60,8 @@ static inline int seq_puts(struct seq_file *m, const char *s) int seq_printf(struct seq_file *, const char *, ...) __attribute__ ((format (printf,2,3))); +int seq_path(struct seq_file *, struct vfsmount *, struct dentry *, char *); + int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_release(struct inode *, struct file *); int seq_release_private(struct inode *, struct file *); -- cgit v1.2.3