提交 7c513058 编写于 作者: B Bryan Schumaker 提交者: Trond Myklebust

NFS: lookup supports alternate client

A later patch will need to perform a lookup using an
alternate client with a different security flavor.
This patch adds support for doing that on NFS v4.
Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 e73b83f2
...@@ -1068,7 +1068,7 @@ static int nfs_lookup_revalidate(struct dentry *dentry, struct nameidata *nd) ...@@ -1068,7 +1068,7 @@ static int nfs_lookup_revalidate(struct dentry *dentry, struct nameidata *nd)
if (fhandle == NULL || fattr == NULL) if (fhandle == NULL || fattr == NULL)
goto out_error; goto out_error;
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); error = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, &dentry->d_name, fhandle, fattr);
if (error) if (error)
goto out_bad; goto out_bad;
if (nfs_compare_fh(NFS_FH(inode), fhandle)) if (nfs_compare_fh(NFS_FH(inode), fhandle))
...@@ -1224,7 +1224,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru ...@@ -1224,7 +1224,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
parent = dentry->d_parent; parent = dentry->d_parent;
/* Protect against concurrent sillydeletes */ /* Protect against concurrent sillydeletes */
nfs_block_sillyrename(parent); nfs_block_sillyrename(parent);
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); error = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, &dentry->d_name, fhandle, fattr);
if (error == -ENOENT) if (error == -ENOENT)
goto no_entry; goto no_entry;
if (error < 0) { if (error < 0) {
...@@ -1562,7 +1562,7 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle, ...@@ -1562,7 +1562,7 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
if (dentry->d_inode) if (dentry->d_inode)
goto out; goto out;
if (fhandle->size == 0) { if (fhandle->size == 0) {
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); error = NFS_PROTO(dir)->lookup(NFS_SERVER(dir)->client, dir, &dentry->d_name, fhandle, fattr);
if (error) if (error)
goto out_error; goto out_error;
} }
......
...@@ -296,12 +296,14 @@ extern int nfs4_init_client(struct nfs_client *clp, ...@@ -296,12 +296,14 @@ extern int nfs4_init_client(struct nfs_client *clp,
rpc_authflavor_t authflavour, rpc_authflavor_t authflavour,
int noresvport); int noresvport);
extern void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data); extern void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data);
extern int _nfs4_call_sync(struct nfs_server *server, extern int _nfs4_call_sync(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
int cache_reply); int cache_reply);
extern int _nfs4_call_sync_session(struct nfs_server *server, extern int _nfs4_call_sync_session(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
......
...@@ -153,7 +153,7 @@ struct vfsmount *nfs_d_automount(struct path *path) ...@@ -153,7 +153,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
/* Look it up again to get its attributes */ /* Look it up again to get its attributes */
parent = dget_parent(path->dentry); parent = dget_parent(path->dentry);
err = server->nfs_client->rpc_ops->lookup(parent->d_inode, err = server->nfs_client->rpc_ops->lookup(server->client, parent->d_inode,
&path->dentry->d_name, &path->dentry->d_name,
fh, fattr); fh, fattr);
dput(parent); dput(parent);
......
...@@ -141,7 +141,7 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, ...@@ -141,7 +141,7 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
} }
static int static int
nfs3_proc_lookup(struct inode *dir, struct qstr *name, nfs3_proc_lookup(struct rpc_clnt *clnt, struct inode *dir, struct qstr *name,
struct nfs_fh *fhandle, struct nfs_fattr *fattr) struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{ {
struct nfs3_diropargs arg = { struct nfs3_diropargs arg = {
......
...@@ -57,7 +57,8 @@ enum nfs4_session_state { ...@@ -57,7 +57,8 @@ enum nfs4_session_state {
struct nfs4_minor_version_ops { struct nfs4_minor_version_ops {
u32 minor_version; u32 minor_version;
int (*call_sync)(struct nfs_server *server, int (*call_sync)(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
......
...@@ -71,7 +71,9 @@ static int _nfs4_proc_open(struct nfs4_opendata *data); ...@@ -71,7 +71,9 @@ static int _nfs4_proc_open(struct nfs4_opendata *data);
static int _nfs4_recover_proc_open(struct nfs4_opendata *data); static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *, struct nfs4_state *); static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *, struct nfs4_state *);
static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr); static int _nfs4_proc_lookup(struct rpc_clnt *client, struct inode *dir,
const struct qstr *name, struct nfs_fh *fhandle,
struct nfs_fattr *fattr);
static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr); static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr);
static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
struct nfs_fattr *fattr, struct iattr *sattr, struct nfs_fattr *fattr, struct iattr *sattr,
...@@ -657,7 +659,8 @@ struct rpc_call_ops nfs41_call_priv_sync_ops = { ...@@ -657,7 +659,8 @@ struct rpc_call_ops nfs41_call_priv_sync_ops = {
.rpc_call_done = nfs41_call_sync_done, .rpc_call_done = nfs41_call_sync_done,
}; };
static int nfs4_call_sync_sequence(struct nfs_server *server, static int nfs4_call_sync_sequence(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
...@@ -673,7 +676,7 @@ static int nfs4_call_sync_sequence(struct nfs_server *server, ...@@ -673,7 +676,7 @@ static int nfs4_call_sync_sequence(struct nfs_server *server,
.cache_reply = cache_reply, .cache_reply = cache_reply,
}; };
struct rpc_task_setup task_setup = { struct rpc_task_setup task_setup = {
.rpc_client = server->client, .rpc_client = clnt,
.rpc_message = msg, .rpc_message = msg,
.callback_ops = &nfs41_call_sync_ops, .callback_ops = &nfs41_call_sync_ops,
.callback_data = &data .callback_data = &data
...@@ -692,13 +695,14 @@ static int nfs4_call_sync_sequence(struct nfs_server *server, ...@@ -692,13 +695,14 @@ static int nfs4_call_sync_sequence(struct nfs_server *server,
return ret; return ret;
} }
int _nfs4_call_sync_session(struct nfs_server *server, int _nfs4_call_sync_session(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
int cache_reply) int cache_reply)
{ {
return nfs4_call_sync_sequence(server, msg, args, res, cache_reply, 0); return nfs4_call_sync_sequence(clnt, server, msg, args, res, cache_reply, 0);
} }
#else #else
...@@ -709,25 +713,27 @@ static int nfs4_sequence_done(struct rpc_task *task, ...@@ -709,25 +713,27 @@ static int nfs4_sequence_done(struct rpc_task *task,
} }
#endif /* CONFIG_NFS_V4_1 */ #endif /* CONFIG_NFS_V4_1 */
int _nfs4_call_sync(struct nfs_server *server, int _nfs4_call_sync(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
int cache_reply) int cache_reply)
{ {
args->sa_session = res->sr_session = NULL; args->sa_session = res->sr_session = NULL;
return rpc_call_sync(server->client, msg, 0); return rpc_call_sync(clnt, msg, 0);
} }
static inline static inline
int nfs4_call_sync(struct nfs_server *server, int nfs4_call_sync(struct rpc_clnt *clnt,
struct nfs_server *server,
struct rpc_message *msg, struct rpc_message *msg,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
int cache_reply) int cache_reply)
{ {
return server->nfs_client->cl_mvops->call_sync(server, msg, args, return server->nfs_client->cl_mvops->call_sync(clnt, server, msg,
res, cache_reply); args, res, cache_reply);
} }
static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo) static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
...@@ -1838,7 +1844,7 @@ static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, ...@@ -1838,7 +1844,7 @@ static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
} else } else
memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid)); memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid));
status = nfs4_call_sync(server, &msg, &arg.seq_args, &res.seq_res, 1); status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
if (status == 0 && state != NULL) if (status == 0 && state != NULL)
renew_lease(server, timestamp); renew_lease(server, timestamp);
return status; return status;
...@@ -2097,7 +2103,7 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f ...@@ -2097,7 +2103,7 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
}; };
int status; int status;
status = nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
if (status == 0) { if (status == 0) {
memcpy(server->attr_bitmask, res.attr_bitmask, sizeof(server->attr_bitmask)); memcpy(server->attr_bitmask, res.attr_bitmask, sizeof(server->attr_bitmask));
server->caps &= ~(NFS_CAP_ACLS|NFS_CAP_HARDLINKS| server->caps &= ~(NFS_CAP_ACLS|NFS_CAP_HARDLINKS|
...@@ -2167,7 +2173,7 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -2167,7 +2173,7 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
}; };
nfs_fattr_init(info->fattr); nfs_fattr_init(info->fattr);
return nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
} }
static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
...@@ -2256,7 +2262,7 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -2256,7 +2262,7 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
}; };
nfs_fattr_init(fattr); nfs_fattr_init(fattr);
return nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
} }
static int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr) static int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr)
...@@ -2316,9 +2322,9 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, ...@@ -2316,9 +2322,9 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
return status; return status;
} }
static int _nfs4_proc_lookupfh(struct nfs_server *server, const struct nfs_fh *dirfh, static int _nfs4_proc_lookupfh(struct rpc_clnt *clnt, struct nfs_server *server,
const struct qstr *name, struct nfs_fh *fhandle, const struct nfs_fh *dirfh, const struct qstr *name,
struct nfs_fattr *fattr) struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{ {
int status; int status;
struct nfs4_lookup_arg args = { struct nfs4_lookup_arg args = {
...@@ -2340,7 +2346,7 @@ static int _nfs4_proc_lookupfh(struct nfs_server *server, const struct nfs_fh *d ...@@ -2340,7 +2346,7 @@ static int _nfs4_proc_lookupfh(struct nfs_server *server, const struct nfs_fh *d
nfs_fattr_init(fattr); nfs_fattr_init(fattr);
dprintk("NFS call lookupfh %s\n", name->name); dprintk("NFS call lookupfh %s\n", name->name);
status = nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); status = nfs4_call_sync(clnt, server, &msg, &args.seq_args, &res.seq_res, 0);
dprintk("NFS reply lookupfh: %d\n", status); dprintk("NFS reply lookupfh: %d\n", status);
return status; return status;
} }
...@@ -2352,7 +2358,7 @@ static int nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh, ...@@ -2352,7 +2358,7 @@ static int nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh,
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do { do {
err = _nfs4_proc_lookupfh(server, dirfh, name, fhandle, fattr); err = _nfs4_proc_lookupfh(server->client, server, dirfh, name, fhandle, fattr);
/* FIXME: !!!! */ /* FIXME: !!!! */
if (err == -NFS4ERR_MOVED) { if (err == -NFS4ERR_MOVED) {
err = -EREMOTE; err = -EREMOTE;
...@@ -2363,26 +2369,28 @@ static int nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh, ...@@ -2363,26 +2369,28 @@ static int nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh,
return err; return err;
} }
static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir,
struct nfs_fh *fhandle, struct nfs_fattr *fattr) const struct qstr *name, struct nfs_fh *fhandle,
struct nfs_fattr *fattr)
{ {
int status; int status;
dprintk("NFS call lookup %s\n", name->name); dprintk("NFS call lookup %s\n", name->name);
status = _nfs4_proc_lookupfh(NFS_SERVER(dir), NFS_FH(dir), name, fhandle, fattr); status = _nfs4_proc_lookupfh(clnt, NFS_SERVER(dir), NFS_FH(dir), name, fhandle, fattr);
if (status == -NFS4ERR_MOVED) if (status == -NFS4ERR_MOVED)
status = nfs4_get_referral(dir, name, fattr, fhandle); status = nfs4_get_referral(dir, name, fattr, fhandle);
dprintk("NFS reply lookup: %d\n", status); dprintk("NFS reply lookup: %d\n", status);
return status; return status;
} }
static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr) static int nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir, struct qstr *name,
struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{ {
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = nfs4_handle_exception(NFS_SERVER(dir),
_nfs4_proc_lookup(dir, name, fhandle, fattr), _nfs4_proc_lookup(clnt, dir, name, fhandle, fattr),
&exception); &exception);
} while (exception.retry); } while (exception.retry);
return err; return err;
...@@ -2428,7 +2436,7 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry ...@@ -2428,7 +2436,7 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
if (res.fattr == NULL) if (res.fattr == NULL)
return -ENOMEM; return -ENOMEM;
status = nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
if (!status) { if (!status) {
entry->mask = 0; entry->mask = 0;
if (res.access & NFS4_ACCESS_READ) if (res.access & NFS4_ACCESS_READ)
...@@ -2495,7 +2503,7 @@ static int _nfs4_proc_readlink(struct inode *inode, struct page *page, ...@@ -2495,7 +2503,7 @@ static int _nfs4_proc_readlink(struct inode *inode, struct page *page,
.rpc_resp = &res, .rpc_resp = &res,
}; };
return nfs4_call_sync(NFS_SERVER(inode), &msg, &args.seq_args, &res.seq_res, 0); return nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode), &msg, &args.seq_args, &res.seq_res, 0);
} }
static int nfs4_proc_readlink(struct inode *inode, struct page *page, static int nfs4_proc_readlink(struct inode *inode, struct page *page,
...@@ -2584,7 +2592,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) ...@@ -2584,7 +2592,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
if (res.dir_attr == NULL) if (res.dir_attr == NULL)
goto out; goto out;
status = nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 1); status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 1);
if (status == 0) { if (status == 0) {
update_changeattr(dir, &res.cinfo); update_changeattr(dir, &res.cinfo);
nfs_post_op_update_inode(dir, res.dir_attr); nfs_post_op_update_inode(dir, res.dir_attr);
...@@ -2685,7 +2693,7 @@ static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, ...@@ -2685,7 +2693,7 @@ static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
if (res.old_fattr == NULL || res.new_fattr == NULL) if (res.old_fattr == NULL || res.new_fattr == NULL)
goto out; goto out;
status = nfs4_call_sync(server, &msg, &arg.seq_args, &res.seq_res, 1); status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
if (!status) { if (!status) {
update_changeattr(old_dir, &res.old_cinfo); update_changeattr(old_dir, &res.old_cinfo);
nfs_post_op_update_inode(old_dir, res.old_fattr); nfs_post_op_update_inode(old_dir, res.old_fattr);
...@@ -2736,7 +2744,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr * ...@@ -2736,7 +2744,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *
if (res.fattr == NULL || res.dir_attr == NULL) if (res.fattr == NULL || res.dir_attr == NULL)
goto out; goto out;
status = nfs4_call_sync(server, &msg, &arg.seq_args, &res.seq_res, 1); status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
if (!status) { if (!status) {
update_changeattr(dir, &res.cinfo); update_changeattr(dir, &res.cinfo);
nfs_post_op_update_inode(dir, res.dir_attr); nfs_post_op_update_inode(dir, res.dir_attr);
...@@ -2799,7 +2807,7 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, ...@@ -2799,7 +2807,7 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_createdata *data) static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_createdata *data)
{ {
int status = nfs4_call_sync(NFS_SERVER(dir), &data->msg, int status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &data->msg,
&data->arg.seq_args, &data->res.seq_res, 1); &data->arg.seq_args, &data->res.seq_res, 1);
if (status == 0) { if (status == 0) {
update_changeattr(dir, &data->res.dir_cinfo); update_changeattr(dir, &data->res.dir_cinfo);
...@@ -2912,7 +2920,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, ...@@ -2912,7 +2920,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
(unsigned long long)cookie); (unsigned long long)cookie);
nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args);
res.pgbase = args.pgbase; res.pgbase = args.pgbase;
status = nfs4_call_sync(NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0);
if (status >= 0) { if (status >= 0) {
memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE);
status += args.pgbase; status += args.pgbase;
...@@ -3004,7 +3012,7 @@ static int _nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -3004,7 +3012,7 @@ static int _nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
}; };
nfs_fattr_init(fsstat->fattr); nfs_fattr_init(fsstat->fattr);
return nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
} }
static int nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsstat *fsstat) static int nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsstat *fsstat)
...@@ -3035,7 +3043,7 @@ static int _nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -3035,7 +3043,7 @@ static int _nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle,
.rpc_resp = &res, .rpc_resp = &res,
}; };
return nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
} }
static int nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *fsinfo) static int nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *fsinfo)
...@@ -3080,7 +3088,7 @@ static int _nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle ...@@ -3080,7 +3088,7 @@ static int _nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle
} }
nfs_fattr_init(pathconf->fattr); nfs_fattr_init(pathconf->fattr);
return nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
} }
static int nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle, static int nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
...@@ -3459,7 +3467,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu ...@@ -3459,7 +3467,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
resp_buf = buf; resp_buf = buf;
buf_to_pages(buf, buflen, args.acl_pages, &args.acl_pgbase); buf_to_pages(buf, buflen, args.acl_pages, &args.acl_pgbase);
} }
ret = nfs4_call_sync(NFS_SERVER(inode), &msg, &args.seq_args, &res.seq_res, 0); ret = nfs4_call_sync(NFS_SERVER(inode)->client, NFS_SERVER(inode), &msg, &args.seq_args, &res.seq_res, 0);
if (ret) if (ret)
goto out_free; goto out_free;
if (res.acl_len > args.acl_len) if (res.acl_len > args.acl_len)
...@@ -3534,7 +3542,7 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl ...@@ -3534,7 +3542,7 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl
if (i < 0) if (i < 0)
return i; return i;
nfs_inode_return_delegation(inode); nfs_inode_return_delegation(inode);
ret = nfs4_call_sync(server, &msg, &arg.seq_args, &res.seq_res, 1); ret = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
/* /*
* Free each page after tx, so the only ref left is * Free each page after tx, so the only ref left is
...@@ -3897,7 +3905,7 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock ...@@ -3897,7 +3905,7 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
lsp = request->fl_u.nfs4_fl.owner; lsp = request->fl_u.nfs4_fl.owner;
arg.lock_owner.id = lsp->ls_id.id; arg.lock_owner.id = lsp->ls_id.id;
arg.lock_owner.s_dev = server->s_dev; arg.lock_owner.s_dev = server->s_dev;
status = nfs4_call_sync(server, &msg, &arg.seq_args, &res.seq_res, 1); status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
switch (status) { switch (status) {
case 0: case 0:
request->fl_type = F_UNLCK; request->fl_type = F_UNLCK;
...@@ -4625,7 +4633,7 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, ...@@ -4625,7 +4633,7 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
nfs_fattr_init(&fs_locations->fattr); nfs_fattr_init(&fs_locations->fattr);
fs_locations->server = server; fs_locations->server = server;
fs_locations->nlocations = 0; fs_locations->nlocations = 0;
status = nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
nfs_fixup_referral_attributes(&fs_locations->fattr); nfs_fixup_referral_attributes(&fs_locations->fattr);
dprintk("%s: returned status = %d\n", __func__, status); dprintk("%s: returned status = %d\n", __func__, status);
return status; return status;
...@@ -5593,7 +5601,7 @@ _nfs4_proc_getdeviceinfo(struct nfs_server *server, struct pnfs_device *pdev) ...@@ -5593,7 +5601,7 @@ _nfs4_proc_getdeviceinfo(struct nfs_server *server, struct pnfs_device *pdev)
int status; int status;
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
status = nfs4_call_sync(server, &msg, &args.seq_args, &res.seq_res, 0); status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
dprintk("<-- %s status=%d\n", __func__, status); dprintk("<-- %s status=%d\n", __func__, status);
return status; return status;
......
...@@ -177,7 +177,7 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, ...@@ -177,7 +177,7 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
} }
static int static int
nfs_proc_lookup(struct inode *dir, struct qstr *name, nfs_proc_lookup(struct rpc_clnt *clnt, struct inode *dir, struct qstr *name,
struct nfs_fh *fhandle, struct nfs_fattr *fattr) struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{ {
struct nfs_diropargs arg = { struct nfs_diropargs arg = {
......
...@@ -1071,7 +1071,7 @@ struct nfs_rpc_ops { ...@@ -1071,7 +1071,7 @@ struct nfs_rpc_ops {
struct nfs_fattr *); struct nfs_fattr *);
int (*setattr) (struct dentry *, struct nfs_fattr *, int (*setattr) (struct dentry *, struct nfs_fattr *,
struct iattr *); struct iattr *);
int (*lookup) (struct inode *, struct qstr *, int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *,
struct nfs_fh *, struct nfs_fattr *); struct nfs_fh *, struct nfs_fattr *);
int (*access) (struct inode *, struct nfs_access_entry *); int (*access) (struct inode *, struct nfs_access_entry *);
int (*readlink)(struct inode *, struct page *, unsigned int, int (*readlink)(struct inode *, struct page *, unsigned int,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册