View | Details | Raw Unified | Return to bug 226493 | Differences between
and this patch

Collapse All | Expand All

(-)fs/nfs/nfs_commonsubs.c (-1 / +1 lines)
Lines 131-137 struct nfsv4_opflag nfsv4_opflag[NFSV41_ Link Here
131
	{ 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 },		/* Write */
131
	{ 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 },		/* Write */
132
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 },		/* ReleaseLockOwner */
132
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 },		/* ReleaseLockOwner */
133
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 },		/* Backchannel Ctrl */
133
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 },		/* Backchannel Ctrl */
134
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 },		/* Bind Conn to Sess */
134
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Bind Conn to Sess */
135
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Exchange ID */
135
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Exchange ID */
136
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Create Session */
136
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Create Session */
137
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Destroy Session */
137
	{ 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 },		/* Destroy Session */
(-)fs/nfs/nfs_var.h (+3 lines)
Lines 95-100 int nfsrv_getclient(nfsquad_t, int, stru Link Here
95
    nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *);
95
    nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *);
96
int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *);
96
int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *);
97
int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *);
97
int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *);
98
int nfsrv_bindconnsess(uint8_t *, int *);
98
int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
99
int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
99
int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *);
100
int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *);
100
void nfsrv_dumpclients(struct nfsd_dumpclients *, int);
101
void nfsrv_dumpclients(struct nfsd_dumpclients *, int);
Lines 230-235 int nfsrvd_reclaimcomplete(struct nfsrv_ Link Here
230
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
231
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
231
int nfsrvd_destroyclientid(struct nfsrv_descript *, int,
232
int nfsrvd_destroyclientid(struct nfsrv_descript *, int,
232
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
233
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
234
int nfsrvd_bindconnsess(struct nfsrv_descript *, int,
235
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
233
int nfsrvd_destroysession(struct nfsrv_descript *, int,
236
int nfsrvd_destroysession(struct nfsrv_descript *, int,
234
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
237
    vnode_t, NFSPROC_T *, struct nfsexstuff *);
235
int nfsrvd_freestateid(struct nfsrv_descript *, int,
238
int nfsrvd_freestateid(struct nfsrv_descript *, int,
(-)fs/nfs/nfsproto.h (+9 lines)
Lines 648-653 Link Here
648
#define	NFSFLAYUTIL_DENSE		0x1
649
#define	NFSFLAYUTIL_DENSE		0x1
649
#define	NFSFLAYUTIL_COMMIT_THRU_MDS	0x2
650
#define	NFSFLAYUTIL_COMMIT_THRU_MDS	0x2
650
651
652
/* Enum values for Bind Connection to Session. */
653
#define	NFSCDFC4_FORE		0x1
654
#define	NFSCDFC4_BACK		0x2
655
#define	NFSCDFC4_FORE_OR_BOTH	0x3
656
#define	NFSCDFC4_BACK_OR_BOTH	0x7
657
#define	NFSCDFS4_FORE		0x1
658
#define	NFSCDFS4_BACK		0x2
659
#define	NFSCDFS4_BOTH		0x3
660
651
/* Conversion macros */
661
/* Conversion macros */
652
#define	vtonfsv2_mode(t,m) 						\
662
#define	vtonfsv2_mode(t,m) 						\
653
		txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : 	\
663
		txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : 	\
(-)fs/nfsserver/nfs_nfsdserv.c (+39 lines)
Lines 4041-4046 nfsmout: Link Here
4041
}
4057
}
4042
4058
4043
/*
4059
/*
4060
 * nfsv4 bind connection to session service
4061
 */
4062
APPLESTATIC int
4063
nfsrvd_bindconnsess(struct nfsrv_descript *nd, __unused int isdgram,
4064
    __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp)
4065
{
4066
	uint32_t *tl;
4067
	uint8_t sessid[NFSX_V4SESSIONID];
4068
	int error = 0, foreaft;
4069
4070
	if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
4071
		nd->nd_repstat = NFSERR_WRONGSEC;
4072
		goto nfsmout;
4073
	}
4074
	NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED);
4075
	NFSBCOPY(tl, sessid, NFSX_V4SESSIONID);
4076
	tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED);
4077
	foreaft = fxdr_unsigned(int, *tl++);
4078
	if (*tl == newnfs_true) {
4079
		/* RDMA is not supported. */
4080
		nd->nd_repstat = NFSERR_NOTSUPP;
4081
		goto nfsmout;
4082
	}
4083
4084
	nd->nd_repstat = nfsrv_bindconnsess(sessid, &foreaft);
4085
	if (nd->nd_repstat == 0) {
4086
		NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 *
4087
		    NFSX_UNSIGNED);
4088
		NFSBCOPY(sessid, tl, NFSX_V4SESSIONID);
4089
		tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED);
4090
		*tl++ = txdr_unsigned(foreaft);
4091
		*tl = newnfs_false;
4092
	}
4093
nfsmout:
4094
	NFSEXITCODE2(error, nd);
4095
	return (error);
4096
}
4097
4098
/*
4044
 * nfsv4 destroy session service
4099
 * nfsv4 destroy session service
4045
 */
4100
 */
4046
APPLESTATIC int
4101
APPLESTATIC int
(-)fs/nfsserver/nfs_nfsdsocket.c (-1 / +1 lines)
Lines 176-182 int (*nfsrv4_ops0[NFSV41_NOPS])(struct n Link Here
176
	nfsrvd_write,
176
	nfsrvd_write,
177
	nfsrvd_releaselckown,
177
	nfsrvd_releaselckown,
178
	nfsrvd_notsupp,
178
	nfsrvd_notsupp,
179
	nfsrvd_notsupp,
179
	nfsrvd_bindconnsess,
180
	nfsrvd_exchangeid,
180
	nfsrvd_exchangeid,
181
	nfsrvd_createsession,
181
	nfsrvd_createsession,
182
	nfsrvd_destroysession,
182
	nfsrvd_destroysession,
(-)fs/nfsserver/nfs_nfsdstate.c (+38 lines)
Lines 5950-5955 nfsrv_destroysession(struct nfsrv_descri Link Here
5950
}
5952
}
5951
5953
5952
/*
5954
/*
5955
 * Bind a connection to a session.
5956
 * For now, only certain variants are supported, since the current session
5957
 * structure can only handle a single backchannel entry, which will be
5958
 * applied to all connections if it is set.
5959
 */
5960
int
5961
nfsrv_bindconnsess(uint8_t *sessionid, int *foreaftp)
5962
{
5963
	struct nfssessionhash *shp;
5964
	struct nfsdsession *sep;
5965
	int error;
5966
5967
	error = 0;
5968
	shp = NFSSESSIONHASH(sessionid);
5969
	NFSLOCKSESSION(shp);
5970
	sep = nfsrv_findsession(sessionid);
5971
	if (sep != NULL) {
5972
		if ((sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) {
5973
			/* Can only handle backchannel cases. */
5974
			if (*foreaftp == NFSCDFC4_FORE_OR_BOTH ||
5975
			    *foreaftp == NFSCDFC4_BACK_OR_BOTH)
5976
				*foreaftp = NFSCDFS4_BOTH;
5977
			else
5978
				error = NFSERR_NOTSUPP;
5979
		} else {
5980
			if (*foreaftp == NFSCDFC4_FORE ||
5981
			    *foreaftp == NFSCDFC4_FORE_OR_BOTH)
5982
				*foreaftp = NFSCDFS4_FORE;
5983
			else
5984
				error = NFSERR_NOTSUPP;
5985
		}
5986
	} else
5987
		error = NFSERR_BADSESSION;
5988
	NFSUNLOCKSESSION(shp);
5989
	return (error);
5990
}
5991
5992
/*
5953
 * Free up a session structure.
5993
 * Free up a session structure.
5954
 */
5994
 */
5955
static int
5995
static int

Return to bug 226493