]> git.hungrycats.org Git - linux/commitdiff
[PATCH] (9/9) more ->get_sb() stuff v2.5.4-pre2
authorAlexander Viro <viro@math.psu.edu>
Wed, 6 Feb 2002 14:34:55 +0000 (06:34 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Wed, 6 Feb 2002 14:34:55 +0000 (06:34 -0800)
More ->get_sb() patches: nfs.  It still acts as nodev - what we want to
(and can) do now is to give it enough smarts to recognize that same tree
might be already mounted.

We are almost done with nodev filesystems by now.

fs/nfs/inode.c
include/linux/nfs_fs.h

index b72b6e662e77361c7a61ebbe861123dcca5fd7a0..28d57bf19badc65edc39a49bd4a67f432f897ef0 100644 (file)
@@ -245,8 +245,7 @@ nfs_get_root(struct super_block *sb, struct nfs_fh *rootfh)
  * and the root file handle obtained from the server's mount
  * daemon. We stash these away in the private superblock fields.
  */
-struct super_block *
-nfs_read_super(struct super_block *sb, void *raw_data, int silent)
+int nfs_fill_super(struct super_block *sb, void *raw_data, int silent)
 {
        struct nfs_mount_data   *data = (struct nfs_mount_data *) raw_data;
        struct nfs_server       *server;
@@ -469,7 +468,7 @@ nfs_read_super(struct super_block *sb, void *raw_data, int silent)
        /* Check whether to start the lockd process */
        if (!(server->flags & NFS_MOUNT_NONLM))
                lockd_up();
-       return sb;
+       return 0;
 
        /* Yargs. It didn't work out. */
  failure_kill_reqlist:
@@ -508,7 +507,7 @@ out_miss_args:
        printk("nfs_read_super: missing data argument\n");
 
 out_fail:
-       return NULL;
+       return -EINVAL;
 }
 
 static int
@@ -1139,7 +1138,25 @@ __nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
 /*
  * File system information
  */
-static DECLARE_FSTYPE(nfs_fs_type, "nfs", nfs_read_super, FS_ODD_RENAME);
+
+/*
+ *  Right now we are using get_sb_nodev, but we ought to switch to
+ *  get_anon_super() with appropriate comparison function.  The only
+ *  question being, when two NFS mounts are the same?  Identical IP
+ *  of server + identical root fhandle?  Trond?
+ */
+static struct super_block *nfs_get_sb(struct file_system_type *fs_type,
+       int flags, char *dev_name, void *data)
+{
+       return get_sb_nodev(fs_type, flags, data, nfs_fill_super);
+}
+
+static struct file_system_type nfs_fs_type = {
+       owner:          THIS_MODULE,
+       name:           "nfs",
+       get_sb:         nfs_get_sb,
+       fs_flags:       FS_ODD_RENAME,
+};
 
 extern int nfs_init_nfspagecache(void);
 extern void nfs_destroy_nfspagecache(void);
index eda80eca898e7654acec47b530e5bd98b2aade3e..e95a085a2fddecc0612e4d24085ed0b2f332e8ba 100644 (file)
@@ -226,7 +226,6 @@ unsigned long page_index(struct page *page)
 /*
  * linux/fs/nfs/inode.c
  */
-extern struct super_block *nfs_read_super(struct super_block *, void *, int);
 extern void nfs_zap_caches(struct inode *);
 extern int nfs_inode_is_stale(struct inode *, struct nfs_fh *,
                                struct nfs_fattr *);