1 /* vi: set sw=4 ts=4: */
3 * nfsmount.c -- Linux NFS mount
4 * Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * Wed Feb 8 12:51:48 1995, biro@yggdrasil.com (Ross Biro): allow all port
17 * numbers to be specified on the command line.
19 * Fri, 8 Mar 1996 18:01:39, Swen Thuemmler <swen@uni-paderborn.de>:
20 * Omit the call to connect() for Linux version 1.3.11 or later.
22 * Wed Oct 1 23:55:28 1997: Dick Streefland <dick_streefland@tasking.com>
23 * Implemented the "bg", "fg" and "retry" mount options for NFS.
25 * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
26 * - added Native Language Support
28 * Modified by Olaf Kirch and Trond Myklebust for new NFS code,
33 * nfsmount.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp
42 #include <rpc/pmap_prot.h>
43 #include <rpc/pmap_clnt.h>
44 #include <sys/socket.h>
46 #include <sys/utsname.h>
48 #include <netinet/in.h>
49 #include <arpa/inet.h>
52 #include <linux/nfs.h> /* For the kernels nfs stuff */
55 /* Disable the nls stuff */
56 # undef bindtextdomain
57 # define bindtextdomain(Domain, Directory) /* empty */
59 # define textdomain(Domain) /* empty */
60 # define _(Text) (Text)
61 # define N_(Text) (Text)
63 #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */
64 #define MS_RDONLY 1 /* Mount read-only */
65 #define MS_NOSUID 2 /* Ignore suid and sgid bits */
66 #define MS_NODEV 4 /* Disallow access to device special files */
67 #define MS_NOEXEC 8 /* Disallow program execution */
68 #define MS_SYNCHRONOUS 16 /* Writes are synced at once */
69 #define MS_REMOUNT 32 /* Alter flags of a mounted FS */
70 #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
71 #define S_QUOTA 128 /* Quota initialized for file/directory/symlink */
72 #define S_APPEND 256 /* Append-only file */
73 #define S_IMMUTABLE 512 /* Immutable file */
74 #define MS_NOATIME 1024 /* Do not update access times. */
75 #define MS_NODIRATIME 2048 /* Do not update directory access times */
79 * We want to be able to compile mount on old kernels in such a way
80 * that the binary will work well on more recent kernels.
81 * Thus, if necessary we teach nfsmount.c the structure of new fields
82 * that will come later.
84 * Moreover, the new kernel includes conflict with glibc includes
85 * so it is easiest to ignore the kernel altogether (at compile time).
88 #define NFS_MOUNT_VERSION 4
95 unsigned char data[64];
98 struct nfs_mount_data {
101 struct nfs2_fh old_root; /* 1 */
107 int acregmin; /* 1 */
108 int acregmax; /* 1 */
109 int acdirmin; /* 1 */
110 int acdirmax; /* 1 */
111 struct sockaddr_in addr; /* 1 */
112 char hostname[256]; /* 1 */
114 unsigned int bsize; /* 3 */
115 struct nfs3_fh root; /* 4 */
118 /* bits in the flags field */
120 #define NFS_MOUNT_SOFT 0x0001 /* 1 */
121 #define NFS_MOUNT_INTR 0x0002 /* 1 */
122 #define NFS_MOUNT_SECURE 0x0004 /* 1 */
123 #define NFS_MOUNT_POSIX 0x0008 /* 1 */
124 #define NFS_MOUNT_NOCTO 0x0010 /* 1 */
125 #define NFS_MOUNT_NOAC 0x0020 /* 1 */
126 #define NFS_MOUNT_TCP 0x0040 /* 2 */
127 #define NFS_MOUNT_VER3 0x0080 /* 3 */
128 #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
129 #define NFS_MOUNT_NONLM 0x0200 /* 3 */
132 #define UTIL_LINUX_VERSION "2.10m"
133 #define util_linux_version "util-linux-2.10m"
135 #define HAVE_inet_aton
140 #define HAVE_locale_h
141 #define HAVE_libintl_h
143 #define HAVE_langinfo_h
144 #define HAVE_progname
146 #define HAVE_nanosleep
147 #define HAVE_personality
148 #define HAVE_tm_gmtoff
150 extern char *xstrdup (const char *s);
151 extern char *xstrndup (const char *s, int n);
152 static char *nfs_strerror(int stat);
154 #define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
155 #define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
157 #define EX_FAIL 32 /* mount failure */
158 #define EX_BG 256 /* retry in background (internal only) */
162 linux_version_code(void) {
163 struct utsname my_utsname;
166 if (uname(&my_utsname) == 0) {
167 p = atoi(strtok(my_utsname.release, "."));
168 q = atoi(strtok(NULL, "."));
169 r = atoi(strtok(NULL, "."));
170 return MAKE_VERSION(p,q,r);
176 * nfs_mount_version according to the sources seen at compile time.
178 int nfs_mount_version = NFS_MOUNT_VERSION;
181 * Unfortunately, the kernel prints annoying console messages
182 * in case of an unexpected nfs mount version (instead of
183 * just returning some error). Therefore we'll have to try
184 * and figure out what version the kernel expects.
187 * KERNEL_NFS_MOUNT_VERSION: kernel sources at compile time
188 * NFS_MOUNT_VERSION: these nfsmount sources at compile time
189 * nfs_mount_version: version this source and running kernel can handle
192 find_kernel_nfs_mount_version(void) {
193 static int kernel_version = 0;
198 kernel_version = linux_version_code();
200 if (kernel_version) {
201 if (kernel_version < MAKE_VERSION(2,1,32))
202 nfs_mount_version = 1;
203 else if (kernel_version < MAKE_VERSION(2,3,99))
204 nfs_mount_version = 3;
206 nfs_mount_version = 4; /* since 2.3.99pre4 */
208 if (nfs_mount_version > NFS_MOUNT_VERSION)
209 nfs_mount_version = NFS_MOUNT_VERSION;
213 get_mountport(struct sockaddr_in *server_addr,
215 long unsigned version,
219 struct pmaplist *pmap;
220 static struct pmap p = {0, 0, 0, 0};
222 server_addr->sin_port = PMAPPORT;
223 pmap = pmap_getmaps(server_addr);
225 if (version > MAX_NFSPROT)
226 version = MAX_NFSPROT;
235 if (pmap->pml_map.pm_prog != prog)
237 if (!version && p.pm_vers > pmap->pml_map.pm_vers)
239 if (version > 2 && pmap->pml_map.pm_vers != version)
241 if (version && version <= 2 && pmap->pml_map.pm_vers > 2)
243 if (pmap->pml_map.pm_vers > MAX_NFSPROT ||
244 (proto && p.pm_prot && pmap->pml_map.pm_prot != proto) ||
245 (port && pmap->pml_map.pm_port != port))
247 memcpy(&p, &pmap->pml_map, sizeof(p));
249 pmap = pmap->pml_next;
252 p.pm_vers = MOUNTVERS;
254 p.pm_port = MOUNTPORT;
256 p.pm_prot = IPPROTO_TCP;
260 int nfsmount(const char *spec, const char *node, int *flags,
261 char **extra_opts, char **mount_opts, int running_bg)
263 static char *prev_bg_host;
269 char *mounthost=NULL;
271 struct timeval total_timeout;
272 enum clnt_stat clnt_stat;
273 static struct nfs_mount_data data;
277 struct sockaddr_in server_addr;
278 struct sockaddr_in mount_server_addr;
281 struct timeval retry_timeout;
283 struct fhstatus nfsv2;
284 struct mountres3 nfsv3;
309 find_kernel_nfs_mount_version();
314 if (strlen(spec) >= sizeof(hostdir)) {
315 errorMsg("excessively long host:dir argument\n");
318 strcpy(hostdir, spec);
319 if ((s = strchr(hostdir, ':'))) {
323 /* Ignore all but first hostname in replicated mounts
324 until they can be fully supported. (mack@sgi.com) */
325 if ((s = strchr(hostdir, ','))) {
327 errorMsg("warning: multiple hostnames not supported\n");
330 errorMsg("directory to mount not in host:dir format\n");
334 server_addr.sin_family = AF_INET;
335 #ifdef HAVE_inet_aton
336 if (!inet_aton(hostname, &server_addr.sin_addr))
339 if ((hp = gethostbyname(hostname)) == NULL) {
340 errorMsg("can't get address for %s\n", hostname);
343 if (hp->h_length > sizeof(struct in_addr)) {
344 errorMsg("got bad hp->h_length\n");
345 hp->h_length = sizeof(struct in_addr);
347 memcpy(&server_addr.sin_addr,
348 hp->h_addr, hp->h_length);
352 memcpy (&mount_server_addr, &server_addr, sizeof (mount_server_addr));
354 /* add IP address to mtab options for use when unmounting */
356 s = inet_ntoa(server_addr.sin_addr);
357 old_opts = *extra_opts;
360 if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
361 errorMsg("excessively long option argument\n");
364 sprintf(new_opts, "%s%saddr=%s",
365 old_opts, *old_opts ? "," : "", s);
366 *extra_opts = xstrdup(new_opts);
368 /* Set default options.
369 * rsize/wsize (and bsize, for ver >= 3) are left 0 in order to
370 * let the kernel decide.
371 * timeo is filled in after we know whether it'll be TCP or UDP. */
372 memset(&data, 0, sizeof(data));
378 #if NFS_MOUNT_VERSION >= 2
379 data.namlen = NAME_MAX;
389 retry = 10000; /* 10000 minutes ~ 1 week */
392 mountprog = MOUNTPROG;
396 nfsprog = NFS_PROGRAM;
401 for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
402 if ((opteq = strchr(opt, '='))) {
403 val = atoi(opteq + 1);
405 if (!strcmp(opt, "rsize"))
407 else if (!strcmp(opt, "wsize"))
409 else if (!strcmp(opt, "timeo"))
411 else if (!strcmp(opt, "retrans"))
413 else if (!strcmp(opt, "acregmin"))
415 else if (!strcmp(opt, "acregmax"))
417 else if (!strcmp(opt, "acdirmin"))
419 else if (!strcmp(opt, "acdirmax"))
421 else if (!strcmp(opt, "actimeo")) {
427 else if (!strcmp(opt, "retry"))
429 else if (!strcmp(opt, "port"))
431 else if (!strcmp(opt, "mountport"))
433 else if (!strcmp(opt, "mounthost"))
434 mounthost=xstrndup(opteq+1,
435 strcspn(opteq+1," \t\n\r,"));
436 else if (!strcmp(opt, "mountprog"))
438 else if (!strcmp(opt, "mountvers"))
440 else if (!strcmp(opt, "nfsprog"))
442 else if (!strcmp(opt, "nfsvers") ||
443 !strcmp(opt, "vers"))
445 else if (!strcmp(opt, "proto")) {
446 if (!strncmp(opteq+1, "tcp", 3))
448 else if (!strncmp(opteq+1, "udp", 3))
451 printf(_("Warning: Unrecognized proto= option.\n"));
452 } else if (!strcmp(opt, "namlen")) {
453 #if NFS_MOUNT_VERSION >= 2
454 if (nfs_mount_version >= 2)
458 printf(_("Warning: Option namlen is not supported.\n"));
459 } else if (!strcmp(opt, "addr"))
462 printf(_("unknown nfs mount parameter: "
463 "%s=%d\n"), opt, val);
469 if (!strncmp(opt, "no", 2)) {
473 if (!strcmp(opt, "bg"))
475 else if (!strcmp(opt, "fg"))
477 else if (!strcmp(opt, "soft"))
479 else if (!strcmp(opt, "hard"))
481 else if (!strcmp(opt, "intr"))
483 else if (!strcmp(opt, "posix"))
485 else if (!strcmp(opt, "cto"))
487 else if (!strcmp(opt, "ac"))
489 else if (!strcmp(opt, "tcp"))
491 else if (!strcmp(opt, "udp"))
493 else if (!strcmp(opt, "lock")) {
494 if (nfs_mount_version >= 3)
497 printf(_("Warning: option nolock is not supported.\n"));
499 printf(_("unknown nfs mount option: "
500 "%s%s\n"), val ? "" : "no", opt);
505 proto = (tcp) ? IPPROTO_TCP : IPPROTO_UDP;
507 data.flags = (soft ? NFS_MOUNT_SOFT : 0)
508 | (intr ? NFS_MOUNT_INTR : 0)
509 | (posix ? NFS_MOUNT_POSIX : 0)
510 | (nocto ? NFS_MOUNT_NOCTO : 0)
511 | (noac ? NFS_MOUNT_NOAC : 0);
512 #if NFS_MOUNT_VERSION >= 2
513 if (nfs_mount_version >= 2)
514 data.flags |= (tcp ? NFS_MOUNT_TCP : 0);
516 #if NFS_MOUNT_VERSION >= 3
517 if (nfs_mount_version >= 3)
518 data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
520 if (nfsvers > MAX_NFSPROT) {
521 errorMsg("NFSv%d not supported!\n", nfsvers);
524 if (mountvers > MAX_NFSPROT) {
525 errorMsg("NFSv%d not supported!\n", nfsvers);
528 if (nfsvers && !mountvers)
529 mountvers = (nfsvers < 3) ? 1 : nfsvers;
530 if (nfsvers && nfsvers < mountvers) {
534 /* Adjust options if none specified */
536 data.timeo = tcp ? 70 : 7;
538 #ifdef NFS_MOUNT_DEBUG
539 printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
540 data.rsize, data.wsize, data.timeo, data.retrans);
541 printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
542 data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
543 printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
544 port, bg, retry, data.flags);
545 printf("mountprog = %d, mountvers = %d, nfsprog = %d, nfsvers = %d\n",
546 mountprog, mountvers, nfsprog, nfsvers);
547 printf("soft = %d, intr = %d, posix = %d, nocto = %d, noac = %d\n",
548 (data.flags & NFS_MOUNT_SOFT) != 0,
549 (data.flags & NFS_MOUNT_INTR) != 0,
550 (data.flags & NFS_MOUNT_POSIX) != 0,
551 (data.flags & NFS_MOUNT_NOCTO) != 0,
552 (data.flags & NFS_MOUNT_NOAC) != 0);
553 #if NFS_MOUNT_VERSION >= 2
555 (data.flags & NFS_MOUNT_TCP) != 0);
559 data.version = nfs_mount_version;
560 *mount_opts = (char *) &data;
562 if (*flags & MS_REMOUNT)
566 * If the previous mount operation on the same host was
567 * backgrounded, and the "bg" for this mount is also set,
568 * give up immediately, to avoid the initial timeout.
570 if (bg && !running_bg &&
571 prev_bg_host && strcmp(hostname, prev_bg_host) == 0) {
577 /* create mount deamon client */
578 /* See if the nfs host = mount host. */
580 if (mounthost[0] >= '0' && mounthost[0] <= '9') {
581 mount_server_addr.sin_family = AF_INET;
582 mount_server_addr.sin_addr.s_addr = inet_addr(hostname);
584 if ((hp = gethostbyname(mounthost)) == NULL) {
585 errorMsg("can't get address for %s\n", hostname);
588 if (hp->h_length > sizeof(struct in_addr)) {
589 errorMsg("got bad hp->h_length?\n");
590 hp->h_length = sizeof(struct in_addr);
592 mount_server_addr.sin_family = AF_INET;
593 memcpy(&mount_server_addr.sin_addr,
594 hp->h_addr, hp->h_length);
600 * The following loop implements the mount retries. On the first
601 * call, "running_bg" is 0. When the mount times out, and the
602 * "bg" option is set, the exit status EX_BG will be returned.
603 * For a backgrounded mount, there will be a second call by the
604 * child process with "running_bg" set to 1.
606 * The case where the mount point is not present and the "bg"
607 * option is set, is treated as a timeout. This is done to
608 * support nested mounts.
610 * The "retry" count specified by the user is the number of
611 * minutes to retry before giving up.
613 * Only the first error message will be displayed.
615 retry_timeout.tv_sec = 3;
616 retry_timeout.tv_usec = 0;
617 total_timeout.tv_sec = 20;
618 total_timeout.tv_usec = 0;
619 timeout = time(NULL) + 60 * retry;
624 if (bg && stat(node, &statbuf) == -1) {
626 sleep(val); /* 1, 2, 4, 8, 16, 30, ... */
632 /* be careful not to use too many CPU cycles */
636 pm_mnt = get_mountport(&mount_server_addr,
642 /* contact the mount daemon via TCP */
643 mount_server_addr.sin_port = htons(pm_mnt->pm_port);
646 switch (pm_mnt->pm_prot) {
648 mclient = clntudp_create(&mount_server_addr,
655 mount_server_addr.sin_port = htons(pm_mnt->pm_port);
658 mclient = clnttcp_create(&mount_server_addr,
667 /* try to mount hostname:dirname */
668 mclient->cl_auth = authunix_create_default();
670 /* make pointers in xdr_mountres3 NULL so
671 * that xdr_array allocates memory for us
673 memset(&status, 0, sizeof(status));
675 if (pm_mnt->pm_vers == 3)
676 clnt_stat = clnt_call(mclient, MOUNTPROC3_MNT,
677 (xdrproc_t) xdr_dirpath,
679 (xdrproc_t) xdr_mountres3,
683 clnt_stat = clnt_call(mclient, MOUNTPROC_MNT,
684 (xdrproc_t) xdr_dirpath,
686 (xdrproc_t) xdr_fhstatus,
690 if (clnt_stat == RPC_SUCCESS)
691 break; /* we're done */
692 if (errno != ECONNREFUSED) {
693 clnt_perror(mclient, "mount");
694 goto fail; /* don't retry */
696 if (!running_bg && prevt == 0)
697 clnt_perror(mclient, "mount");
698 auth_destroy(mclient->cl_auth);
699 clnt_destroy(mclient);
703 if (!running_bg && prevt == 0)
704 clnt_pcreateerror("mount");
711 prev_bg_host = xstrdup(hostname);
720 nfsvers = (pm_mnt->pm_vers < 2) ? 2 : pm_mnt->pm_vers;
723 if (status.nfsv2.fhs_status != 0) {
724 errorMsg("%s:%s failed, reason given by server: %s\n",
726 nfs_strerror(status.nfsv2.fhs_status));
729 memcpy(data.root.data,
730 (char *) status.nfsv2.fhstatus_u.fhs_fhandle,
732 #if NFS_MOUNT_VERSION >= 4
733 data.root.size = NFS_FHSIZE;
734 memcpy(data.old_root.data,
735 (char *) status.nfsv2.fhstatus_u.fhs_fhandle,
739 #if NFS_MOUNT_VERSION >= 4
741 if (status.nfsv3.fhs_status != 0) {
742 errorMsg("%s:%s failed, reason given by server: %s\n",
744 nfs_strerror(status.nfsv3.fhs_status));
747 fhandle = &status.nfsv3.mountres3_u.mountinfo.fhandle;
748 memset(data.old_root.data, 0, NFS_FHSIZE);
749 memset(&data.root, 0, sizeof(data.root));
750 data.root.size = fhandle->fhandle3_len;
751 memcpy(data.root.data,
752 (char *) fhandle->fhandle3_val,
753 fhandle->fhandle3_len);
755 data.flags |= NFS_MOUNT_VER3;
759 /* create nfs socket for kernel */
762 if (nfs_mount_version < 3) {
763 printf(_("NFS over TCP is not supported.\n"));
766 fsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
768 fsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
770 perror(_("nfs socket"));
773 if (bindresvport(fsock, 0) < 0) {
774 perror(_("nfs bindresvport"));
778 server_addr.sin_port = PMAPPORT;
779 port = pmap_getport(&server_addr, nfsprog, nfsvers,
780 tcp ? IPPROTO_TCP : IPPROTO_UDP);
783 #ifdef NFS_MOUNT_DEBUG
785 printf(_("used portmapper to find NFS port\n"));
788 #ifdef NFS_MOUNT_DEBUG
789 printf(_("using port %d for nfs deamon\n"), port);
791 server_addr.sin_port = htons(port);
793 * connect() the socket for kernels 1.3.10 and below only,
794 * to avoid problems with multihomed hosts.
797 if (linux_version_code() <= 66314
798 && connect(fsock, (struct sockaddr *) &server_addr,
799 sizeof (server_addr)) < 0) {
800 perror(_("nfs connect"));
804 /* prepare data structure for kernel */
807 memcpy((char *) &data.addr, (char *) &server_addr, sizeof(data.addr));
808 strncpy(data.hostname, hostname, sizeof(data.hostname));
812 auth_destroy(mclient->cl_auth);
813 clnt_destroy(mclient);
822 auth_destroy(mclient->cl_auth);
823 clnt_destroy(mclient);
833 * We need to translate between nfs status return values and
834 * the local errno values which may not be the same.
836 * Andreas Schwab <schwab@LS5.informatik.uni-dortmund.de>: change errno:
837 * "after #include <errno.h> the symbol errno is reserved for any use,
838 * it cannot even be used as a struct tag or field name".
842 #define EDQUOT ENOSPC
850 { NFSERR_PERM, EPERM },
851 { NFSERR_NOENT, ENOENT },
853 { NFSERR_NXIO, ENXIO },
854 { NFSERR_ACCES, EACCES },
855 { NFSERR_EXIST, EEXIST },
856 { NFSERR_NODEV, ENODEV },
857 { NFSERR_NOTDIR, ENOTDIR },
858 { NFSERR_ISDIR, EISDIR },
860 { NFSERR_INVAL, EINVAL }, /* that Sun forgot */
862 { NFSERR_FBIG, EFBIG },
863 { NFSERR_NOSPC, ENOSPC },
864 { NFSERR_ROFS, EROFS },
865 { NFSERR_NAMETOOLONG, ENAMETOOLONG },
866 { NFSERR_NOTEMPTY, ENOTEMPTY },
867 { NFSERR_DQUOT, EDQUOT },
868 { NFSERR_STALE, ESTALE },
870 { NFSERR_WFLUSH, EWFLUSH },
872 /* Throw in some NFSv3 values for even more fun (HP returns these) */
878 static char *nfs_strerror(int stat)
881 static char buf[256];
883 for (i = 0; nfs_errtbl[i].stat != -1; i++) {
884 if (nfs_errtbl[i].stat == stat)
885 return strerror(nfs_errtbl[i].errnum);
887 sprintf(buf, _("unknown nfs status return value: %d"), stat);
892 xdr_fhandle (XDR *xdrs, fhandle objp)
894 //register int32_t *buf;
896 if (!xdr_opaque (xdrs, objp, FHSIZE))
902 xdr_fhstatus (XDR *xdrs, fhstatus *objp)
904 //register int32_t *buf;
906 if (!xdr_u_int (xdrs, &objp->fhs_status))
908 switch (objp->fhs_status) {
910 if (!xdr_fhandle (xdrs, objp->fhstatus_u.fhs_fhandle))
920 xdr_dirpath (XDR *xdrs, dirpath *objp)
922 //register int32_t *buf;
924 if (!xdr_string (xdrs, objp, MNTPATHLEN))
930 xdr_fhandle3 (XDR *xdrs, fhandle3 *objp)
932 //register int32_t *buf;
934 if (!xdr_bytes (xdrs, (char **)&objp->fhandle3_val, (u_int *) &objp->fhandle3_len, FHSIZE3))
940 xdr_mountres3_ok (XDR *xdrs, mountres3_ok *objp)
942 //register int32_t *buf;
944 if (!xdr_fhandle3 (xdrs, &objp->fhandle))
946 if (!xdr_array (xdrs, (char **)&objp->auth_flavours.auth_flavours_val, (u_int *) &objp->auth_flavours.auth_flavours_len, ~0,
947 sizeof (int), (xdrproc_t) xdr_int))
953 xdr_mountstat3 (XDR *xdrs, mountstat3 *objp)
955 //register int32_t *buf;
957 if (!xdr_enum (xdrs, (enum_t *) objp))
963 xdr_mountres3 (XDR *xdrs, mountres3 *objp)
965 //register int32_t *buf;
967 if (!xdr_mountstat3 (xdrs, &objp->fhs_status))
969 switch (objp->fhs_status) {
971 if (!xdr_mountres3_ok (xdrs, &objp->mountres3_u.mountinfo))