aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-01-13 02:28:11 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 18:35:06 -0500
commitc228fd3aeef55637354167faead74c579d5da28b (patch)
tree44abf437f19a3f182e00a42de6cf853fef8cc0f6 /fs/nfs
parentfaebf4e2bb0efad9dda396ea13d5c6ad15d7d7fb (diff)
NFSv4: Cleanups for fs_locations code.
Start long arduous project... What the hell is struct dentry = {}; all about? Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/internal.h4
-rw-r--r--fs/nfs/nfs4_fs.h2
-rw-r--r--fs/nfs/nfs4namespace.c3
-rw-r--r--fs/nfs/nfs4proc.c11
4 files changed, 7 insertions, 13 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index a28f6ce2e131..6610f2b02077 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -107,10 +107,6 @@ extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
107/* nfs4proc.c */ 107/* nfs4proc.c */
108#ifdef CONFIG_NFS_V4 108#ifdef CONFIG_NFS_V4
109extern struct rpc_procinfo nfs4_procedures[]; 109extern struct rpc_procinfo nfs4_procedures[];
110
111extern int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry,
112 struct nfs4_fs_locations *fs_locations,
113 struct page *page);
114#endif 110#endif
115 111
116/* dir.c */ 112/* dir.c */
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index c26cd978c7cc..f2c88ffe41e0 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -169,7 +169,7 @@ extern int nfs4_do_close(struct inode *inode, struct nfs4_state *state);
169extern struct dentry *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *); 169extern struct dentry *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *);
170extern int nfs4_open_revalidate(struct inode *, struct dentry *, int, struct nameidata *); 170extern int nfs4_open_revalidate(struct inode *, struct dentry *, int, struct nameidata *);
171extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); 171extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
172extern int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry, 172extern int nfs4_proc_fs_locations(struct inode *dir, struct qstr *name,
173 struct nfs4_fs_locations *fs_locations, struct page *page); 173 struct nfs4_fs_locations *fs_locations, struct page *page);
174 174
175extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops; 175extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops;
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index b872779d7cd5..03a9972fa706 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -16,6 +16,7 @@
16#include <linux/vfs.h> 16#include <linux/vfs.h>
17#include <linux/inet.h> 17#include <linux/inet.h>
18#include "internal.h" 18#include "internal.h"
19#include "nfs4_fs.h"
19 20
20#define NFSDBG_FACILITY NFSDBG_VFS 21#define NFSDBG_FACILITY NFSDBG_VFS
21 22
@@ -242,7 +243,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr
242 dprintk("%s: getting locations for %s/%s\n", 243 dprintk("%s: getting locations for %s/%s\n",
243 __FUNCTION__, parent->d_name.name, dentry->d_name.name); 244 __FUNCTION__, parent->d_name.name, dentry->d_name.name);
244 245
245 err = nfs4_proc_fs_locations(parent->d_inode, dentry, fs_locations, page); 246 err = nfs4_proc_fs_locations(parent->d_inode, &dentry->d_name, fs_locations, page);
246 dput(parent); 247 dput(parent);
247 if (err != 0 || 248 if (err != 0 ||
248 fs_locations->nlocations <= 0 || 249 fs_locations->nlocations <= 0 ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b3fd29baadc3..665859214fa2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1424,7 +1424,6 @@ static int nfs4_get_referral(struct inode *dir, struct qstr *name, struct nfs_fa
1424 int status = -ENOMEM; 1424 int status = -ENOMEM;
1425 struct page *page = NULL; 1425 struct page *page = NULL;
1426 struct nfs4_fs_locations *locations = NULL; 1426 struct nfs4_fs_locations *locations = NULL;
1427 struct dentry dentry = {};
1428 1427
1429 page = alloc_page(GFP_KERNEL); 1428 page = alloc_page(GFP_KERNEL);
1430 if (page == NULL) 1429 if (page == NULL)
@@ -1433,9 +1432,7 @@ static int nfs4_get_referral(struct inode *dir, struct qstr *name, struct nfs_fa
1433 if (locations == NULL) 1432 if (locations == NULL)
1434 goto out; 1433 goto out;
1435 1434
1436 dentry.d_name.name = name->name; 1435 status = nfs4_proc_fs_locations(dir, name, locations, page);
1437 dentry.d_name.len = name->len;
1438 status = nfs4_proc_fs_locations(dir, &dentry, locations, page);
1439 if (status != 0) 1436 if (status != 0)
1440 goto out; 1437 goto out;
1441 /* Make sure server returned a different fsid for the referral */ 1438 /* Make sure server returned a different fsid for the referral */
@@ -3585,7 +3582,7 @@ ssize_t nfs4_listxattr(struct dentry *dentry, char *buf, size_t buflen)
3585 return len; 3582 return len;
3586} 3583}
3587 3584
3588int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry, 3585int nfs4_proc_fs_locations(struct inode *dir, struct qstr *name,
3589 struct nfs4_fs_locations *fs_locations, struct page *page) 3586 struct nfs4_fs_locations *fs_locations, struct page *page)
3590{ 3587{
3591 struct nfs_server *server = NFS_SERVER(dir); 3588 struct nfs_server *server = NFS_SERVER(dir);
@@ -3595,7 +3592,7 @@ int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry,
3595 }; 3592 };
3596 struct nfs4_fs_locations_arg args = { 3593 struct nfs4_fs_locations_arg args = {
3597 .dir_fh = NFS_FH(dir), 3594 .dir_fh = NFS_FH(dir),
3598 .name = &dentry->d_name, 3595 .name = name,
3599 .page = page, 3596 .page = page,
3600 .bitmask = bitmask, 3597 .bitmask = bitmask,
3601 }; 3598 };
@@ -3607,7 +3604,7 @@ int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry,
3607 int status; 3604 int status;
3608 3605
3609 dprintk("%s: start\n", __FUNCTION__); 3606 dprintk("%s: start\n", __FUNCTION__);
3610 fs_locations->fattr.valid = 0; 3607 nfs_fattr_init(&fs_locations->fattr);
3611 fs_locations->server = server; 3608 fs_locations->server = server;
3612 fs_locations->nlocations = 0; 3609 fs_locations->nlocations = 0;
3613 status = rpc_call_sync(server->client, &msg, 0); 3610 status = rpc_call_sync(server->client, &msg, 0);