Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dd2cc4dff3b08ab54c4c177a080046bcc84ac41d
Commit:     dd2cc4dff3b08ab54c4c177a080046bcc84ac41d
Parent:     d1875dbaa58e4894f7d9321d1c280fb23ca9f9e5
Author:     Miklos Szeredi <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:21:43 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:40 2008 -0800

    mount options: fix hostfs
    
    Add the "host path" option to /proc/mounts for UML hostfs filesystems.
    
    The mount source (mnt_devname) should really be used for this, but not
    easy to change now in a backward compatible way.
    
    Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]>
    Cc: Jeff Dike <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/hostfs/hostfs_kern.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 2b9b357..d0549cb 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -11,6 +11,7 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/statfs.h>
+#include <linux/seq_file.h>
 #include "hostfs.h"
 #include "init.h"
 #include "kern.h"
@@ -322,12 +323,25 @@ static void hostfs_destroy_inode(struct inode *inode)
        kfree(HOSTFS_I(inode));
 }
 
+static int hostfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
+{
+       struct inode *root = vfs->mnt_sb->s_root->d_inode;
+       const char *root_path = HOSTFS_I(root)->host_filename;
+       size_t offset = strlen(root_ino) + 1;
+
+       if (strlen(root_path) > offset)
+               seq_printf(seq, ",%s", root_path + offset);
+
+       return 0;
+}
+
 static const struct super_operations hostfs_sbops = {
        .alloc_inode    = hostfs_alloc_inode,
        .drop_inode     = generic_delete_inode,
        .delete_inode   = hostfs_delete_inode,
        .destroy_inode  = hostfs_destroy_inode,
        .statfs         = hostfs_statfs,
+       .show_options   = hostfs_show_options,
 };
 
 int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to