aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Viro <viro@math.psu.edu>2002-02-06 06:34:55 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-06 06:34:55 -0800
commit0fcf90eb6eae2288605e8fd28a974efec465a05c (patch)
tree943199835fd98a8c5e5a5b45e09957eedd3df9ce
parent0d265379403866ec28084ba04c71aaaef15559a9 (diff)
downloadhistory-0fcf90eb6eae2288605e8fd28a974efec465a05c.tar.gz
[PATCH] (9/9) more ->get_sb() stuffv2.5.4-pre2
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.
-rw-r--r--fs/nfs/inode.c27
-rw-r--r--include/linux/nfs_fs.h1
2 files changed, 22 insertions, 6 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index b72b6e662e773..28d57bf19badc 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -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);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index eda80eca898e7..e95a085a2fdde 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -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 *);