Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334069
b: refs/heads/master
c: 3ba6367
h: refs/heads/master
i:
  334067: 888cf3f
v: v3
  • Loading branch information
J. Bruce Fields committed Oct 1, 2012
1 parent 617ff4a commit fd1e81d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 497305014864ea9e32adf7e8a06081209a5e7c42
refs/heads/master: 3ba6367124f3f07c91ea45a3ea24bbf4c5429bfc
25 changes: 15 additions & 10 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,14 +852,10 @@ static int nfsd4_register_conn(struct nfsd4_conn *conn)
return register_xpt_user(conn->cn_xprt, &conn->cn_xpt_user);
}

static __be32 nfsd4_new_conn(struct svc_rqst *rqstp, struct nfsd4_session *ses, u32 dir)
static void nfsd4_init_conn(struct svc_rqst *rqstp, struct nfsd4_conn *conn, struct nfsd4_session *ses, u32 dir)
{
struct nfsd4_conn *conn;
int ret;

conn = alloc_conn(rqstp, dir);
if (!conn)
return nfserr_jukebox;
nfsd4_hash_conn(conn, ses);
ret = nfsd4_register_conn(conn);
if (ret)
Expand All @@ -870,17 +866,21 @@ static __be32 nfsd4_new_conn(struct svc_rqst *rqstp, struct nfsd4_session *ses,
/* callback channel may be back up */
nfsd4_probe_callback(ses->se_client);
}
return nfs_ok;
}

static __be32 nfsd4_new_conn_from_crses(struct svc_rqst *rqstp, struct nfsd4_session *ses)
{
struct nfsd4_conn *conn;
u32 dir = NFS4_CDFC4_FORE;

if (ses->se_flags & SESSION4_BACK_CHAN)
dir |= NFS4_CDFC4_BACK;

return nfsd4_new_conn(rqstp, ses, dir);
conn = alloc_conn(rqstp, dir);
if (!conn)
return nfserr_jukebox;
nfsd4_init_conn(rqstp, conn, ses, dir);
return nfs_ok;
}

/* must be called under client_lock */
Expand Down Expand Up @@ -1868,6 +1868,7 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
struct nfsd4_bind_conn_to_session *bcts)
{
__be32 status;
struct nfsd4_conn *conn;

if (!nfsd4_last_compound_op(rqstp))
return nfserr_not_only_op;
Expand All @@ -1884,9 +1885,13 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
return nfserr_badsession;

status = nfsd4_map_bcts_dir(&bcts->dir);
if (!status)
nfsd4_new_conn(rqstp, cstate->session, bcts->dir);
return status;
if (status)
return status;
conn = alloc_conn(rqstp, bcts->dir);
if (!conn)
return nfserr_jukebox;
nfsd4_init_conn(rqstp, conn, cstate->session, bcts->dir);
return nfs_ok;
}

static bool nfsd4_compound_in_session(struct nfsd4_session *session, struct nfs4_sessionid *sid)
Expand Down

0 comments on commit fd1e81d

Please sign in to comment.