Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jan Blunck and committed by
Linus Torvalds
c32c2f63 e83aece3

+16 -17
+1 -2
drivers/md/md.c
··· 5197 5197 chunk_kb ? "KB" : "B"); 5198 5198 if (bitmap->file) { 5199 5199 seq_printf(seq, ", file: "); 5200 - seq_path(seq, bitmap->file->f_path.mnt, 5201 - bitmap->file->f_path.dentry," \t\n"); 5200 + seq_path(seq, &bitmap->file->f_path, " \t\n"); 5202 5201 } 5203 5202 5204 5203 seq_printf(seq, "\n");
+4 -2
fs/namespace.c
··· 408 408 { 0, NULL } 409 409 }; 410 410 struct proc_fs_info *fs_infop; 411 + struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 411 412 412 413 mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 413 414 seq_putc(m, ' '); 414 - seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); 415 + seq_path(m, &mnt_path, " \t\n\\"); 415 416 seq_putc(m, ' '); 416 417 mangle(m, mnt->mnt_sb->s_type->name); 417 418 if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) { ··· 444 443 static int show_vfsstat(struct seq_file *m, void *v) 445 444 { 446 445 struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); 446 + struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 447 447 int err = 0; 448 448 449 449 /* device */ ··· 456 454 457 455 /* mount point */ 458 456 seq_puts(m, " mounted on "); 459 - seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); 457 + seq_path(m, &mnt_path, " \t\n\\"); 460 458 seq_putc(m, ' '); 461 459 462 460 /* file system type */
+2 -2
fs/nfsd/export.c
··· 203 203 if (test_bit(CACHE_VALID, &h->flags) && 204 204 !test_bit(CACHE_NEGATIVE, &h->flags)) { 205 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 208 seq_printf(m, "\n"); 209 209 return 0; ··· 649 649 return 0; 650 650 } 651 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 653 seq_putc(m, '\t'); 654 654 seq_escape(m, exp->ex_client->name, " \t\n\\"); 655 655 seq_putc(m, '(');
+1 -1
fs/proc/nommu.c
··· 67 67 if (len < 1) 68 68 len = 1; 69 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 73 seq_putc(m, '\n');
+1 -1
fs/proc/task_mmu.c
··· 271 271 */ 272 272 if (file) { 273 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 275 } else { 276 276 const char *name = arch_vma_name(vma); 277 277 if (!name) {
+3 -4
fs/seq_file.c
··· 342 342 } 343 343 EXPORT_SYMBOL(seq_printf); 344 344 345 - int seq_path(struct seq_file *m, 346 - struct vfsmount *mnt, struct dentry *dentry, 347 - char *esc) 345 + int seq_path(struct seq_file *m, struct path *path, char *esc) 348 346 { 349 347 if (m->count < m->size) { 350 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 351 if (!IS_ERR(p)) { 353 352 while (s <= p) { 354 353 char c = *p++;
+2 -3
include/linux/seq_file.h
··· 8 8 9 9 struct seq_operations; 10 10 struct file; 11 - struct vfsmount; 12 - struct dentry; 11 + struct path; 13 12 struct inode; 14 13 15 14 struct seq_file { ··· 41 42 int seq_printf(struct seq_file *, const char *, ...) 42 43 __attribute__ ((format (printf,2,3))); 43 44 44 - int seq_path(struct seq_file *, struct vfsmount *, struct dentry *, char *); 45 + int seq_path(struct seq_file *, struct path *, char *); 45 46 46 47 int single_open(struct file *, int (*)(struct seq_file *, void *), void *); 47 48 int single_release(struct inode *, struct file *);
+1 -1
mm/mempolicy.c
··· 1996 1996 1997 1997 if (file) { 1998 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 2000 } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) { 2001 2001 seq_printf(m, " heap"); 2002 2002 } else if (vma->vm_start <= mm->start_stack &&
+1 -1
mm/swapfile.c
··· 1394 1394 } 1395 1395 1396 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 1398 seq_printf(swap, "%*s%s\t%u\t%u\t%d\n", 1399 1399 len < 40 ? 40 - len : 1, " ", 1400 1400 S_ISBLK(file->f_path.dentry->d_inode->i_mode) ?