aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2017-09-19 20:18:41 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2017-09-19 20:18:41 +0000
commitab118d04be662e0557905da691390bee5c5ec97a (patch)
treea0347e8735ca9c4ac949021a479c03c80fe67bc0 /sys/fs
parent564a95f485777953134e803006e339c68ccca0cf (diff)
downloadsrc-ab118d04be662e0557905da691390bee5c5ec97a.tar.gz
src-ab118d04be662e0557905da691390bee5c5ec97a.zip
Simplify nfsrpc_layoutcommit() args.
Simplify nfsrpc_layoutcommit() args. in preparation for the addition of Flex File layout support, since it also uses a 0 length field.
Notes
Notes: svn path=/head/; revision=323775
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfs/nfs_var.h4
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c19
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c2
3 files changed, 7 insertions, 18 deletions
diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index 7c0008242bd8..a838d9aaffbf 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -484,8 +484,8 @@ int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, uint64_t,
int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *,
struct nfscldevinfo **, struct ucred *, NFSPROC_T *);
int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, int, int,
- uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, int, uint8_t *,
- struct ucred *, NFSPROC_T *, void *);
+ uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, struct ucred *,
+ NFSPROC_T *, void *);
int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t,
int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *,
NFSPROC_T *, void *);
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 46be7fba0d0b..b879bcffc5e7 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -5030,13 +5030,11 @@ nfsmout:
int
nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim,
uint64_t off, uint64_t len, uint64_t lastbyte, nfsv4stateid_t *stateidp,
- int layouttype, int layoutupdatecnt, uint8_t *layp, struct ucred *cred,
- NFSPROC_T *p, void *stuff)
+ int layouttype, struct ucred *cred, NFSPROC_T *p, void *stuff)
{
uint32_t *tl;
struct nfsrv_descript nfsd, *nd = &nfsd;
- int error, outcnt, i;
- uint8_t *cp;
+ int error;
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL);
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER +
@@ -5062,17 +5060,8 @@ nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim,
tl += 2;
*tl++ = newnfs_false;
*tl++ = txdr_unsigned(layouttype);
- *tl = txdr_unsigned(layoutupdatecnt);
- if (layoutupdatecnt > 0) {
- KASSERT(layouttype != NFSLAYOUT_NFSV4_1_FILES,
- ("Must be nil for Files Layout"));
- outcnt = NFSM_RNDUP(layoutupdatecnt);
- NFSM_BUILD(cp, uint8_t *, outcnt);
- NFSBCOPY(layp, cp, layoutupdatecnt);
- cp += layoutupdatecnt;
- for (i = 0; i < (outcnt - layoutupdatecnt); i++)
- *cp++ = 0x0;
- }
+ /* All supported layouts are 0 length. */
+ *tl = txdr_unsigned(0);
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);
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 96b0a6e7be27..0b1b3af70211 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -5256,7 +5256,7 @@ nfscl_dolayoutcommit(struct nfsmount *nmp, struct nfscllayout *lyp,
error = nfsrpc_layoutcommit(nmp, lyp->nfsly_fh,
lyp->nfsly_fhlen, 0, flp->nfsfl_off, len,
lyp->nfsly_lastbyte, &lyp->nfsly_stateid,
- NFSLAYOUT_NFSV4_1_FILES, 0, NULL, cred, p, NULL);
+ NFSLAYOUT_NFSV4_1_FILES, cred, p, NULL);
NFSCL_DEBUG(4, "layoutcommit err=%d\n", error);
if (error == NFSERR_NOTSUPP) {
/* If not supported, don't bother doing it. */