]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/hostfs/hostfs_kern.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / fs / hostfs / hostfs_kern.c
index 2b9b35733aacd00be2673995887521263ae66a39..7f34f4385de00dbcca17d9d3bf7c45bd0aedc1d7 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/statfs.h>
+#include <linux/seq_file.h>
+#include <linux/mount.h>
 #include "hostfs.h"
 #include "init.h"
 #include "kern.h"
@@ -18,7 +20,7 @@
 struct hostfs_inode_info {
        char *host_filename;
        int fd;
-       int mode;
+       fmode_t mode;
        struct inode vfs_inode;
 };
 
@@ -322,12 +324,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)
@@ -358,7 +373,8 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
 int hostfs_file_open(struct inode *ino, struct file *file)
 {
        char *name;
-       int mode = 0, r = 0, w = 0, fd;
+       fmode_t mode = 0;
+       int r = 0, w = 0, fd;
 
        mode = file->f_mode & (FMODE_READ | FMODE_WRITE);
        if ((mode & HOSTFS_I(ino)->mode) == mode)
@@ -807,7 +823,7 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from,
        return err;
 }
 
-int hostfs_permission(struct inode *ino, int desired, struct nameidata *nd)
+int hostfs_permission(struct inode *ino, int desired)
 {
        char *name;
        int r = 0, w = 0, x = 0, err;