aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/getroot.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-07-16 16:39:16 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-17 13:33:51 -0400
commita38a9eac75f0d09f1941a6e85e291c8e96bc8375 (patch)
treeb94c8a48f3d3c3903232729ea4c834cbb0eb315a /fs/nfs/getroot.c
parentce4ef7c0a8a0594d7b9d088d73866a4389402a7e (diff)
NFS: Move the v4 getroot code to nfs4getroot.c
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/getroot.c')
-rw-r--r--fs/nfs/getroot.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index a67990f90bd7..4654ced096a6 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -23,21 +23,15 @@
23#include <linux/sunrpc/stats.h> 23#include <linux/sunrpc/stats.h>
24#include <linux/nfs_fs.h> 24#include <linux/nfs_fs.h>
25#include <linux/nfs_mount.h> 25#include <linux/nfs_mount.h>
26#include <linux/nfs4_mount.h>
27#include <linux/lockd/bind.h> 26#include <linux/lockd/bind.h>
28#include <linux/seq_file.h> 27#include <linux/seq_file.h>
29#include <linux/mount.h> 28#include <linux/mount.h>
30#include <linux/nfs_idmap.h>
31#include <linux/vfs.h> 29#include <linux/vfs.h>
32#include <linux/namei.h> 30#include <linux/namei.h>
33#include <linux/security.h> 31#include <linux/security.h>
34 32
35#include <asm/uaccess.h> 33#include <asm/uaccess.h>
36 34
37#include "nfs4_fs.h"
38#include "delegation.h"
39#include "internal.h"
40
41#define NFSDBG_FACILITY NFSDBG_CLIENT 35#define NFSDBG_FACILITY NFSDBG_CLIENT
42 36
43/* 37/*
@@ -135,47 +129,3 @@ out:
135 nfs_free_fattr(fsinfo.fattr); 129 nfs_free_fattr(fsinfo.fattr);
136 return ret; 130 return ret;
137} 131}
138
139#ifdef CONFIG_NFS_V4
140
141int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh)
142{
143 struct nfs_fsinfo fsinfo;
144 int ret = -ENOMEM;
145
146 dprintk("--> nfs4_get_rootfh()\n");
147
148 fsinfo.fattr = nfs_alloc_fattr();
149 if (fsinfo.fattr == NULL)
150 goto out;
151
152 /* Start by getting the root filehandle from the server */
153 ret = nfs4_proc_get_rootfh(server, mntfh, &fsinfo);
154 if (ret < 0) {
155 dprintk("nfs4_get_rootfh: getroot error = %d\n", -ret);
156 goto out;
157 }
158
159 if (!(fsinfo.fattr->valid & NFS_ATTR_FATTR_TYPE)
160 || !S_ISDIR(fsinfo.fattr->mode)) {
161 printk(KERN_ERR "nfs4_get_rootfh:"
162 " getroot encountered non-directory\n");
163 ret = -ENOTDIR;
164 goto out;
165 }
166
167 if (fsinfo.fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) {
168 printk(KERN_ERR "nfs4_get_rootfh:"
169 " getroot obtained referral\n");
170 ret = -EREMOTE;
171 goto out;
172 }
173
174 memcpy(&server->fsid, &fsinfo.fattr->fsid, sizeof(server->fsid));
175out:
176 nfs_free_fattr(fsinfo.fattr);
177 dprintk("<-- nfs4_get_rootfh() = %d\n", ret);
178 return ret;
179}
180
181#endif /* CONFIG_NFS_V4 */