4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2017 Joyent Inc
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #include <sys/types.h>
28 #include <sys/systm.h>
29 #include <sys/cmn_err.h>
32 #include <sys/dirent.h>
33 #include <sys/debug.h>
34 #include <rpc/types.h>
36 #include <nfs/export.h>
39 #include <rpc/rpcb_prot.h>
41 #include <nfs/nfs_log.h>
44 * nfsl_principal_name_get - extracts principal from transport struct.
45 * Based on "uts/common/rpc/sec/sec_svc.c" function sec_svc_getcred.
48 nfsl_principal_name_get(struct svc_req
*req
)
50 char *principal_name
= NULL
;
51 struct authdes_cred
*adc
;
52 rpc_gss_rawcred_t
*rcred
;
53 rpc_gss_ucred_t
*ucred
;
56 switch (req
->rq_cred
.oa_flavor
) {
59 /* no principal name provided */
63 adc
= (struct authdes_cred
*)req
->rq_clntcred
;
64 CTASSERT(sizeof (struct authdes_cred
) <= RQCRED_SIZE
);
65 principal_name
= adc
->adc_fullname
.name
;
69 (void) rpc_gss_getcred(req
, &rcred
, &ucred
, &cookie
);
70 principal_name
= (caddr_t
)rcred
->client_principal
;
76 return (principal_name
);
80 xdr_timestruc32_t(XDR
*xdrs
, timestruc32_t
*objp
)
82 if (!xdr_int(xdrs
, &objp
->tv_sec
))
84 return (xdr_int(xdrs
, &objp
->tv_nsec
));
88 xdr_nfsstat(XDR
*xdrs
, nfsstat
*objp
)
90 return (xdr_enum(xdrs
, (enum_t
*)objp
));
94 xdr_nfslog_sharefsres(XDR
*xdrs
, nfslog_sharefsres
*objp
)
96 return (xdr_nfsstat(xdrs
, objp
));
100 xdr_nfsreadargs(XDR
*xdrs
, struct nfsreadargs
*ra
)
102 if (xdr_fhandle(xdrs
, &ra
->ra_fhandle
) &&
103 xdr_u_int(xdrs
, &ra
->ra_offset
) &&
104 xdr_u_int(xdrs
, &ra
->ra_count
) &&
105 xdr_u_int(xdrs
, &ra
->ra_totcount
)) {
112 xdr_nfslog_nfsreadargs(xdrs
, objp
)
114 nfslog_nfsreadargs
*objp
;
116 return (xdr_nfsreadargs(xdrs
, objp
));
120 * Current version (2 and up) xdr function for buffer header
121 * uses 64-bit offset (relocated to an 8 byte boundary), version 1 uses 32.
124 xdr_nfslog_buffer_header(xdrs
, objp
)
126 nfslog_buffer_header
*objp
;
128 if (!xdr_u_int(xdrs
, &objp
->bh_length
))
130 if (!xdr_rpcvers(xdrs
, &objp
->bh_version
))
132 ASSERT(objp
->bh_version
> 1);
133 if (!xdr_u_longlong_t(xdrs
, &objp
->bh_offset
))
135 if (!xdr_u_int(xdrs
, &objp
->bh_flags
))
137 return (xdr_timestruc32_t(xdrs
, &objp
->bh_timestamp
));
141 * Hand coded xdr functions for the kernel ENCODE path
145 xdr_nfslog_request_record(
147 struct exportinfo
*exi
,
152 unsigned int record_id
)
162 if (xdrs
->x_op
!= XDR_ENCODE
)
166 * First we do the encoding of the record header
168 if (!xdr_u_int(xdrs
, &reclen
))
170 if (!xdr_u_int(xdrs
, &record_id
))
172 if (!xdr_rpcprog(xdrs
, &req
->rq_prog
))
174 if (!xdr_rpcproc(xdrs
, &req
->rq_proc
))
176 if (!xdr_rpcvers(xdrs
, &req
->rq_vers
))
178 flavor
= req
->rq_cred
.oa_flavor
;
179 if (!xdr_u_int(xdrs
, &flavor
))
183 TIMESPEC_TO_TIMESPEC32(&ts
, &now
);
184 if (!xdr_timestruc32_t(xdrs
, &ts
))
187 /* This code depends on us doing XDR_ENCODE ops only */
188 ruid
= crgetruid(cr
);
189 if (!xdr_uid_t(xdrs
, &ruid
))
191 rgid
= crgetrgid(cr
);
192 if (!xdr_gid_t(xdrs
, &rgid
))
196 * Now encode the rest of the request record (but not args/res)
198 prin
= nfsl_principal_name_get(req
);
199 if (!xdr_string(xdrs
, &prin
, ~0))
202 netid
= svc_getnetid(req
->rq_xprt
);
203 if (!xdr_string(xdrs
, &netid
, ~0))
205 if (!xdr_string(xdrs
, &exi
->exi_export
.ex_tag
, ~0))
207 return (xdr_netbuf(xdrs
, pnb
));
211 xdr_nfslog_sharefsargs(XDR
*xdrs
, struct exportinfo
*objp
)
214 if (xdrs
->x_op
!= XDR_ENCODE
)
217 if (!xdr_int(xdrs
, &objp
->exi_export
.ex_flags
))
219 if (!xdr_u_int(xdrs
, &objp
->exi_export
.ex_anon
))
221 if (!xdr_string(xdrs
, &objp
->exi_export
.ex_path
, ~0))
223 return (xdr_fhandle(xdrs
, &objp
->exi_fh
));
227 xdr_nfslog_getfhargs(XDR
*xdrs
, nfslog_getfhargs
*objp
)
229 if (!xdr_fhandle(xdrs
, &objp
->gfh_fh_buf
))
231 return (xdr_string(xdrs
, &objp
->gfh_path
, ~0));
235 xdr_nfslog_drok(XDR
*xdrs
, struct nfsdrok
*objp
)
237 return (xdr_fhandle(xdrs
, &objp
->drok_fhandle
));
241 xdr_nfslog_diropres(XDR
*xdrs
, struct nfsdiropres
*objp
)
243 if (!xdr_nfsstat(xdrs
, &objp
->dr_status
))
245 switch (objp
->dr_status
) {
247 if (!xdr_nfslog_drok(xdrs
, &objp
->dr_drok
))
255 xdr_nfslog_getattrres(XDR
*xdrs
, struct nfsattrstat
*objp
)
257 return (xdr_nfsstat(xdrs
, &objp
->ns_status
));
261 xdr_nfslog_rrok(XDR
*xdrs
, struct nfsrrok
*objp
)
263 if (!xdr_u_int(xdrs
, &objp
->rrok_attr
.na_size
))
265 return (xdr_u_int(xdrs
, &objp
->rrok_count
));
269 xdr_nfslog_rdresult(XDR
*xdrs
, struct nfsrdresult
*objp
)
271 if (!xdr_nfsstat(xdrs
, &objp
->rr_status
))
273 switch (objp
->rr_status
) {
275 if (!xdr_nfslog_rrok(xdrs
, &objp
->rr_u
.rr_ok_u
))
283 xdr_nfslog_writeargs(XDR
*xdrs
, struct nfswriteargs
*objp
)
285 if (!xdr_fhandle(xdrs
, &objp
->wa_args
->otw_wa_fhandle
))
287 if (!xdr_u_int(xdrs
, &objp
->wa_args
->otw_wa_begoff
))
289 if (!xdr_u_int(xdrs
, &objp
->wa_args
->otw_wa_offset
))
291 if (!xdr_u_int(xdrs
, &objp
->wa_args
->otw_wa_totcount
))
293 return (xdr_u_int(xdrs
, &objp
->wa_count
));
297 xdr_nfslog_writeresult(XDR
*xdrs
, struct nfsattrstat
*objp
)
299 if (!xdr_nfsstat(xdrs
, &objp
->ns_status
))
301 switch (objp
->ns_status
) {
303 if (!xdr_u_int(xdrs
, &objp
->ns_u
.ns_attr_u
.na_size
))
311 xdr_nfslog_diropargs(XDR
*xdrs
, struct nfsdiropargs
*objp
)
313 if (!xdr_fhandle(xdrs
, objp
->da_fhandle
))
315 return (xdr_string(xdrs
, &objp
->da_name
, ~0));
319 xdr_nfslog_sattr(XDR
*xdrs
, struct nfssattr
*objp
)
321 if (!xdr_u_int(xdrs
, &objp
->sa_mode
))
323 if (!xdr_u_int(xdrs
, &objp
->sa_uid
))
325 if (!xdr_u_int(xdrs
, &objp
->sa_gid
))
327 if (!xdr_u_int(xdrs
, &objp
->sa_size
))
329 if (!xdr_nfs2_timeval(xdrs
, (nfs2_timeval
*)&objp
->sa_atime
))
331 return (xdr_nfs2_timeval(xdrs
, (nfs2_timeval
*)&objp
->sa_mtime
));
335 xdr_nfslog_createargs(XDR
*xdrs
, struct nfscreatargs
*objp
)
337 if (!xdr_nfslog_sattr(xdrs
, objp
->ca_sa
))
339 return (xdr_nfslog_diropargs(xdrs
, &objp
->ca_da
));
343 xdr_nfslog_setattrargs(XDR
*xdrs
, struct nfssaargs
*objp
)
345 if (!xdr_fhandle(xdrs
, &objp
->saa_fh
))
347 return (xdr_nfslog_sattr(xdrs
, &objp
->saa_sa
));
351 xdr_nfslog_rdlnres(XDR
*xdrs
, struct nfsrdlnres
*objp
)
353 caddr_t lnres
= NULL
;
356 if (!xdr_nfsstat(xdrs
, &objp
->rl_status
))
358 switch (objp
->rl_status
) {
360 if ((count
= objp
->rl_u
.rl_srok_u
.srok_count
) != 0) {
362 * allocate extra element for terminating NULL
364 lnres
= kmem_alloc(count
+ 1, KM_SLEEP
);
365 bcopy(objp
->rl_u
.rl_srok_u
.srok_data
, lnres
, count
);
368 if (!xdr_string(xdrs
, &lnres
, ~0)) {
370 kmem_free(lnres
, count
+ 1);
374 kmem_free(lnres
, count
+ 1);
381 xdr_nfslog_rnmargs(XDR
*xdrs
, struct nfsrnmargs
*objp
)
383 if (!xdr_nfslog_diropargs(xdrs
, &objp
->rna_from
))
385 return (xdr_nfslog_diropargs(xdrs
, &objp
->rna_to
));
389 xdr_nfslog_linkargs(XDR
*xdrs
, struct nfslinkargs
*objp
)
391 if (!xdr_fhandle(xdrs
, objp
->la_from
))
393 return (xdr_nfslog_diropargs(xdrs
, &objp
->la_to
));
397 xdr_nfslog_symlinkargs(XDR
*xdrs
, struct nfsslargs
*objp
)
399 if (!xdr_nfslog_diropargs(xdrs
, &objp
->sla_from
))
401 if (!xdr_string(xdrs
, &objp
->sla_tnm
, ~0))
403 return (xdr_nfslog_sattr(xdrs
, objp
->sla_sa
));
407 xdr_nfslog_statfs(XDR
*xdrs
, struct nfsstatfs
*objp
)
409 return (xdr_nfsstat(xdrs
, &objp
->fs_status
));
413 xdr_nfslog_rddirargs(XDR
*xdrs
, struct nfsrddirargs
*objp
)
415 if (!xdr_fhandle(xdrs
, &objp
->rda_fh
))
417 if (!xdr_u_int(xdrs
, &objp
->rda_offset
))
419 return (xdr_u_int(xdrs
, &objp
->rda_count
));
423 xdr_nfslog_rdok(XDR
*xdrs
, struct nfsrdok
*objp
)
425 if (!xdr_u_int(xdrs
, &objp
->rdok_offset
))
427 if (!xdr_u_int(xdrs
, &objp
->rdok_size
))
429 return (xdr_bool(xdrs
, &objp
->rdok_eof
));
433 xdr_nfslog_rddirres(XDR
*xdrs
, struct nfsrddirres
*objp
)
435 if (!xdr_nfsstat(xdrs
, &objp
->rd_status
))
437 switch (objp
->rd_status
) {
439 if (!xdr_nfslog_rdok(xdrs
, &objp
->rd_u
.rd_rdok_u
))
447 xdr_nfslog_diropargs3(XDR
*xdrs
, diropargs3
*objp
)
451 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->dir
))
453 if (objp
->name
!= nfs3nametoolong
)
457 * The name is not defined, set it to the
458 * zero length string.
462 return (xdr_string(xdrs
, &name
, ~0));
466 xdr_nfslog_LOOKUP3res(XDR
*xdrs
, LOOKUP3res
*objp
)
468 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
470 switch (objp
->status
) {
472 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->res_u
.ok
.object
))
480 xdr_set_size3(XDR
*xdrs
, set_size3
*objp
)
482 if (!xdr_bool(xdrs
, &objp
->set_it
))
484 switch (objp
->set_it
) {
486 if (!xdr_uint64(xdrs
, &objp
->size
))
494 xdr_nfslog_createhow3(XDR
*xdrs
, createhow3
*objp
)
496 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->mode
))
498 switch (objp
->mode
) {
501 if (!xdr_set_size3(xdrs
,
502 &objp
->createhow3_u
.obj_attributes
.size
))
514 xdr_nfslog_CREATE3args(XDR
*xdrs
, CREATE3args
*objp
)
516 if (!xdr_nfslog_diropargs3(xdrs
, &objp
->where
))
518 return (xdr_nfslog_createhow3(xdrs
, &objp
->how
));
522 xdr_nfslog_CREATE3resok(XDR
*xdrs
, CREATE3resok
*objp
)
524 return (xdr_post_op_fh3(xdrs
, &objp
->obj
));
528 xdr_nfslog_CREATE3res(XDR
*xdrs
, CREATE3res
*objp
)
530 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
532 switch (objp
->status
) {
534 if (!xdr_nfslog_CREATE3resok(xdrs
, &objp
->res_u
.ok
))
542 xdr_nfslog_GETATTR3res(XDR
*xdrs
, GETATTR3res
*objp
)
544 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
548 xdr_nfslog_ACCESS3args(XDR
*xdrs
, ACCESS3args
*objp
)
550 return (xdr_nfslog_nfs_fh3(xdrs
, &objp
->object
));
554 xdr_nfslog_ACCESS3res(XDR
*xdrs
, ACCESS3res
*objp
)
556 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
560 xdr_nfslog_SETATTR3args(XDR
*xdrs
, SETATTR3args
*objp
)
562 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->object
))
564 return (xdr_set_size3(xdrs
, &objp
->new_attributes
.size
));
568 xdr_nfslog_SETATTR3res(XDR
*xdrs
, SETATTR3res
*objp
)
570 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
574 xdr_nfslog_READLINK3res(XDR
*xdrs
, READLINK3res
*objp
)
576 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
578 switch (objp
->status
) {
580 if (!xdr_string(xdrs
, &objp
->res_u
.ok
.data
, ~0))
588 xdr_nfslog_READ3args(XDR
*xdrs
, READ3args
*objp
)
590 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->file
))
592 if (!xdr_uint64(xdrs
, &objp
->offset
))
594 return (xdr_uint32(xdrs
, &objp
->count
));
598 xdr_nfslog_READ3resok(XDR
*xdrs
, READ3resok
*objp
)
600 if (!xdr_uint64(xdrs
, &objp
->file_attributes
.attr
.size
))
602 if (!xdr_uint32(xdrs
, &objp
->count
))
604 if (!xdr_bool(xdrs
, &objp
->eof
))
606 return (xdr_u_int(xdrs
, &objp
->size
));
610 xdr_nfslog_READ3res(XDR
*xdrs
, READ3res
*objp
)
612 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
614 switch (objp
->status
) {
616 if (!xdr_nfslog_READ3resok(xdrs
, &objp
->res_u
.ok
))
624 xdr_nfslog_WRITE3args(XDR
*xdrs
, WRITE3args
*objp
)
626 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->file
))
628 if (!xdr_uint64(xdrs
, &objp
->offset
))
630 if (!xdr_uint32(xdrs
, &objp
->count
))
632 return (xdr_enum(xdrs
, (enum_t
*)&objp
->stable
));
636 xdr_nfslog_WRITE3resok(XDR
*xdrs
, WRITE3resok
*objp
)
638 if (!xdr_uint64(xdrs
, &objp
->file_wcc
.after
.attr
.size
))
640 if (!xdr_uint32(xdrs
, &objp
->count
))
642 return (xdr_enum(xdrs
, (enum_t
*)&objp
->committed
));
646 xdr_nfslog_WRITE3res(XDR
*xdrs
, WRITE3res
*objp
)
648 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
650 switch (objp
->status
) {
652 if (!xdr_nfslog_WRITE3resok(xdrs
, &objp
->res_u
.ok
))
660 xdr_nfslog_MKDIR3args(XDR
*xdrs
, MKDIR3args
*objp
)
662 return (xdr_nfslog_diropargs3(xdrs
, &objp
->where
));
666 xdr_nfslog_MKDIR3res(XDR
*xdrs
, MKDIR3res
*objp
)
668 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
670 switch (objp
->status
) {
672 if (!xdr_post_op_fh3(xdrs
, &objp
->res_u
.ok
.obj
))
680 xdr_nfslog_SYMLINK3args(XDR
*xdrs
, SYMLINK3args
*objp
)
682 if (!xdr_nfslog_diropargs3(xdrs
, &objp
->where
))
684 return (xdr_string(xdrs
, &objp
->symlink
.symlink_data
, ~0));
688 xdr_nfslog_SYMLINK3res(XDR
*xdrs
, SYMLINK3res
*objp
)
690 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
692 switch (objp
->status
) {
694 if (!xdr_post_op_fh3(xdrs
, &objp
->res_u
.ok
.obj
))
702 xdr_nfslog_MKNOD3args(XDR
*xdrs
, MKNOD3args
*objp
)
704 if (!xdr_nfslog_diropargs3(xdrs
, &objp
->where
))
706 return (xdr_enum(xdrs
, (enum_t
*)&objp
->what
.type
));
710 xdr_nfslog_MKNOD3res(XDR
*xdrs
, MKNOD3res
*objp
)
712 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
714 switch (objp
->status
) {
716 if (!xdr_post_op_fh3(xdrs
, &objp
->res_u
.ok
.obj
))
724 xdr_nfslog_REMOVE3args(XDR
*xdrs
, REMOVE3args
*objp
)
726 return (xdr_nfslog_diropargs3(xdrs
, &objp
->object
));
730 xdr_nfslog_REMOVE3res(XDR
*xdrs
, REMOVE3res
*objp
)
732 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
736 xdr_nfslog_RMDIR3args(XDR
*xdrs
, RMDIR3args
*objp
)
738 return (xdr_nfslog_diropargs3(xdrs
, &objp
->object
));
742 xdr_nfslog_RMDIR3res(XDR
*xdrs
, RMDIR3res
*objp
)
744 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
748 xdr_nfslog_RENAME3args(XDR
*xdrs
, RENAME3args
*objp
)
750 if (!xdr_nfslog_diropargs3(xdrs
, &objp
->from
))
752 return (xdr_nfslog_diropargs3(xdrs
, &objp
->to
));
756 xdr_nfslog_RENAME3res(XDR
*xdrs
, RENAME3res
*objp
)
758 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
762 xdr_nfslog_LINK3args(XDR
*xdrs
, LINK3args
*objp
)
764 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->file
))
766 return (xdr_nfslog_diropargs3(xdrs
, &objp
->link
));
770 xdr_nfslog_LINK3res(XDR
*xdrs
, LINK3res
*objp
)
772 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
776 xdr_nfslog_READDIR3args(XDR
*xdrs
, READDIR3args
*objp
)
778 return (xdr_nfslog_nfs_fh3(xdrs
, &objp
->dir
));
782 xdr_nfslog_READDIR3res(XDR
*xdrs
, READDIR3res
*objp
)
784 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
788 xdr_nfslog_READDIRPLUS3args(XDR
*xdrs
, READDIRPLUS3args
*objp
)
790 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->dir
))
792 if (!xdr_uint32(xdrs
, &objp
->dircount
))
794 return (xdr_uint32(xdrs
, &objp
->maxcount
));
800 #define nextdp(dp) ((struct dirent64 *)((char *)(dp) + (dp)->d_reclen))
803 xdr_nfslog_READDIRPLUS3resok(XDR
*xdrs
, READDIRPLUS3resok
*objp
)
810 entryplus3_info
*infop
;
812 dp
= (struct dirent64
*)objp
->reply
.entries
;
816 if (dp
->d_reclen
== 0)
818 if (dp
->d_ino
== 0) {
826 if (!xdr_bool(xdrs
, &t
) ||
827 !xdr_post_op_fh3(xdrs
, &infop
->fh
) ||
828 !xdr_string(xdrs
, &name
, ~0)) {
835 if (!xdr_bool(xdrs
, &f
))
838 return (xdr_bool(xdrs
, &objp
->reply
.eof
));
842 xdr_nfslog_READDIRPLUS3res(XDR
*xdrs
, READDIRPLUS3res
*objp
)
844 if (!xdr_enum(xdrs
, (enum_t
*)&objp
->status
))
846 switch (objp
->status
) {
848 if (!xdr_nfslog_READDIRPLUS3resok(xdrs
, &objp
->res_u
.ok
))
856 xdr_nfslog_FSSTAT3args(XDR
*xdrs
, FSSTAT3args
*objp
)
858 return (xdr_nfslog_nfs_fh3(xdrs
, &objp
->fsroot
));
862 xdr_nfslog_FSSTAT3res(XDR
*xdrs
, FSSTAT3res
*objp
)
864 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
868 xdr_nfslog_FSINFO3args(XDR
*xdrs
, FSINFO3args
*objp
)
870 return (xdr_nfslog_nfs_fh3(xdrs
, &objp
->fsroot
));
874 xdr_nfslog_FSINFO3res(XDR
*xdrs
, FSINFO3res
*objp
)
876 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
880 xdr_nfslog_PATHCONF3args(XDR
*xdrs
, PATHCONF3args
*objp
)
882 return (xdr_nfslog_nfs_fh3(xdrs
, &objp
->object
));
886 xdr_nfslog_PATHCONF3res(XDR
*xdrs
, PATHCONF3res
*objp
)
888 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
892 xdr_nfslog_COMMIT3args(XDR
*xdrs
, COMMIT3args
*objp
)
894 if (!xdr_nfslog_nfs_fh3(xdrs
, &objp
->file
))
896 if (!xdr_uint64(xdrs
, &objp
->offset
))
898 return (xdr_uint32(xdrs
, &objp
->count
));
902 xdr_nfslog_COMMIT3res(XDR
*xdrs
, COMMIT3res
*objp
)
904 return (xdr_enum(xdrs
, (enum_t
*)&objp
->status
));
908 xdr_nfslog_nfs_fh3(XDR
*xdrs
, nfs_fh3
*objp
)
912 if (objp
->fh3_len
> NFS_FHMAXDATA
|| objp
->fh3_xlen
> NFS_FHMAXDATA
) {
914 fh
.fh3_len
= NFS_FHMAXDATA
;
915 fh
.fh3_xlen
= NFS_FHMAXDATA
;
916 fh
.fh3_length
= NFS3_OLDFHSIZE
;
917 return (xdr_nfs_fh3_server(xdrs
, &fh
));
919 return (xdr_nfs_fh3_server(xdrs
, objp
));