summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>2003-05-20 06:58:17 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-20 06:58:17 -0700
commit32ccd2b61dfd05401528b27770ab3cd22b143641 (patch)
tree01cd62e23876962215deb49c4ff7105a65bdddfd /fs/namespace.c
parentecdb306381de9308a484c29b28c03e2686aa00ae (diff)
[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.
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 6c46fbda724d..09238867b43b 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -211,19 +211,10 @@ static int show_vfsmnt(struct seq_file *m, void *v)
{ 0, NULL }
};
struct proc_fs_info *fs_infop;
- char *path_buf, *path;
-
- path_buf = (char *) __get_free_page(GFP_KERNEL);
- if (!path_buf)
- return -ENOMEM;
- path = d_path(mnt->mnt_root, mnt, path_buf, PAGE_SIZE);
- if (IS_ERR(path))
- path = " (too long)";
mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
seq_putc(m, ' ');
- mangle(m, path);
- free_page((unsigned long) path_buf);
+ seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
seq_putc(m, ' ');
mangle(m, mnt->mnt_sb->s_type->name);
seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");