aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d90209e79587..84d0b7e0dd67 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1592,8 +1592,6 @@ static int _nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh,
1592 dprintk("NFS call lookupfh %s\n", name->name); 1592 dprintk("NFS call lookupfh %s\n", name->name);
1593 status = rpc_call_sync(server->client, &msg, 0); 1593 status = rpc_call_sync(server->client, &msg, 0);
1594 dprintk("NFS reply lookupfh: %d\n", status); 1594 dprintk("NFS reply lookupfh: %d\n", status);
1595 if (status == -NFS4ERR_MOVED)
1596 status = -EREMOTE;
1597 return status; 1595 return status;
1598} 1596}
1599 1597
@@ -1604,10 +1602,13 @@ static int nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh,
1604 struct nfs4_exception exception = { }; 1602 struct nfs4_exception exception = { };
1605 int err; 1603 int err;
1606 do { 1604 do {
1607 err = nfs4_handle_exception(server, 1605 err = _nfs4_proc_lookupfh(server, dirfh, name, fhandle, fattr);
1608 _nfs4_proc_lookupfh(server, dirfh, name, 1606 /* FIXME: !!!! */
1609 fhandle, fattr), 1607 if (err == -NFS4ERR_MOVED) {
1610 &exception); 1608 err = -EREMOTE;
1609 break;
1610 }
1611 err = nfs4_handle_exception(server, err, &exception);
1611 } while (exception.retry); 1612 } while (exception.retry);
1612 return err; 1613 return err;
1613} 1614}
@@ -1615,28 +1616,10 @@ static int nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh,
1615static int _nfs4_proc_lookup(struct inode *dir, struct qstr *name, 1616static int _nfs4_proc_lookup(struct inode *dir, struct qstr *name,
1616 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 1617 struct nfs_fh *fhandle, struct nfs_fattr *fattr)
1617{ 1618{
1618 int status; 1619 int status;
1619 struct nfs_server *server = NFS_SERVER(dir);
1620 struct nfs4_lookup_arg args = {
1621 .bitmask = server->attr_bitmask,
1622 .dir_fh = NFS_FH(dir),
1623 .name = name,
1624 };
1625 struct nfs4_lookup_res res = {
1626 .server = server,
1627 .fattr = fattr,
1628 .fh = fhandle,
1629 };
1630 struct rpc_message msg = {
1631 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOOKUP],
1632 .rpc_argp = &args,
1633 .rpc_resp = &res,
1634 };
1635
1636 nfs_fattr_init(fattr);
1637 1620
1638 dprintk("NFS call lookup %s\n", name->name); 1621 dprintk("NFS call lookup %s\n", name->name);
1639 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 1622 status = _nfs4_proc_lookupfh(NFS_SERVER(dir), NFS_FH(dir), name, fhandle, fattr);
1640 if (status == -NFS4ERR_MOVED) 1623 if (status == -NFS4ERR_MOVED)
1641 status = nfs4_get_referral(dir, name, fattr, fhandle); 1624 status = nfs4_get_referral(dir, name, fattr, fhandle);
1642 dprintk("NFS reply lookup: %d\n", status); 1625 dprintk("NFS reply lookup: %d\n", status);