nfscl: Move nfsrpc_destroysession into nfscommon
This patch moves nfsrpc_destroysession() into nfscommon.ko and also modifies its arguments slightly. This will allow the function to be called from nfsv4_sequencelookup() in a future commit. This patch should not result in a semantics change. PR: 260011 MFC after: 2 weeks
This commit is contained in:
parent
9ef1127008
commit
dff31ae1c5
@ -4985,3 +4985,31 @@ nfsm_add_ext_pgs(struct mbuf *m, int maxextsiz, int *bextpg)
|
|||||||
}
|
}
|
||||||
return (mp);
|
return (mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Do the NFSv4.1 Destroy Session.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclsession *tsep,
|
||||||
|
struct ucred *cred, NFSPROC_T *p)
|
||||||
|
{
|
||||||
|
uint32_t *tl;
|
||||||
|
struct nfsrv_descript nfsd;
|
||||||
|
struct nfsrv_descript *nd = &nfsd;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0,
|
||||||
|
0, NULL);
|
||||||
|
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID);
|
||||||
|
if (tsep == NULL)
|
||||||
|
tsep = nfsmnt_mdssession(nmp);
|
||||||
|
bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID);
|
||||||
|
nd->nd_flag |= ND_USEGSSNAME;
|
||||||
|
error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred,
|
||||||
|
NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
|
error = nd->nd_repstat;
|
||||||
|
m_freem(nd->nd_mrep);
|
||||||
|
return (error);
|
||||||
|
}
|
||||||
|
@ -366,6 +366,8 @@ struct ucred *nfsrv_getgrpscred(struct ucred *);
|
|||||||
struct nfsdevice *nfsv4_findmirror(struct nfsmount *);
|
struct nfsdevice *nfsv4_findmirror(struct nfsmount *);
|
||||||
void nfsm_set(struct nfsrv_descript *, u_int);
|
void nfsm_set(struct nfsrv_descript *, u_int);
|
||||||
struct mbuf *nfsm_add_ext_pgs(struct mbuf *, int, int *);
|
struct mbuf *nfsm_add_ext_pgs(struct mbuf *, int, int *);
|
||||||
|
int nfsrpc_destroysession(struct nfsmount *, struct nfsclsession *,
|
||||||
|
struct ucred *, NFSPROC_T *);
|
||||||
|
|
||||||
/* nfs_clcomsubs.c */
|
/* nfs_clcomsubs.c */
|
||||||
void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int);
|
void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int);
|
||||||
@ -530,8 +532,6 @@ int nfsrpc_exchangeid(struct nfsmount *, struct nfsclclient *,
|
|||||||
int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *,
|
int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *,
|
||||||
struct nfssockreq *, struct nfsclds *, uint32_t, int, struct ucred *,
|
struct nfssockreq *, struct nfsclds *, uint32_t, int, struct ucred *,
|
||||||
NFSPROC_T *);
|
NFSPROC_T *);
|
||||||
int nfsrpc_destroysession(struct nfsmount *, struct nfsclclient *,
|
|
||||||
struct ucred *, NFSPROC_T *);
|
|
||||||
int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *,
|
int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *,
|
||||||
struct ucred *, NFSPROC_T *);
|
struct ucred *, NFSPROC_T *);
|
||||||
int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *,
|
int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *,
|
||||||
|
@ -5291,34 +5291,6 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep,
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Do the NFSv4.1 Destroy Session.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclclient *clp,
|
|
||||||
struct ucred *cred, NFSPROC_T *p)
|
|
||||||
{
|
|
||||||
uint32_t *tl;
|
|
||||||
struct nfsrv_descript nfsd;
|
|
||||||
struct nfsrv_descript *nd = &nfsd;
|
|
||||||
int error;
|
|
||||||
struct nfsclsession *tsep;
|
|
||||||
|
|
||||||
nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0,
|
|
||||||
0, NULL);
|
|
||||||
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID);
|
|
||||||
tsep = nfsmnt_mdssession(nmp);
|
|
||||||
bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID);
|
|
||||||
nd->nd_flag |= ND_USEGSSNAME;
|
|
||||||
error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred,
|
|
||||||
NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL);
|
|
||||||
if (error != 0)
|
|
||||||
return (error);
|
|
||||||
error = nd->nd_repstat;
|
|
||||||
m_freem(nd->nd_mrep);
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do the NFSv4.1 Destroy Client.
|
* Do the NFSv4.1 Destroy Client.
|
||||||
*/
|
*/
|
||||||
|
@ -2093,10 +2093,10 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p, struct nfscldeleghead *dhp)
|
|||||||
nfscl_delegreturnall(clp, p, dhp);
|
nfscl_delegreturnall(clp, p, dhp);
|
||||||
cred = newnfs_getcred();
|
cred = newnfs_getcred();
|
||||||
if (NFSHASNFSV4N(nmp)) {
|
if (NFSHASNFSV4N(nmp)) {
|
||||||
(void)nfsrpc_destroysession(nmp, clp, cred, p);
|
nfsrpc_destroysession(nmp, NULL, cred, p);
|
||||||
(void)nfsrpc_destroyclient(nmp, clp, cred, p);
|
nfsrpc_destroyclient(nmp, clp, cred, p);
|
||||||
} else
|
} else
|
||||||
(void)nfsrpc_setclient(nmp, clp, 0, NULL, cred, p);
|
nfsrpc_setclient(nmp, clp, 0, NULL, cred, p);
|
||||||
nfscl_cleanclient(clp);
|
nfscl_cleanclient(clp);
|
||||||
nmp->nm_clp = NULL;
|
nmp->nm_clp = NULL;
|
||||||
NFSFREECRED(cred);
|
NFSFREECRED(cred);
|
||||||
|
Loading…
Reference in New Issue
Block a user