aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2008-02-14 22:38:43 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 00:17:08 -0500
commitc32c2f63a9d6c953aaf168c0b2551da9734f76d2 (patch)
tree14eca3083f3de4a87a95359ab66109c10add1ae7
parente83aece3afad4d56cc01abe069d3519e851cd2de (diff)
d_path: Make seq_path() use a struct path argument
seq_path() is always called with a dentry and a vfsmount from a struct path. Make seq_path() take it directly as an argument. Signed-off-by: Jan Blunck <jblunck@suse.de> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/md/md.c3
-rw-r--r--fs/namespace.c6
-rw-r--r--fs/nfsd/export.c4
-rw-r--r--fs/proc/nommu.c2
-rw-r--r--fs/proc/task_mmu.c2
-rw-r--r--fs/seq_file.c7
-rw-r--r--include/linux/seq_file.h5
-rw-r--r--mm/mempolicy.c2
-rw-r--r--mm/swapfile.c2
9 files changed, 16 insertions, 17 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 5fc326d3970e..7da6ec244e15 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5197,8 +5197,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
5197 chunk_kb ? "KB" : "B"); 5197 chunk_kb ? "KB" : "B");
5198 if (bitmap->file) { 5198 if (bitmap->file) {
5199 seq_printf(seq, ", file: "); 5199 seq_printf(seq, ", file: ");
5200 seq_path(seq, bitmap->file->f_path.mnt, 5200 seq_path(seq, &bitmap->file->f_path, " \t\n");
5201 bitmap->file->f_path.dentry," \t\n");
5202 } 5201 }
5203 5202
5204 seq_printf(seq, "\n"); 5203 seq_printf(seq, "\n");
diff --git a/fs/namespace.c b/fs/namespace.c
index eef57635ee07..7953c96a2071 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -408,10 +408,11 @@ static int show_vfsmnt(struct seq_file *m, void *v)
408 { 0, NULL } 408 { 0, NULL }
409 }; 409 };
410 struct proc_fs_info *fs_infop; 410 struct proc_fs_info *fs_infop;
411 struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
411 412
412 mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 413 mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
413 seq_putc(m, ' '); 414 seq_putc(m, ' ');
414 seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); 415 seq_path(m, &mnt_path, " \t\n\\");
415 seq_putc(m, ' '); 416 seq_putc(m, ' ');
416 mangle(m, mnt->mnt_sb->s_type->name); 417 mangle(m, mnt->mnt_sb->s_type->name);
417 if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) { 418 if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) {
@@ -443,6 +444,7 @@ struct seq_operations mounts_op = {
443static int show_vfsstat(struct seq_file *m, void *v) 444static int show_vfsstat(struct seq_file *m, void *v)
444{ 445{
445 struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); 446 struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
447 struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
446 int err = 0; 448 int err = 0;
447 449
448 /* device */ 450 /* device */
@@ -454,7 +456,7 @@ static int show_vfsstat(struct seq_file *m, void *v)
454 456
455 /* mount point */ 457 /* mount point */
456 seq_puts(m, " mounted on "); 458 seq_puts(m, " mounted on ");
457 seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); 459 seq_path(m, &mnt_path, " \t\n\\");
458 seq_putc(m, ' '); 460 seq_putc(m, ' ');
459 461
460 /* file system type */ 462 /* file system type */
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index b59f8590af47..4a85b40eef4f 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -203,7 +203,7 @@ static int expkey_show(struct seq_file *m,
203 if (test_bit(CACHE_VALID, &h->flags) && 203 if (test_bit(CACHE_VALID, &h->flags) &&
204 !test_bit(CACHE_NEGATIVE, &h->flags)) { 204 !test_bit(CACHE_NEGATIVE, &h->flags)) {
205 seq_printf(m, " "); 205 seq_printf(m, " ");
206 seq_path(m, ek->ek_path.mnt, ek->ek_path.dentry, "\\ \t\n"); 206 seq_path(m, &ek->ek_path, "\\ \t\n");
207 } 207 }
208 seq_printf(m, "\n"); 208 seq_printf(m, "\n");
209 return 0; 209 return 0;
@@ -649,7 +649,7 @@ static int svc_export_show(struct seq_file *m,
649 return 0; 649 return 0;
650 } 650 }
651 exp = container_of(h, struct svc_export, h); 651 exp = container_of(h, struct svc_export, h);
652 seq_path(m, exp->ex_path.mnt, exp->ex_path.dentry, " \t\n\\"); 652 seq_path(m, &exp->ex_path, " \t\n\\");
653 seq_putc(m, '\t'); 653 seq_putc(m, '\t');
654 seq_escape(m, exp->ex_client->name, " \t\n\\"); 654 seq_escape(m, exp->ex_client->name, " \t\n\\");
655 seq_putc(m, '('); 655 seq_putc(m, '(');
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
index 5d9147b9d738..941e95114b5a 100644
--- a/fs/proc/nommu.c
+++ b/fs/proc/nommu.c
@@ -67,7 +67,7 @@ int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
67 if (len < 1) 67 if (len < 1)
68 len = 1; 68 len = 1;
69 seq_printf(m, "%*c", len, ' '); 69 seq_printf(m, "%*c", len, ' ');
70 seq_path(m, file->f_path.mnt, file->f_path.dentry, ""); 70 seq_path(m, &file->f_path, "");
71 } 71 }
72 72
73 seq_putc(m, '\n'); 73 seq_putc(m, '\n');
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 4c4f99fb1bfc..49958cffbd8d 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -271,7 +271,7 @@ static int show_map(struct seq_file *m, void *v)
271 */ 271 */
272 if (file) { 272 if (file) {
273 pad_len_spaces(m, len); 273 pad_len_spaces(m, len);
274 seq_path(m, file->f_path.mnt, file->f_path.dentry, "\n"); 274 seq_path(m, &file->f_path, "\n");
275 } else { 275 } else {
276 const char *name = arch_vma_name(vma); 276 const char *name = arch_vma_name(vma);
277 if (!name) { 277 if (!name) {
diff --git a/fs/seq_file.c b/fs/seq_file.c
index ca71c115bdaa..8d862907f060 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -342,13 +342,12 @@ int seq_printf(struct seq_file *m, const char *f, ...)
342} 342}
343EXPORT_SYMBOL(seq_printf); 343EXPORT_SYMBOL(seq_printf);
344 344
345int seq_path(struct seq_file *m, 345int seq_path(struct seq_file *m, struct path *path, char *esc)
346 struct vfsmount *mnt, struct dentry *dentry,
347 char *esc)
348{ 346{
349 if (m->count < m->size) { 347 if (m->count < m->size) {
350 char *s = m->buf + m->count; 348 char *s = m->buf + m->count;
351 char *p = d_path(dentry, mnt, s, m->size - m->count); 349 char *p = d_path(path->dentry, path->mnt, s,
350 m->size - m->count);
352 if (!IS_ERR(p)) { 351 if (!IS_ERR(p)) {
353 while (s <= p) { 352 while (s <= p) {
354 char c = *p++; 353 char c = *p++;
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 648dfeb444db..67c2563961f3 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -8,8 +8,7 @@
8 8
9struct seq_operations; 9struct seq_operations;
10struct file; 10struct file;
11struct vfsmount; 11struct path;
12struct dentry;
13struct inode; 12struct inode;
14 13
15struct seq_file { 14struct seq_file {
@@ -42,7 +41,7 @@ int seq_puts(struct seq_file *m, const char *s);
42int seq_printf(struct seq_file *, const char *, ...) 41int seq_printf(struct seq_file *, const char *, ...)
43 __attribute__ ((format (printf,2,3))); 42 __attribute__ ((format (printf,2,3)));
44 43
45int seq_path(struct seq_file *, struct vfsmount *, struct dentry *, char *); 44int seq_path(struct seq_file *, struct path *, char *);
46 45
47int single_open(struct file *, int (*)(struct seq_file *, void *), void *); 46int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
48int single_release(struct inode *, struct file *); 47int single_release(struct inode *, struct file *);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 8d246c3b340f..6c7ba1a63d23 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1996,7 +1996,7 @@ int show_numa_map(struct seq_file *m, void *v)
1996 1996
1997 if (file) { 1997 if (file) {
1998 seq_printf(m, " file="); 1998 seq_printf(m, " file=");
1999 seq_path(m, file->f_path.mnt, file->f_path.dentry, "\n\t= "); 1999 seq_path(m, &file->f_path, "\n\t= ");
2000 } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) { 2000 } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
2001 seq_printf(m, " heap"); 2001 seq_printf(m, " heap");
2002 } else if (vma->vm_start <= mm->start_stack && 2002 } else if (vma->vm_start <= mm->start_stack &&
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 02ccab5ad9d9..2da149cfc9ac 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1394,7 +1394,7 @@ static int swap_show(struct seq_file *swap, void *v)
1394 } 1394 }
1395 1395
1396 file = ptr->swap_file; 1396 file = ptr->swap_file;
1397 len = seq_path(swap, file->f_path.mnt, file->f_path.dentry, " \t\n\\"); 1397 len = seq_path(swap, &file->f_path, " \t\n\\");
1398 seq_printf(swap, "%*s%s\t%u\t%u\t%d\n", 1398 seq_printf(swap, "%*s%s\t%u\t%u\t%d\n",
1399 len < 40 ? 40 - len : 1, " ", 1399 len < 40 ? 40 - len : 1, " ",
1400 S_ISBLK(file->f_path.dentry->d_inode->i_mode) ? 1400 S_ISBLK(file->f_path.dentry->d_inode->i_mode) ?