struct nfs4_state_owner {
struct nfs_unique_id so_owner_id;
struct nfs_client *so_client;
+ struct nfs_server *so_server;
struct rb_node so_client_node;
struct rpc_cred *so_cred; /* Associated cred */
}
static struct nfs4_state_owner *
-nfs4_find_state_owner(struct nfs_client *clp, struct rpc_cred *cred)
+nfs4_find_state_owner(struct nfs_server *server, struct rpc_cred *cred)
{
+ struct nfs_client *clp = server->nfs_client;
struct rb_node **p = &clp->cl_state_owners.rb_node,
*parent = NULL;
struct nfs4_state_owner *sp, *res = NULL;
parent = *p;
sp = rb_entry(parent, struct nfs4_state_owner, so_client_node);
+ if (server < sp->so_server) {
+ p = &parent->rb_left;
+ continue;
+ }
+ if (server > sp->so_server) {
+ p = &parent->rb_right;
+ continue;
+ }
if (cred < sp->so_cred)
p = &parent->rb_left;
else if (cred > sp->so_cred)
parent = *p;
sp = rb_entry(parent, struct nfs4_state_owner, so_client_node);
+ if (new->so_server < sp->so_server) {
+ p = &parent->rb_left;
+ continue;
+ }
+ if (new->so_server > sp->so_server) {
+ p = &parent->rb_right;
+ continue;
+ }
if (new->so_cred < sp->so_cred)
p = &parent->rb_left;
else if (new->so_cred > sp->so_cred)
struct nfs4_state_owner *sp, *new;
spin_lock(&clp->cl_lock);
- sp = nfs4_find_state_owner(clp, cred);
+ sp = nfs4_find_state_owner(server, cred);
spin_unlock(&clp->cl_lock);
if (sp != NULL)
return sp;
if (new == NULL)
return NULL;
new->so_client = clp;
+ new->so_server = server;
new->so_cred = cred;
spin_lock(&clp->cl_lock);
sp = nfs4_insert_state_owner(clp, new);