diff options
Diffstat (limited to 'fs/namespace.c')
| -rw-r--r-- | fs/namespace.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 39c81a8d6316..71e75bcf4d28 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
| @@ -399,6 +399,44 @@ struct seq_operations mounts_op = { | |||
| 399 | .show = show_vfsmnt | 399 | .show = show_vfsmnt |
| 400 | }; | 400 | }; |
| 401 | 401 | ||
| 402 | static int show_vfsstat(struct seq_file *m, void *v) | ||
| 403 | { | ||
| 404 | struct vfsmount *mnt = v; | ||
| 405 | int err = 0; | ||
| 406 | |||
| 407 | /* device */ | ||
| 408 | if (mnt->mnt_devname) { | ||
| 409 | seq_puts(m, "device "); | ||
| 410 | mangle(m, mnt->mnt_devname); | ||
| 411 | } else | ||
| 412 | seq_puts(m, "no device"); | ||
| 413 | |||
| 414 | /* mount point */ | ||
| 415 | seq_puts(m, " mounted on "); | ||
| 416 | seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); | ||
| 417 | seq_putc(m, ' '); | ||
| 418 | |||
| 419 | /* file system type */ | ||
| 420 | seq_puts(m, "with fstype "); | ||
| 421 | mangle(m, mnt->mnt_sb->s_type->name); | ||
| 422 | |||
| 423 | /* optional statistics */ | ||
| 424 | if (mnt->mnt_sb->s_op->show_stats) { | ||
| 425 | seq_putc(m, ' '); | ||
| 426 | err = mnt->mnt_sb->s_op->show_stats(m, mnt); | ||
| 427 | } | ||
| 428 | |||
| 429 | seq_putc(m, '\n'); | ||
| 430 | return err; | ||
| 431 | } | ||
| 432 | |||
| 433 | struct seq_operations mountstats_op = { | ||
| 434 | .start = m_start, | ||
| 435 | .next = m_next, | ||
| 436 | .stop = m_stop, | ||
| 437 | .show = show_vfsstat, | ||
| 438 | }; | ||
| 439 | |||
| 402 | /** | 440 | /** |
| 403 | * may_umount_tree - check if a mount tree is busy | 441 | * may_umount_tree - check if a mount tree is busy |
| 404 | * @mnt: root of mount tree | 442 | * @mnt: root of mount tree |
