Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 590184a6 authored by Kinglong Mee's avatar Kinglong Mee Committed by Trond Myklebust
Browse files

NFS: Use NFS4_MAX_SESSIONID_LEN directly for decode/encode sessionid



It's no need to define a temporary variables for NFS4_MAX_SESSIONID_LEN.

Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 39de493e
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -380,13 +380,12 @@ static __be32 decode_sessionid(struct xdr_stream *xdr,
				 struct nfs4_sessionid *sid)
{
	__be32 *p;
	int len = NFS4_MAX_SESSIONID_LEN;

	p = read_buf(xdr, len);
	p = read_buf(xdr, NFS4_MAX_SESSIONID_LEN);
	if (unlikely(p == NULL))
		return htonl(NFS4ERR_RESOURCE);

	memcpy(sid->data, p, len);
	memcpy(sid->data, p, NFS4_MAX_SESSIONID_LEN);
	return 0;
}

@@ -679,13 +678,12 @@ static __be32 encode_sessionid(struct xdr_stream *xdr,
				 const struct nfs4_sessionid *sid)
{
	__be32 *p;
	int len = NFS4_MAX_SESSIONID_LEN;

	p = xdr_reserve_space(xdr, len);
	p = xdr_reserve_space(xdr, NFS4_MAX_SESSIONID_LEN);
	if (unlikely(p == NULL))
		return htonl(NFS4ERR_RESOURCE);

	memcpy(p, sid, len);
	memcpy(p, sid, NFS4_MAX_SESSIONID_LEN);
	return 0;
}