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
45 #include <rpc/pmap_prot.h>
46 #include <rpc/pmap_clnt.h>
47 #include <sys/socket.h>
49 #include <sys/utsname.h>
51 #include <netinet/in.h>
52 #include <arpa/inet.h>
55 #include <linux/nfs.h> /* For the kernels nfs stuff */
58 /* Disable the nls stuff */
59 # undef bindtextdomain
60 # define bindtextdomain(Domain, Directory) /* empty */
62 # define textdomain(Domain) /* empty */
63 # define _(Text) (Text)
64 # define N_(Text) (Text)
66 #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */
67 #define MS_RDONLY 1 /* Mount read-only */
68 #define MS_NOSUID 2 /* Ignore suid and sgid bits */
69 #define MS_NODEV 4 /* Disallow access to device special files */
70 #define MS_NOEXEC 8 /* Disallow program execution */
71 #define MS_SYNCHRONOUS 16 /* Writes are synced at once */
72 #define MS_REMOUNT 32 /* Alter flags of a mounted FS */
73 #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
74 #define S_QUOTA 128 /* Quota initialized for file/directory/symlink */
75 #define S_APPEND 256 /* Append-only file */
76 #define S_IMMUTABLE 512 /* Immutable file */
77 #define MS_NOATIME 1024 /* Do not update access times. */
78 #define MS_NODIRATIME 2048 /* Do not update directory access times */
82 * We want to be able to compile mount on old kernels in such a way
83 * that the binary will work well on more recent kernels.
84 * Thus, if necessary we teach nfsmount.c the structure of new fields
85 * that will come later.
87 * Moreover, the new kernel includes conflict with glibc includes
88 * so it is easiest to ignore the kernel altogether (at compile time).
91 #define NFS_MOUNT_VERSION 4
98 unsigned char data[64];
101 struct nfs_mount_data {
104 struct nfs2_fh old_root; /* 1 */
110 int acregmin; /* 1 */
111 int acregmax; /* 1 */
112 int acdirmin; /* 1 */
113 int acdirmax; /* 1 */
114 struct sockaddr_in addr; /* 1 */
115 char hostname[256]; /* 1 */
117 unsigned int bsize; /* 3 */
118 struct nfs3_fh root; /* 4 */
121 /* bits in the flags field */
123 #define NFS_MOUNT_SOFT 0x0001 /* 1 */
124 #define NFS_MOUNT_INTR 0x0002 /* 1 */
125 #define NFS_MOUNT_SECURE 0x0004 /* 1 */
126 #define NFS_MOUNT_POSIX 0x0008 /* 1 */
127 #define NFS_MOUNT_NOCTO 0x0010 /* 1 */
128 #define NFS_MOUNT_NOAC 0x0020 /* 1 */
129 #define NFS_MOUNT_TCP 0x0040 /* 2 */
130 #define NFS_MOUNT_VER3 0x0080 /* 3 */
131 #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
132 #define NFS_MOUNT_NONLM 0x0200 /* 3 */
135 #define UTIL_LINUX_VERSION "2.10m"
136 #define util_linux_version "util-linux-2.10m"
138 #define HAVE_inet_aton
143 #define HAVE_locale_h
144 #define HAVE_libintl_h
146 #define HAVE_langinfo_h
147 #define HAVE_progname
149 #define HAVE_nanosleep
150 #define HAVE_personality
151 #define HAVE_tm_gmtoff
153 extern char *xstrdup (const char *s);
154 extern char *xstrndup (const char *s, int n);
155 static char *nfs_strerror(int stat);
157 #define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
158 #define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
160 #define EX_FAIL 32 /* mount failure */
161 #define EX_BG 256 /* retry in background (internal only) */
165 linux_version_code(void) {
166 struct utsname my_utsname;
169 if (uname(&my_utsname) == 0) {
170 p = atoi(strtok(my_utsname.release, "."));
171 q = atoi(strtok(NULL, "."));
172 r = atoi(strtok(NULL, "."));
173 return MAKE_VERSION(p,q,r);
179 * nfs_mount_version according to the sources seen at compile time.
181 int nfs_mount_version = NFS_MOUNT_VERSION;
184 * Unfortunately, the kernel prints annoying console messages
185 * in case of an unexpected nfs mount version (instead of
186 * just returning some error). Therefore we'll have to try
187 * and figure out what version the kernel expects.
190 * KERNEL_NFS_MOUNT_VERSION: kernel sources at compile time
191 * NFS_MOUNT_VERSION: these nfsmount sources at compile time
192 * nfs_mount_version: version this source and running kernel can handle
195 find_kernel_nfs_mount_version(void) {
196 static int kernel_version = 0;
201 kernel_version = linux_version_code();
203 if (kernel_version) {
204 if (kernel_version < MAKE_VERSION(2,1,32))
205 nfs_mount_version = 1;
206 else if (kernel_version < MAKE_VERSION(2,3,99))
207 nfs_mount_version = 3;
209 nfs_mount_version = 4; /* since 2.3.99pre4 */
211 if (nfs_mount_version > NFS_MOUNT_VERSION)
212 nfs_mount_version = NFS_MOUNT_VERSION;
216 get_mountport(struct sockaddr_in *server_addr,
218 long unsigned version,
222 struct pmaplist *pmap;
223 static struct pmap p = {0, 0, 0, 0};
225 server_addr->sin_port = PMAPPORT;
226 pmap = pmap_getmaps(server_addr);
228 if (version > MAX_NFSPROT)
229 version = MAX_NFSPROT;
238 if (pmap->pml_map.pm_prog != prog)
240 if (!version && p.pm_vers > pmap->pml_map.pm_vers)
242 if (version > 2 && pmap->pml_map.pm_vers != version)
244 if (version && version <= 2 && pmap->pml_map.pm_vers > 2)
246 if (pmap->pml_map.pm_vers > MAX_NFSPROT ||
247 (proto && p.pm_prot && pmap->pml_map.pm_prot != proto) ||
248 (port && pmap->pml_map.pm_port != port))
250 memcpy(&p, &pmap->pml_map, sizeof(p));
252 pmap = pmap->pml_next;
255 p.pm_vers = MOUNTVERS;
257 p.pm_port = MOUNTPORT;
259 p.pm_prot = IPPROTO_TCP;
263 int nfsmount(const char *spec, const char *node, int *flags,
264 char **extra_opts, char **mount_opts, int running_bg)
266 static char *prev_bg_host;
272 char *mounthost=NULL;
274 struct timeval total_timeout;
275 enum clnt_stat clnt_stat;
276 static struct nfs_mount_data data;
280 struct sockaddr_in server_addr;
281 struct sockaddr_in mount_server_addr;
284 struct timeval retry_timeout;
286 struct fhstatus nfsv2;
287 struct mountres3 nfsv3;
312 find_kernel_nfs_mount_version();
317 if (strlen(spec) >= sizeof(hostdir)) {
318 errorMsg("excessively long host:dir argument\n");
321 strcpy(hostdir, spec);
322 if ((s = strchr(hostdir, ':'))) {
326 /* Ignore all but first hostname in replicated mounts
327 until they can be fully supported. (mack@sgi.com) */
328 if ((s = strchr(hostdir, ','))) {
330 errorMsg("warning: multiple hostnames not supported\n");
333 errorMsg("directory to mount not in host:dir format\n");
337 server_addr.sin_family = AF_INET;
338 #ifdef HAVE_inet_aton
339 if (!inet_aton(hostname, &server_addr.sin_addr))
342 if ((hp = gethostbyname(hostname)) == NULL) {
343 errorMsg("can't get address for %s\n", hostname);
346 if (hp->h_length > sizeof(struct in_addr)) {
347 errorMsg("got bad hp->h_length\n");
348 hp->h_length = sizeof(struct in_addr);
350 memcpy(&server_addr.sin_addr,
351 hp->h_addr, hp->h_length);
355 memcpy (&mount_server_addr, &server_addr, sizeof (mount_server_addr));
357 /* add IP address to mtab options for use when unmounting */
359 s = inet_ntoa(server_addr.sin_addr);
360 old_opts = *extra_opts;
363 if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
364 errorMsg("excessively long option argument\n");
367 sprintf(new_opts, "%s%saddr=%s",
368 old_opts, *old_opts ? "," : "", s);
369 *extra_opts = xstrdup(new_opts);
371 /* Set default options.
372 * rsize/wsize (and bsize, for ver >= 3) are left 0 in order to
373 * let the kernel decide.
374 * timeo is filled in after we know whether it'll be TCP or UDP. */
375 memset(&data, 0, sizeof(data));
381 #if NFS_MOUNT_VERSION >= 2
382 data.namlen = NAME_MAX;
392 retry = 10000; /* 10000 minutes ~ 1 week */
395 mountprog = MOUNTPROG;
399 nfsprog = NFS_PROGRAM;
404 for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
405 if ((opteq = strchr(opt, '='))) {
406 val = atoi(opteq + 1);
408 if (!strcmp(opt, "rsize"))
410 else if (!strcmp(opt, "wsize"))
412 else if (!strcmp(opt, "timeo"))
414 else if (!strcmp(opt, "retrans"))
416 else if (!strcmp(opt, "acregmin"))
418 else if (!strcmp(opt, "acregmax"))
420 else if (!strcmp(opt, "acdirmin"))
422 else if (!strcmp(opt, "acdirmax"))
424 else if (!strcmp(opt, "actimeo")) {
430 else if (!strcmp(opt, "retry"))
432 else if (!strcmp(opt, "port"))
434 else if (!strcmp(opt, "mountport"))
436 else if (!strcmp(opt, "mounthost"))
437 mounthost=xstrndup(opteq+1,
438 strcspn(opteq+1," \t\n\r,"));
439 else if (!strcmp(opt, "mountprog"))
441 else if (!strcmp(opt, "mountvers"))
443 else if (!strcmp(opt, "nfsprog"))
445 else if (!strcmp(opt, "nfsvers") ||
446 !strcmp(opt, "vers"))
448 else if (!strcmp(opt, "proto")) {
449 if (!strncmp(opteq+1, "tcp", 3))
451 else if (!strncmp(opteq+1, "udp", 3))
454 printf(_("Warning: Unrecognized proto= option.\n"));
455 } else if (!strcmp(opt, "namlen")) {
456 #if NFS_MOUNT_VERSION >= 2
457 if (nfs_mount_version >= 2)
461 printf(_("Warning: Option namlen is not supported.\n"));
462 } else if (!strcmp(opt, "addr"))
465 printf(_("unknown nfs mount parameter: "
466 "%s=%d\n"), opt, val);
472 if (!strncmp(opt, "no", 2)) {
476 if (!strcmp(opt, "bg"))
478 else if (!strcmp(opt, "fg"))
480 else if (!strcmp(opt, "soft"))
482 else if (!strcmp(opt, "hard"))
484 else if (!strcmp(opt, "intr"))
486 else if (!strcmp(opt, "posix"))
488 else if (!strcmp(opt, "cto"))
490 else if (!strcmp(opt, "ac"))
492 else if (!strcmp(opt, "tcp"))
494 else if (!strcmp(opt, "udp"))
496 else if (!strcmp(opt, "lock")) {
497 if (nfs_mount_version >= 3)
500 printf(_("Warning: option nolock is not supported.\n"));
502 printf(_("unknown nfs mount option: "
503 "%s%s\n"), val ? "" : "no", opt);
508 proto = (tcp) ? IPPROTO_TCP : IPPROTO_UDP;
510 data.flags = (soft ? NFS_MOUNT_SOFT : 0)
511 | (intr ? NFS_MOUNT_INTR : 0)
512 | (posix ? NFS_MOUNT_POSIX : 0)
513 | (nocto ? NFS_MOUNT_NOCTO : 0)
514 | (noac ? NFS_MOUNT_NOAC : 0);
515 #if NFS_MOUNT_VERSION >= 2
516 if (nfs_mount_version >= 2)
517 data.flags |= (tcp ? NFS_MOUNT_TCP : 0);
519 #if NFS_MOUNT_VERSION >= 3
520 if (nfs_mount_version >= 3)
521 data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
523 if (nfsvers > MAX_NFSPROT) {
524 errorMsg("NFSv%d not supported!\n", nfsvers);
527 if (mountvers > MAX_NFSPROT) {
528 errorMsg("NFSv%d not supported!\n", nfsvers);
531 if (nfsvers && !mountvers)
532 mountvers = (nfsvers < 3) ? 1 : nfsvers;
533 if (nfsvers && nfsvers < mountvers) {
537 /* Adjust options if none specified */
539 data.timeo = tcp ? 70 : 7;
541 #ifdef NFS_MOUNT_DEBUG
542 printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
543 data.rsize, data.wsize, data.timeo, data.retrans);
544 printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
545 data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
546 printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
547 port, bg, retry, data.flags);
548 printf("mountprog = %d, mountvers = %d, nfsprog = %d, nfsvers = %d\n",
549 mountprog, mountvers, nfsprog, nfsvers);
550 printf("soft = %d, intr = %d, posix = %d, nocto = %d, noac = %d\n",
551 (data.flags & NFS_MOUNT_SOFT) != 0,
552 (data.flags & NFS_MOUNT_INTR) != 0,
553 (data.flags & NFS_MOUNT_POSIX) != 0,
554 (data.flags & NFS_MOUNT_NOCTO) != 0,
555 (data.flags & NFS_MOUNT_NOAC) != 0);
556 #if NFS_MOUNT_VERSION >= 2
558 (data.flags & NFS_MOUNT_TCP) != 0);
562 data.version = nfs_mount_version;
563 *mount_opts = (char *) &data;
565 if (*flags & MS_REMOUNT)
569 * If the previous mount operation on the same host was
570 * backgrounded, and the "bg" for this mount is also set,
571 * give up immediately, to avoid the initial timeout.
573 if (bg && !running_bg &&
574 prev_bg_host && strcmp(hostname, prev_bg_host) == 0) {
580 /* create mount deamon client */
581 /* See if the nfs host = mount host. */
583 if (mounthost[0] >= '0' && mounthost[0] <= '9') {
584 mount_server_addr.sin_family = AF_INET;
585 mount_server_addr.sin_addr.s_addr = inet_addr(hostname);
587 if ((hp = gethostbyname(mounthost)) == NULL) {
588 errorMsg("can't get address for %s\n", hostname);
591 if (hp->h_length > sizeof(struct in_addr)) {
592 errorMsg("got bad hp->h_length?\n");
593 hp->h_length = sizeof(struct in_addr);
595 mount_server_addr.sin_family = AF_INET;
596 memcpy(&mount_server_addr.sin_addr,
597 hp->h_addr, hp->h_length);
603 * The following loop implements the mount retries. On the first
604 * call, "running_bg" is 0. When the mount times out, and the
605 * "bg" option is set, the exit status EX_BG will be returned.
606 * For a backgrounded mount, there will be a second call by the
607 * child process with "running_bg" set to 1.
609 * The case where the mount point is not present and the "bg"
610 * option is set, is treated as a timeout. This is done to
611 * support nested mounts.
613 * The "retry" count specified by the user is the number of
614 * minutes to retry before giving up.
616 * Only the first error message will be displayed.
618 retry_timeout.tv_sec = 3;
619 retry_timeout.tv_usec = 0;
620 total_timeout.tv_sec = 20;
621 total_timeout.tv_usec = 0;
622 timeout = time(NULL) + 60 * retry;
627 if (bg && stat(node, &statbuf) == -1) {
629 sleep(val); /* 1, 2, 4, 8, 16, 30, ... */
635 /* be careful not to use too many CPU cycles */
639 pm_mnt = get_mountport(&mount_server_addr,
645 /* contact the mount daemon via TCP */
646 mount_server_addr.sin_port = htons(pm_mnt->pm_port);
649 switch (pm_mnt->pm_prot) {
651 mclient = clntudp_create(&mount_server_addr,
658 mount_server_addr.sin_port = htons(pm_mnt->pm_port);
661 mclient = clnttcp_create(&mount_server_addr,
670 /* try to mount hostname:dirname */
671 mclient->cl_auth = authunix_create_default();
673 /* make pointers in xdr_mountres3 NULL so
674 * that xdr_array allocates memory for us
676 memset(&status, 0, sizeof(status));
678 if (pm_mnt->pm_vers == 3)
679 clnt_stat = clnt_call(mclient, MOUNTPROC3_MNT,
680 (xdrproc_t) xdr_dirpath,
682 (xdrproc_t) xdr_mountres3,
686 clnt_stat = clnt_call(mclient, MOUNTPROC_MNT,
687 (xdrproc_t) xdr_dirpath,
689 (xdrproc_t) xdr_fhstatus,
693 if (clnt_stat == RPC_SUCCESS)
694 break; /* we're done */
695 if (errno != ECONNREFUSED) {
696 clnt_perror(mclient, "mount");
697 goto fail; /* don't retry */
699 if (!running_bg && prevt == 0)
700 clnt_perror(mclient, "mount");
701 auth_destroy(mclient->cl_auth);
702 clnt_destroy(mclient);
706 if (!running_bg && prevt == 0)
707 clnt_pcreateerror("mount");
714 prev_bg_host = xstrdup(hostname);
723 nfsvers = (pm_mnt->pm_vers < 2) ? 2 : pm_mnt->pm_vers;
726 if (status.nfsv2.fhs_status != 0) {
727 errorMsg("%s:%s failed, reason given by server: %s\n",
729 nfs_strerror(status.nfsv2.fhs_status));
732 memcpy(data.root.data,
733 (char *) status.nfsv2.fhstatus_u.fhs_fhandle,
735 #if NFS_MOUNT_VERSION >= 4
736 data.root.size = NFS_FHSIZE;
737 memcpy(data.old_root.data,
738 (char *) status.nfsv2.fhstatus_u.fhs_fhandle,
742 #if NFS_MOUNT_VERSION >= 4
744 if (status.nfsv3.fhs_status != 0) {
745 errorMsg("%s:%s failed, reason given by server: %s\n",
747 nfs_strerror(status.nfsv3.fhs_status));
750 fhandle = &status.nfsv3.mountres3_u.mountinfo.fhandle;
751 memset(data.old_root.data, 0, NFS_FHSIZE);
752 memset(&data.root, 0, sizeof(data.root));
753 data.root.size = fhandle->fhandle3_len;
754 memcpy(data.root.data,
755 (char *) fhandle->fhandle3_val,
756 fhandle->fhandle3_len);
758 data.flags |= NFS_MOUNT_VER3;
762 /* create nfs socket for kernel */
765 if (nfs_mount_version < 3) {
766 printf(_("NFS over TCP is not supported.\n"));
769 fsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
771 fsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
773 perror(_("nfs socket"));
776 if (bindresvport(fsock, 0) < 0) {
777 perror(_("nfs bindresvport"));
781 server_addr.sin_port = PMAPPORT;
782 port = pmap_getport(&server_addr, nfsprog, nfsvers,
783 tcp ? IPPROTO_TCP : IPPROTO_UDP);
786 #ifdef NFS_MOUNT_DEBUG
788 printf(_("used portmapper to find NFS port\n"));
791 #ifdef NFS_MOUNT_DEBUG
792 printf(_("using port %d for nfs deamon\n"), port);
794 server_addr.sin_port = htons(port);
796 * connect() the socket for kernels 1.3.10 and below only,
797 * to avoid problems with multihomed hosts.
800 if (linux_version_code() <= 66314
801 && connect(fsock, (struct sockaddr *) &server_addr,
802 sizeof (server_addr)) < 0) {
803 perror(_("nfs connect"));
807 /* prepare data structure for kernel */
810 memcpy((char *) &data.addr, (char *) &server_addr, sizeof(data.addr));
811 strncpy(data.hostname, hostname, sizeof(data.hostname));
815 auth_destroy(mclient->cl_auth);
816 clnt_destroy(mclient);
825 auth_destroy(mclient->cl_auth);
826 clnt_destroy(mclient);
836 * We need to translate between nfs status return values and
837 * the local errno values which may not be the same.
839 * Andreas Schwab <schwab@LS5.informatik.uni-dortmund.de>: change errno:
840 * "after #include <errno.h> the symbol errno is reserved for any use,
841 * it cannot even be used as a struct tag or field name".
845 #define EDQUOT ENOSPC
853 { NFSERR_PERM, EPERM },
854 { NFSERR_NOENT, ENOENT },
856 { NFSERR_NXIO, ENXIO },
857 { NFSERR_ACCES, EACCES },
858 { NFSERR_EXIST, EEXIST },
859 { NFSERR_NODEV, ENODEV },
860 { NFSERR_NOTDIR, ENOTDIR },
861 { NFSERR_ISDIR, EISDIR },
863 { NFSERR_INVAL, EINVAL }, /* that Sun forgot */
865 { NFSERR_FBIG, EFBIG },
866 { NFSERR_NOSPC, ENOSPC },
867 { NFSERR_ROFS, EROFS },
868 { NFSERR_NAMETOOLONG, ENAMETOOLONG },
869 { NFSERR_NOTEMPTY, ENOTEMPTY },
870 { NFSERR_DQUOT, EDQUOT },
871 { NFSERR_STALE, ESTALE },
873 { NFSERR_WFLUSH, EWFLUSH },
875 /* Throw in some NFSv3 values for even more fun (HP returns these) */
881 static char *nfs_strerror(int stat)
884 static char buf[256];
886 for (i = 0; nfs_errtbl[i].stat != -1; i++) {
887 if (nfs_errtbl[i].stat == stat)
888 return strerror(nfs_errtbl[i].errnum);
890 sprintf(buf, _("unknown nfs status return value: %d"), stat);
895 xdr_fhandle (XDR *xdrs, fhandle objp)
897 //register int32_t *buf;
899 if (!xdr_opaque (xdrs, objp, FHSIZE))
905 xdr_fhstatus (XDR *xdrs, fhstatus *objp)
907 //register int32_t *buf;
909 if (!xdr_u_int (xdrs, &objp->fhs_status))
911 switch (objp->fhs_status) {
913 if (!xdr_fhandle (xdrs, objp->fhstatus_u.fhs_fhandle))
923 xdr_dirpath (XDR *xdrs, dirpath *objp)
925 //register int32_t *buf;
927 if (!xdr_string (xdrs, objp, MNTPATHLEN))
933 xdr_fhandle3 (XDR *xdrs, fhandle3 *objp)
935 //register int32_t *buf;
937 if (!xdr_bytes (xdrs, (char **)&objp->fhandle3_val, (u_int *) &objp->fhandle3_len, FHSIZE3))
943 xdr_mountres3_ok (XDR *xdrs, mountres3_ok *objp)
945 //register int32_t *buf;
947 if (!xdr_fhandle3 (xdrs, &objp->fhandle))
949 if (!xdr_array (xdrs, (char **)&objp->auth_flavours.auth_flavours_val, (u_int *) &objp->auth_flavours.auth_flavours_len, ~0,
950 sizeof (int), (xdrproc_t) xdr_int))
956 xdr_mountstat3 (XDR *xdrs, mountstat3 *objp)
958 //register int32_t *buf;
960 if (!xdr_enum (xdrs, (enum_t *) objp))
966 xdr_mountres3 (XDR *xdrs, mountres3 *objp)
968 //register int32_t *buf;
970 if (!xdr_mountstat3 (xdrs, &objp->fhs_status))
972 switch (objp->fhs_status) {
974 if (!xdr_mountres3_ok (xdrs, &objp->mountres3_u.mountinfo))