mount_fs.c revision 131706
190792Sgshapiro/*
2261194Sgshapiro * Copyright (c) 1997-2004 Erez Zadok
390792Sgshapiro * Copyright (c) 1990 Jan-Simon Pendry
490792Sgshapiro * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
590792Sgshapiro * Copyright (c) 1990 The Regents of the University of California.
690792Sgshapiro * All rights reserved.
790792Sgshapiro *
890792Sgshapiro * This code is derived from software contributed to Berkeley by
990792Sgshapiro * Jan-Simon Pendry at Imperial College, London.
1090792Sgshapiro *
11266527Sgshapiro * Redistribution and use in source and binary forms, with or without
1290792Sgshapiro * modification, are permitted provided that the following conditions
1390792Sgshapiro * are met:
1490792Sgshapiro * 1. Redistributions of source code must retain the above copyright
1590792Sgshapiro *    notice, this list of conditions and the following disclaimer.
1690792Sgshapiro * 2. Redistributions in binary form must reproduce the above copyright
1790792Sgshapiro *    notice, this list of conditions and the following disclaimer in the
1890792Sgshapiro *    documentation and/or other materials provided with the distribution.
1990792Sgshapiro * 3. All advertising materials mentioning features or use of this software
2090792Sgshapiro *    must display the following acknowledgment:
2190792Sgshapiro *      This product includes software developed by the University of
2290792Sgshapiro *      California, Berkeley and its contributors.
2390792Sgshapiro * 4. Neither the name of the University nor the names of its contributors
2490792Sgshapiro *    may be used to endorse or promote products derived from this software
2590792Sgshapiro *    without specific prior written permission.
2690792Sgshapiro *
2790792Sgshapiro * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2890792Sgshapiro * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2990792Sgshapiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3090792Sgshapiro * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3190792Sgshapiro * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3290792Sgshapiro * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3390792Sgshapiro * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3490792Sgshapiro * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3590792Sgshapiro * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3690792Sgshapiro * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3790792Sgshapiro * SUCH DAMAGE.
3890792Sgshapiro *
3990792Sgshapiro *      %W% (Berkeley) %G%
4090792Sgshapiro *
4190792Sgshapiro * $Id: mount_fs.c,v 1.11.2.12 2004/01/06 03:15:24 ezk Exp $
4290792Sgshapiro * $FreeBSD: head/contrib/amd/libamu/mount_fs.c 131706 2004-07-06 13:16:49Z mbr $
4390792Sgshapiro *
4490792Sgshapiro */
4590792Sgshapiro
4690792Sgshapiro#ifdef HAVE_CONFIG_H
47# include <config.h>
48#endif /* HAVE_CONFIG_H */
49#include <am_defs.h>
50#include <amu.h>
51
52
53/* ensure that mount table options are delimited by a comma */
54#define append_opts(old, new) { \
55	if (*(old) != '\0') strcat(old, ","); \
56	strcat(old, new); }
57
58/*
59 * Standard mount flags
60 */
61struct opt_tab mnt_flags[] =
62{
63#if defined(MNT2_GEN_OPT_RDONLY) && defined(MNTTAB_OPT_RO)
64  {MNTTAB_OPT_RO, MNT2_GEN_OPT_RDONLY},
65#endif /* defined(MNT2_GEN_OPT_RDONLY) && defined(MNTTAB_OPT_RO) */
66
67#if defined(MNT2_GEN_OPT_NOCACHE) && defined(MNTTAB_OPT_NOCACHE)
68  {MNTTAB_OPT_NOCACHE, MNT2_GEN_OPT_NOCACHE},
69#endif /* defined(MNT2_GEN_OPT_NOCACHE) && defined(MNTTAB_OPT_NOCACHE) */
70
71  /* the "grpid" mount option can be offered as generic of NFS */
72#ifdef MNTTAB_OPT_GRPID
73# ifdef MNT2_GEN_OPT_GRPID
74  {MNTTAB_OPT_GRPID, MNT2_GEN_OPT_GRPID},
75# endif /* MNT2_GEN_OPT_GRPID */
76# ifdef MNT2_NFS_OPT_GRPID
77  {MNTTAB_OPT_GRPID, MNT2_NFS_OPT_GRPID},
78# endif /* MNT2_NFS_OPT_GRPID */
79#endif /* MNTTAB_OPT_GRPID */
80
81#if defined(MNT2_GEN_OPT_MULTI) && defined(MNTTAB_OPT_MULTI)
82  {MNTTAB_OPT_MULTI, MNT2_GEN_OPT_MULTI},
83#endif /* defined(MNT2_GEN_OPT_MULTI) && defined(MNTTAB_OPT_MULTI) */
84
85#if defined(MNT2_GEN_OPT_NODEV) && defined(MNTTAB_OPT_NODEV)
86  {MNTTAB_OPT_NODEV, MNT2_GEN_OPT_NODEV},
87#endif /* defined(MNT2_GEN_OPT_NODEV) && defined(MNTTAB_OPT_NODEV) */
88
89#if defined(MNT2_GEN_OPT_NOEXEC) && defined(MNTTAB_OPT_NOEXEC)
90  {MNTTAB_OPT_NOEXEC, MNT2_GEN_OPT_NOEXEC},
91#endif /* defined(MNT2_GEN_OPT_NOEXEC) && defined(MNTTAB_OPT_NOEXEC) */
92
93#if defined(MNT2_GEN_OPT_NOSUB) && defined(MNTTAB_OPT_NOSUB)
94  {MNTTAB_OPT_NOSUB, MNT2_GEN_OPT_NOSUB},
95#endif /* defined(MNT2_GEN_OPT_NOSUB) && defined(MNTTAB_OPT_NOSUB) */
96
97#if defined(MNT2_GEN_OPT_NOSUID) && defined(MNTTAB_OPT_NOSUID)
98  {MNTTAB_OPT_NOSUID, MNT2_GEN_OPT_NOSUID},
99#endif /* defined(MNT2_GEN_OPT_NOSUID) && defined(MNTTAB_OPT_NOSUID) */
100
101#if defined(MNT2_GEN_OPT_SYNC) && defined(MNTTAB_OPT_SYNC)
102  {MNTTAB_OPT_SYNC, MNT2_GEN_OPT_SYNC},
103#endif /* defined(MNT2_GEN_OPT_SYNC) && defined(MNTTAB_OPT_SYNC) */
104
105#if defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY)
106  {MNTTAB_OPT_OVERLAY, MNT2_GEN_OPT_OVERLAY},
107#endif /* defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY) */
108
109  /*
110   * Do not define MNT2_NFS_OPT_* entries here!  This is for generic
111   * mount(2) options only, not for NFS mount options.
112   */
113
114  {0, 0}
115};
116
117
118/* compute generic mount flags */
119int
120compute_mount_flags(mntent_t *mntp)
121{
122  struct opt_tab *opt;
123  int flags = 0;
124
125#ifdef MNT2_GEN_OPT_NEWTYPE
126  flags = MNT2_GEN_OPT_NEWTYPE;
127#endif /* MNT2_GEN_OPT_NEWTYPE */
128#ifdef MNT2_GEN_OPT_AUTOMOUNTED
129  flags |= MNT2_GEN_OPT_AUTOMOUNTED;
130#endif /* not MNT2_GEN_OPT_AUTOMOUNTED */
131
132  /*
133   * Crack basic mount options
134   */
135  for (opt = mnt_flags; opt->opt; opt++) {
136    flags |= hasmntopt(mntp, opt->opt) ? opt->flag : 0;
137  }
138
139  return flags;
140}
141
142
143/* compute generic mount flags for automounter mounts */
144int
145compute_automounter_mount_flags(mntent_t *mntp)
146{
147  int flags = 0;
148
149#ifdef MNT2_GEN_OPT_IGNORE
150  flags |= MNT2_GEN_OPT_IGNORE;
151#endif /* not MNT2_GEN_OPT_IGNORE */
152#ifdef MNT2_GEN_OPT_AUTOMNTFS
153  flags |= MNT2_GEN_OPT_AUTOMNTFS;
154#endif /* not MNT2_GEN_OPT_AUTOMNTFS */
155
156  return flags;
157}
158
159
160int
161mount_fs(mntent_t *mnt, int flags, caddr_t mnt_data, int retry, MTYPE_TYPE type, u_long nfs_version, const char *nfs_proto, const char *mnttabname)
162{
163  int error = 0;
164#ifdef MOUNT_TABLE_ON_FILE
165# ifdef MNTTAB_OPT_DEV
166  struct stat stb;
167# endif /* MNTTAB_OPT_DEV */
168  char *zopts = NULL, *xopts = NULL;
169# if defined(MNTTAB_OPT_DEV) || (defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS)) || defined(MNTTAB_OPT_PROTO)
170  char optsbuf[48];
171# endif /* defined(MNTTAB_OPT_DEV) || (defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS)) || defined(MNTTAB_OPT_PROTO) */
172#endif /* MOUNT_TABLE_ON_FILE */
173
174#ifdef DEBUG
175  dlog("%s fstype " MTYPE_PRINTF_TYPE " (%s) flags %#x (%s)",
176       mnt->mnt_dir, type, mnt->mnt_type, flags, mnt->mnt_opts);
177#endif /* DEBUG */
178
179again:
180  clock_valid = 0;
181
182  error = MOUNT_TRAP(type, mnt, flags, mnt_data);
183
184  if (error < 0) {
185    plog(XLOG_ERROR, "%s: mount: %m", mnt->mnt_dir);
186    /*
187     * The following code handles conditions which shouldn't
188     * occur.  They are possible either because amd screws up
189     * in preparing for the mount, or because some human
190     * messed with the mount point.  Both have been known to
191     * happen. -- stolcke 2/22/95
192     */
193    if (errno == ENOENT) {
194      /*
195       * Occasionally the mount point vanishes, probably
196       * due to some race condition.  Just recreate it
197       * as necessary.
198       */
199      errno = mkdirs(mnt->mnt_dir, 0555);
200      if (errno != 0 && errno != EEXIST)
201	plog(XLOG_ERROR, "%s: mkdirs: %m", mnt->mnt_dir);
202      else {
203	plog(XLOG_WARNING, "extra mkdirs required for %s",
204	     mnt->mnt_dir);
205	error = MOUNT_TRAP(type, mnt, flags, mnt_data);
206      }
207    } else if (errno == EBUSY) {
208      /*
209       * Also, sometimes unmount isn't called, e.g., because
210       * our mountlist is garbled.  This leaves old mount
211       * points around which need to be removed before we
212       * can mount something new in their place.
213       */
214      errno = umount_fs(mnt->mnt_dir, mnttabname);
215      if (errno != 0)
216	plog(XLOG_ERROR, "%s: umount: %m", mnt->mnt_dir);
217      else {
218	plog(XLOG_WARNING, "extra umount required for %s",
219	     mnt->mnt_dir);
220	error = MOUNT_TRAP(type, mnt, flags, mnt_data);
221      }
222    }
223  }
224
225  if (error < 0 && --retry > 0) {
226    sleep(1);
227    goto again;
228  }
229  if (error < 0) {
230    return errno;
231  }
232
233#ifdef MOUNT_TABLE_ON_FILE
234  /*
235   * Allocate memory for options:
236   *        dev=..., vers={2,3}, proto={tcp,udp}
237   */
238  zopts = (char *) xmalloc(strlen(mnt->mnt_opts) + 48);
239
240  /* copy standard options */
241  xopts = mnt->mnt_opts;
242
243  strcpy(zopts, xopts);
244
245# ifdef MNTTAB_OPT_DEV
246  /* add the extra dev= field to the mount table */
247  if (lstat(mnt->mnt_dir, &stb) == 0) {
248    if (sizeof(stb.st_dev) == 2) /* e.g. SunOS 4.1 */
249      sprintf(optsbuf, "%s=%04lx",
250	      MNTTAB_OPT_DEV, (u_long) stb.st_dev & 0xffff);
251    else			/* e.g. System Vr4 */
252      sprintf(optsbuf, "%s=%08lx",
253	      MNTTAB_OPT_DEV, (u_long) stb.st_dev);
254    append_opts(zopts, optsbuf);
255  }
256# endif /* MNTTAB_OPT_DEV */
257
258# if defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS)
259  /*
260   * add the extra vers={2,3} field to the mount table,
261   * unless already specified by user
262   */
263   if (nfs_version == NFS_VERSION3 &&
264       hasmntval(mnt, MNTTAB_OPT_VERS) != NFS_VERSION3) {
265     sprintf(optsbuf, "%s=%d", MNTTAB_OPT_VERS, NFS_VERSION3);
266     append_opts(zopts, optsbuf);
267   }
268# endif /* defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS) */
269
270# ifdef MNTTAB_OPT_PROTO
271  /*
272   * add the extra proto={tcp,udp} field to the mount table,
273   * unless already specified by user.
274   */
275  if (nfs_proto && !hasmntopt(mnt, MNTTAB_OPT_PROTO)) {
276    sprintf(optsbuf, "%s=%s", MNTTAB_OPT_PROTO, nfs_proto);
277    append_opts(zopts, optsbuf);
278  }
279# endif /* MNTTAB_OPT_PROTO */
280
281  /* finally, store the options into the mount table structure */
282  mnt->mnt_opts = zopts;
283
284  /*
285   * Additional fields in mntent_t
286   * are fixed up here
287   */
288# ifdef HAVE_MNTENT_T_MNT_CNODE
289  mnt->mnt_cnode = 0;
290# endif /* HAVE_MNTENT_T_MNT_CNODE */
291
292# ifdef HAVE_MNTENT_T_MNT_RO
293  mnt->mnt_ro = (hasmntopt(mnt, MNTTAB_OPT_RO) != NULL);
294# endif /* HAVE_MNTENT_T_MNT_RO */
295
296# ifdef HAVE_MNTENT_T_MNT_TIME
297#  ifdef HAVE_MNTENT_T_MNT_TIME_STRING
298  {				/* allocate enough space for a long */
299    char *str = (char *) xmalloc(13 * sizeof(char));
300    sprintf(str, "%ld", time((time_t *) NULL));
301    mnt->mnt_time = str;
302  }
303#  else /* not HAVE_MNTENT_T_MNT_TIME_STRING */
304  mnt->mnt_time = time((time_t *) NULL);
305#  endif /* not HAVE_MNTENT_T_MNT_TIME_STRING */
306# endif /* HAVE_MNTENT_T_MNT_TIME */
307
308  write_mntent(mnt, mnttabname);
309
310# ifdef MNTTAB_OPT_DEV
311  if (xopts) {
312    XFREE(mnt->mnt_opts);
313    mnt->mnt_opts = xopts;
314  }
315# endif /* MNTTAB_OPT_DEV */
316#endif /* MOUNT_TABLE_ON_FILE */
317
318  return 0;
319}
320
321
322/*
323 * Fill in the many possible fields and flags of struct nfs_args.
324 *
325 * nap:		pre-allocated structure to fill in.
326 * mntp:	mount entry structure (includes options)
327 * genflags:	generic mount flags already determined
328 * nfsncp:	(TLI only) netconfig entry for this NFS mount
329 * ip_addr:	IP address of file server
330 * nfs_version:	2, 3, (4 in the future), or 0 if unknown
331 * nfs_proto:	"udp", "tcp", or NULL.
332 * fhp:		file handle structure pointer
333 * host_name:	name of remote NFS host
334 * fs_name:	remote file system name to mount
335 */
336void
337#ifdef HAVE_TRANSPORT_TYPE_TLI
338compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct netconfig *nfsncp, struct sockaddr_in *ip_addr, u_long nfs_version, char *nfs_proto, am_nfs_handle_t *fhp, char *host_name, char *fs_name)
339#else /* not HAVE_TRANSPORT_TYPE_TLI */
340compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_in *ip_addr, u_long nfs_version, char *nfs_proto, am_nfs_handle_t *fhp, char *host_name, char *fs_name)
341#endif /* not HAVE_TRANSPORT_TYPE_TLI */
342{
343  int acval = 0;
344#ifdef HAVE_FS_NFS3
345  static am_nfs_fh3 fh3;	/* static, b/c gcc on aix corrupts stack */
346#endif /* HAVE_FS_NFS3 */
347
348  /* initialize just in case */
349  memset((voidp) nap, 0, sizeof(nfs_args_t));
350
351  /************************************************************************/
352  /***	FILEHANDLE DATA AND LENGTH					***/
353  /************************************************************************/
354#ifdef HAVE_FS_NFS3
355  if (nfs_version == NFS_VERSION3) {
356    memset((voidp) &fh3, 0, sizeof(am_nfs_fh3));
357    fh3.fh3_length = fhp->v3.mountres3_u.mountinfo.fhandle.fhandle3_len;
358    memmove(fh3.fh3_u.data,
359	    fhp->v3.mountres3_u.mountinfo.fhandle.fhandle3_val,
360	    fh3.fh3_length);
361
362# if defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN)
363    /*
364     * Some systems (Irix/bsdi3) have a separate field in nfs_args for
365     * the length of the file handle for NFS V3.  They insist that
366     * the file handle set in nfs_args be plain bytes, and not
367     * include the length field.
368     */
369    NFS_FH_DREF(nap->NFS_FH_FIELD, &(fh3.fh3_u.data));
370# else /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
371    NFS_FH_DREF(nap->NFS_FH_FIELD, &fh3);
372# endif /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
373# ifdef MNT2_NFS_OPT_NFSV3
374    nap->flags |= MNT2_NFS_OPT_NFSV3;
375# endif /* MNT2_NFS_OPT_NFSV3 */
376# ifdef MNT2_NFS_OPT_VER3
377    nap->flags |= MNT2_NFS_OPT_VER3;
378# endif /* MNT2_NFS_OPT_VER3 */
379  } else
380#endif /* HAVE_FS_NFS3 */
381    NFS_FH_DREF(nap->NFS_FH_FIELD, &(fhp->v2.fhs_fh));
382
383#ifdef HAVE_NFS_ARGS_T_FHSIZE
384# ifdef HAVE_FS_NFS3
385  if (nfs_version == NFS_VERSION3)
386    nap->fhsize = fh3.fh3_length;
387  else
388# endif /* HAVE_FS_NFS3 */
389    nap->fhsize = FHSIZE;
390#endif /* HAVE_NFS_ARGS_T_FHSIZE */
391
392  /* this is the version of the nfs_args structure, not of NFS! */
393#ifdef HAVE_NFS_ARGS_T_FH_LEN
394# ifdef HAVE_FS_NFS3
395  if (nfs_version == NFS_VERSION3)
396    nap->fh_len = fh3.fh3_length;
397  else
398# endif /* HAVE_FS_NFS3 */
399    nap->fh_len = FHSIZE;
400#endif /* HAVE_NFS_ARGS_T_FH_LEN */
401
402  /************************************************************************/
403  /***	HOST NAME							***/
404  /************************************************************************/
405  NFS_HN_DREF(nap->hostname, host_name);
406#ifdef MNT2_NFS_OPT_HOSTNAME
407  nap->flags |= MNT2_NFS_OPT_HOSTNAME;
408#endif /* MNT2_NFS_OPT_HOSTNAME */
409
410  /************************************************************************/
411  /***	ATTRIBUTE CACHES						***/
412  /************************************************************************/
413  /*
414   * acval is set to 0 at the top of the function.  If actimeo mount option
415   * exists and defined in mntopts, then it acval is set to it.
416   * If the value is non-zero, then we set all attribute cache fields to it.
417   * If acval is zero, it means it was never defined in mntopts or the
418   * actimeo mount option does not exist, in which case we check for
419   * individual mount options per attribute cache.
420   * Regardless of the value of acval, mount flags are set based directly
421   * on the values of the attribute caches.
422   */
423#ifdef MNTTAB_OPT_ACTIMEO
424  acval = hasmntval(mntp, MNTTAB_OPT_ACTIMEO); /* attr cache timeout (sec) */
425#endif /* MNTTAB_OPT_ACTIMEO */
426
427  if (acval) {
428#ifdef HAVE_NFS_ARGS_T_ACREGMIN
429    nap->acregmin = acval;	/* min ac timeout for reg files (sec) */
430    nap->acregmax = acval;	/* max ac timeout for reg files (sec) */
431#endif /* HAVE_NFS_ARGS_T_ACREGMIN */
432#ifdef HAVE_NFS_ARGS_T_ACDIRMIN
433    nap->acdirmin = acval;	/* min ac timeout for dirs (sec) */
434    nap->acdirmax = acval;	/* max ac timeout for dirs (sec) */
435#endif /* HAVE_NFS_ARGS_T_ACDIRMIN */
436  } else {
437#ifdef MNTTAB_OPT_ACREGMIN
438    nap->acregmin = hasmntval(mntp, MNTTAB_OPT_ACREGMIN);
439#endif /* MNTTAB_OPT_ACREGMIN */
440#ifdef MNTTAB_OPT_ACREGMAX
441    nap->acregmax = hasmntval(mntp, MNTTAB_OPT_ACREGMAX);
442#endif /* MNTTAB_OPT_ACREGMAX */
443#ifdef MNTTAB_OPT_ACDIRMIN
444    nap->acdirmin = hasmntval(mntp, MNTTAB_OPT_ACDIRMIN);
445#endif /* MNTTAB_OPT_ACDIRMIN */
446#ifdef MNTTAB_OPT_ACDIRMAX
447    nap->acdirmax = hasmntval(mntp, MNTTAB_OPT_ACDIRMAX);
448#endif /* MNTTAB_OPT_ACDIRMAX */
449  } /* end of "if (acval)" statement */
450
451#ifdef MNT2_NFS_OPT_ACREGMIN
452  if (nap->acregmin)
453    nap->flags |= MNT2_NFS_OPT_ACREGMIN;
454#endif /* MNT2_NFS_OPT_ACREGMIN */
455#ifdef MNT2_NFS_OPT_ACREGMAX
456  if (nap->acregmax)
457    nap->flags |= MNT2_NFS_OPT_ACREGMAX;
458#endif /* MNT2_NFS_OPT_ACREGMAX */
459#ifdef MNT2_NFS_OPT_ACDIRMIN
460  if (nap->acdirmin)
461    nap->flags |= MNT2_NFS_OPT_ACDIRMIN;
462#endif /* MNT2_NFS_OPT_ACDIRMIN */
463#ifdef MNT2_NFS_OPT_ACDIRMAX
464  if (nap->acdirmax)
465    nap->flags |= MNT2_NFS_OPT_ACDIRMAX;
466#endif /* MNT2_NFS_OPT_ACDIRMAX */
467
468#ifdef MNTTAB_OPT_NOAC		/* don't cache attributes */
469  if (hasmntopt(mntp, MNTTAB_OPT_NOAC) != NULL)
470    nap->flags |= MNT2_NFS_OPT_NOAC;
471#endif /* MNTTAB_OPT_NOAC */
472
473  /************************************************************************/
474  /***	IP ADDRESS OF REMOTE HOST					***/
475  /************************************************************************/
476  if (ip_addr) {
477#ifdef HAVE_TRANSPORT_TYPE_TLI
478    nap->addr = ALLOC(struct netbuf); /* free()'ed at end of mount_nfs_fh() */
479#endif /* HAVE_TRANSPORT_TYPE_TLI */
480    NFS_SA_DREF(nap, ip_addr);
481  }
482
483  /************************************************************************/
484  /***	NFS PROTOCOL (UDP, TCP) AND VERSION				***/
485  /************************************************************************/
486#ifdef MNT2_NFS_OPT_TCP
487  if (nfs_proto && STREQ(nfs_proto, "tcp"))
488    nap->flags |= MNT2_NFS_OPT_TCP;
489#endif /* MNT2_NFS_OPT_TCP */
490
491#ifdef HAVE_NFS_ARGS_T_SOTYPE
492  /* bsdi3 uses this */
493  if (nfs_proto) {
494    if (STREQ(nfs_proto, "tcp"))
495      nap->sotype = SOCK_STREAM;
496    else if (STREQ(nfs_proto, "udp"))
497      nap->sotype = SOCK_DGRAM;
498  }
499#endif /* HAVE_NFS_ARGS_T_SOTYPE */
500
501#ifdef HAVE_NFS_ARGS_T_PROTO
502  nap->proto = 0;		/* bsdi3 sets this field to zero  */
503# ifdef IPPROTO_TCP
504  if (nfs_proto) {
505    if (STREQ(nfs_proto, "tcp"))	/* AIX 4.2.x needs this */
506      nap->proto = IPPROTO_TCP;
507    else if (STREQ(nfs_proto, "udp"))
508      nap->proto = IPPROTO_UDP;
509  }
510# endif /* IPPROTO_TCP */
511#endif /* HAVE_NFS_ARGS_T_SOTYPE */
512
513#ifdef HAVE_NFS_ARGS_T_VERSION
514# ifdef NFS_ARGSVERSION
515  nap->version = NFS_ARGSVERSION; /* BSDI 3.0 and OpenBSD 2.2 */
516# endif /* NFS_ARGSVERSION */
517# ifdef DG_MOUNT_NFS_VERSION
518  nap->version = DG_MOUNT_NFS_VERSION; /* dg-ux */
519# endif /* DG_MOUNT_NFS_VERSION */
520#endif /* HAVE_NFS_ARGS_VERSION */
521
522  /************************************************************************/
523  /***	OTHER NFS SOCKET RELATED OPTIONS AND FLAGS			***/
524  /************************************************************************/
525#ifdef MNT2_NFS_OPT_NOCONN
526  /* check if user specified to use unconnected or connected sockets */
527  if (hasmntopt(mntp, MNTTAB_OPT_NOCONN) != NULL)
528    nap->flags |= MNT2_NFS_OPT_NOCONN;
529  else if (hasmntopt(mntp, MNTTAB_OPT_CONN) != NULL)
530    nap->flags &= ~MNT2_NFS_OPT_NOCONN;
531  else {
532    /*
533     * Some OSs want you to set noconn always.  Some want you to always turn
534     * it off.  Others want you to turn it on/off only if NFS V.3 is used.
535     * And all of that changes from revision to another.  This is
536     * particularly true of OpenBSD, NetBSD, and FreeBSD.  So, rather than
537     * attempt to auto-detect this, I'm forced to "fix" it in the individual
538     * conf/nfs_prot/nfs_prot_*.h files.
539     */
540# ifdef USE_UNCONNECTED_NFS_SOCKETS
541    if (!(nap->flags & MNT2_NFS_OPT_NOCONN)) {
542      nap->flags |= MNT2_NFS_OPT_NOCONN;
543      plog(XLOG_WARNING, "noconn option not specified, and was just turned ON (OS override)! (May cause NFS hangs on some systems...)");
544    }
545# endif /* USE_UNCONNECTED_NFS_SOCKETS */
546# ifdef USE_CONNECTED_NFS_SOCKETS
547    if (nap->flags & MNT2_NFS_OPT_NOCONN) {
548      nap->flags &= ~MNT2_NFS_OPT_NOCONN;
549      plog(XLOG_WARNING, "noconn option specified, and was just turned OFF (OS override)! (May cause NFS hangs on some systems...)");
550    }
551# endif /* USE_CONNECTED_NFS_SOCKETS */
552  }
553#endif /* MNT2_NFS_OPT_NOCONN */
554
555#ifdef MNT2_NFS_OPT_RESVPORT
556# ifdef MNTTAB_OPT_RESVPORT
557  if (hasmntopt(mntp, MNTTAB_OPT_RESVPORT) != NULL)
558    nap->flags |= MNT2_NFS_OPT_RESVPORT;
559# else /* not MNTTAB_OPT_RESVPORT */
560  nap->flags |= MNT2_NFS_OPT_RESVPORT;
561# endif /* not MNTTAB_OPT_RESVPORT */
562#endif /* MNT2_NFS_OPT_RESVPORT */
563
564  /************************************************************************/
565  /***	OTHER FLAGS AND OPTIONS						***/
566  /************************************************************************/
567
568#ifdef HAVE_TRANSPORT_TYPE_TLI
569  /* set up syncaddr field */
570  nap->syncaddr = (struct netbuf *) NULL;
571
572  /* set up knconf field */
573  if (get_knetconfig(&nap->knconf, nfsncp, nfs_proto) < 0) {
574    plog(XLOG_FATAL, "cannot fill knetconfig structure for nfs_args");
575    going_down(1);
576  }
577  /* update the flags field for knconf */
578  nap->flags |= MNT2_NFS_OPT_KNCONF;
579#endif /* HAVE_TRANSPORT_TYPE_TLI */
580
581#ifdef MNT2_NFS_OPT_FSNAME
582  nap->fsname = fs_name;
583  nap->flags |= MNT2_NFS_OPT_FSNAME;
584#endif /* MNT2_NFS_OPT_FSNAME */
585
586  nap->rsize = hasmntval(mntp, MNTTAB_OPT_RSIZE);
587#ifdef MNT2_NFS_OPT_RSIZE
588  if (nap->rsize)
589    nap->flags |= MNT2_NFS_OPT_RSIZE;
590#endif /* MNT2_NFS_OPT_RSIZE */
591
592  nap->wsize = hasmntval(mntp, MNTTAB_OPT_WSIZE);
593#ifdef MNT2_NFS_OPT_WSIZE
594  if (nap->wsize)
595    nap->flags |= MNT2_NFS_OPT_WSIZE;
596#endif /* MNT2_NFS_OPT_WSIZE */
597
598  nap->timeo = hasmntval(mntp, MNTTAB_OPT_TIMEO);
599#ifdef MNT2_NFS_OPT_TIMEO
600  if (nap->timeo)
601    nap->flags |= MNT2_NFS_OPT_TIMEO;
602#endif /* MNT2_NFS_OPT_TIMEO */
603
604  nap->retrans = hasmntval(mntp, MNTTAB_OPT_RETRANS);
605#ifdef MNT2_NFS_OPT_RETRANS
606  if (nap->retrans)
607    nap->flags |= MNT2_NFS_OPT_RETRANS;
608#endif /* MNT2_NFS_OPT_RETRANS */
609
610#ifdef MNT2_NFS_OPT_BIODS
611  if ((nap->biods = hasmntval(mntp, MNTTAB_OPT_BIODS)))
612    nap->flags |= MNT2_NFS_OPT_BIODS;
613#endif /* MNT2_NFS_OPT_BIODS */
614
615  if (hasmntopt(mntp, MNTTAB_OPT_SOFT) != NULL)
616    nap->flags |= MNT2_NFS_OPT_SOFT;
617
618#ifdef MNT2_NFS_OPT_SPONGY
619  if (hasmntopt(mntp, MNTTAB_OPT_SPONGY) != NULL) {
620    nap->flags |= MNT2_NFS_OPT_SPONGY;
621    if (nap->flags & MNT2_NFS_OPT_SOFT) {
622      plog(XLOG_USER, "Mount opts soft and spongy are incompatible - soft ignored");
623      nap->flags &= ~MNT2_NFS_OPT_SOFT;
624    }
625  }
626#endif /* MNT2_NFS_OPT_SPONGY */
627
628#if defined(MNT2_GEN_OPT_RONLY) && defined(MNT2_NFS_OPT_RONLY)
629  /* Ultrix has separate generic and NFS ro flags */
630  if (genflags & MNT2_GEN_OPT_RONLY)
631    nap->flags |= MNT2_NFS_OPT_RONLY;
632#endif /* defined(MNT2_GEN_OPT_RONLY) && defined(MNT2_NFS_OPT_RONLY) */
633
634#ifdef MNTTAB_OPT_INTR
635  if (hasmntopt(mntp, MNTTAB_OPT_INTR) != NULL)
636    /*
637     * Either turn on the "allow interrupts" option, or
638     * turn off the "disallow interrupts" option"
639     */
640# ifdef MNT2_NFS_OPT_INTR
641    nap->flags |= MNT2_NFS_OPT_INTR;
642# endif /* MNT2_NFS_OPT_INTR */
643# ifdef MNT2_NFS_OPT_NOINTR
644    nap->flags &= ~MNT2_NFS_OPT_NOINTR;
645# endif /* MNT2_NFS_OPT_NOINTR */
646# ifdef MNT2_NFS_OPT_INT
647    nap->flags |= MNT2_NFS_OPT_INT;
648# endif /* MNT2_NFS_OPT_INT */
649# ifdef MNT2_NFS_OPT_NOINT
650    nap->flags &= ~MNT2_NFS_OPT_NOINT;
651# endif /* MNT2_NFS_OPT_NOINT */
652#endif /* MNTTAB_OPT_INTR */
653
654#ifdef MNTTAB_OPT_NODEVS
655  if (hasmntopt(mntp, MNTTAB_OPT_NODEVS) != NULL)
656    nap->flags |= MNT2_NFS_OPT_NODEVS;
657#endif /* MNTTAB_OPT_NODEVS */
658
659#ifdef MNTTAB_OPT_COMPRESS
660  if (hasmntopt(mntp, MNTTAB_OPT_COMPRESS) != NULL)
661    nap->flags |= MNT2_NFS_OPT_COMPRESS;
662#endif /* MNTTAB_OPT_COMPRESS */
663
664#ifdef MNTTAB_OPT_PRIVATE	/* mount private, single-client tree */
665  if (hasmntopt(mntp, MNTTAB_OPT_PRIVATE) != NULL)
666    nap->flags |= MNT2_NFS_OPT_PRIVATE;
667#endif /* MNTTAB_OPT_PRIVATE */
668
669#ifdef MNTTAB_OPT_SYMTTL	/* symlink cache time-to-live */
670  if ((nap->symttl = hasmntval(mntp, MNTTAB_OPT_SYMTTL)))
671    nap->flags |= MNT2_NFS_OPT_SYMTTL;
672#endif /* MNTTAB_OPT_SYMTTL */
673
674#ifdef MNT2_NFS_OPT_PGTHRESH	/* paging threshold */
675  if ((nap->pg_thresh = hasmntval(mntp, MNTTAB_OPT_PGTHRESH)))
676    nap->flags |= MNT2_NFS_OPT_PGTHRESH;
677#endif /* MNT2_NFS_OPT_PGTHRESH */
678
679#if defined(MNT2_NFS_OPT_NOCTO) && defined(MNTTAB_OPT_NOCTO)
680  if (hasmntopt(mntp, MNTTAB_OPT_NOCTO) != NULL)
681    nap->flags |= MNT2_NFS_OPT_NOCTO;
682#endif /* defined(MNT2_NFS_OPT_NOCTO) && defined(MNTTAB_OPT_NOCTO) */
683
684#if defined(MNT2_NFS_OPT_POSIX) && defined(MNTTAB_OPT_POSIX)
685  if (hasmntopt(mntp, MNTTAB_OPT_POSIX) != NULL) {
686    nap->flags |= MNT2_NFS_OPT_POSIX;
687    nap->pathconf = NULL;
688  }
689#endif /* MNT2_NFS_OPT_POSIX && MNTTAB_OPT_POSIX */
690
691#if defined(MNT2_NFS_OPT_PROPLIST) && defined(MNTTAB_OPT_PROPLIST)
692  if (hasmntopt(mntp, MNTTAB_OPT_PROPLIST) != NULL)
693    nap->flags |= MNT2_NFS_OPT_PROPLIST;
694#endif /* defined(MNT2_NFS_OPT_PROPLIST) && defined(MNTTAB_OPT_PROPLIST) */
695
696#if defined(MNT2_NFS_OPT_MAXGRPS) && defined(MNTTAB_OPT_MAXGROUPS)
697  nap->maxgrouplist = hasmntval(mntp, MNTTAB_OPT_MAXGROUPS);
698  if (nap->maxgrouplist != NULL)
699    nap->flags |= MNT2_NFS_OPT_MAXGRPS;
700#endif /* defined(MNT2_NFS_OPT_MAXGRPS) && defined(MNTTAB_OPT_MAXGROUPS) */
701
702#if defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK)
703  if (hasmntopt(mntp, MNTTAB_OPT_NOLOCK) != NULL)
704    nap->flags |= MNT2_NFS_OPT_NONLM;
705#endif /* defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) */
706
707#ifdef HAVE_NFS_ARGS_T_OPTSTR
708  nap->optstr = mntp->mnt_opts;
709#endif /* HAVE_NFS_ARGS_T_OPTSTR */
710
711  /************************************************************************/
712  /***	FINAL ACTIONS							***/
713  /************************************************************************/
714
715#ifdef HAVE_NFS_ARGS_T_GFS_FLAGS
716  /* Ultrix stores generic flags in nfs_args.gfs_flags. */
717  nap->gfs_flags = genflags;
718#endif /* HAVE_NFS_ARGS_T_FLAGS */
719
720  return;			/* end of compute_nfs_args() function */
721}
722
723
724/*
725 * Fill in special values for flags and fields of nfs_args, for an
726 * automounter NFS mount.
727 */
728void
729compute_automounter_nfs_args(nfs_args_t *nap, mntent_t *mntp)
730{
731#ifdef MNT2_NFS_OPT_SYMTTL
732  /*
733   * Don't let the kernel cache symbolic links we generate, or else lookups
734   * will bypass amd and fail to remount stuff as needed.
735   */
736  plog(XLOG_INFO, "turning on NFS option symttl and setting value to 0");
737  nap->flags |= MNT2_NFS_OPT_SYMTTL;
738  nap->symttl = 0;
739#endif /* MNT2_NFS_OPT_SYMTTL */
740
741  /*
742   * This completes the flags for the HIDE_MOUNT_TYPE  code in the
743   * mount_amfs_toplvl() function in amd/amfs_toplvl.c.
744   * Some systems don't have a mount type, but a mount flag.
745   */
746#ifdef MNT2_NFS_OPT_AUTO
747  nap->flags |= MNT2_NFS_OPT_AUTO;
748#endif /* MNT2_NFS_OPT_AUTO */
749#ifdef MNT2_NFS_OPT_IGNORE
750  nap->flags |= MNT2_NFS_OPT_IGNORE;
751#endif /* MNT2_NFS_OPT_IGNORE */
752#ifdef MNT2_GEN_OPT_AUTOMNTFS
753  nap->flags |= MNT2_GEN_OPT_AUTOMNTFS;
754#endif /* not MNT2_GEN_OPT_AUTOMNTFS */
755
756#ifdef MNT2_NFS_OPT_DUMBTIMR
757  /*
758   * Don't let the kernel start computing throughput of Amd.  The numbers
759   * will be meaningless because of the way Amd does mount retries.
760   */
761  plog(XLOG_INFO, "%s: disabling nfs congestion window", mntp->mnt_dir);
762  nap->flags |= MNT2_NFS_OPT_DUMBTIMR;
763#endif /* MNT2_NFS_OPT_DUMBTIMR */
764
765#ifdef MNT2_NFS_OPT_NOAC
766  /*
767   * Don't cache attributes - they are changing under the kernel's feet.
768   * For example, IRIX5.2 will dispense with nfs lookup calls and hand stale
769   * filehandles to getattr unless we disable attribute caching on the
770   * automount points.
771   */
772  nap->flags |= MNT2_NFS_OPT_NOAC;
773#else /* not MNT2_NFS_OPT_NOAC */
774  /*
775   * Setting these to 0 results in an error on some systems, which is why
776   * it's better to use "noac" if possible.
777   */
778# if defined(MNT2_NFS_OPT_ACREGMIN) && defined(MNT2_NFS_OPT_ACREGMAX)
779  nap->acregmin = nap->acregmax = 0; /* XXX: was 1, but why? */
780  nap->flags |= MNT2_NFS_OPT_ACREGMIN | MNT2_NFS_OPT_ACREGMAX;
781# endif /* defined(MNT2_NFS_OPT_ACREGMIN) && defined(MNT2_NFS_OPT_ACREGMAX) */
782# if defined(MNT2_NFS_OPT_ACDIRMIN) && defined(MNT2_NFS_OPT_ACDIRMAX)
783  nap->acdirmin = nap->acdirmax = 0; /* XXX: was 1, but why? */
784  nap->flags |= MNT2_NFS_OPT_ACDIRMIN | MNT2_NFS_OPT_ACDIRMAX;
785# endif /* defined(MNT2_NFS_OPT_ACDIRMIN) && defined(MNT2_NFS_OPT_ACDIRMAX) */
786#endif /* not MNT2_NFS_OPT_NOAC */
787  /*
788   * Provide a slight bit more security by requiring the kernel to use
789   * reserved ports.
790   */
791#ifdef MNT2_NFS_OPT_RESVPORT
792  nap->flags |= MNT2_NFS_OPT_RESVPORT;
793#endif /* MNT2_NFS_OPT_RESVPORT */
794}
795
796
797#ifdef DEBUG
798/* get string version (in hex) of identifier */
799static char *
800get_hex_string(u_int len, const char *fhdata)
801{
802  int i;
803  static char buf[128];		/* better not go over it! */
804  char str[16];
805  short int arr[64];
806
807  if (!fhdata)
808    return NULL;
809  buf[0] = '\0';
810  memset(&arr[0], 0, (64 * sizeof(short int)));
811  memcpy(&arr[0], &fhdata[0], len);
812  for (i=0; i<len/sizeof(short int); i++) {
813    sprintf(str, "%04x", ntohs(arr[i]));
814    strcat(buf, str);
815  }
816  return buf;
817}
818
819
820/*
821 * print a subset of fields from "struct nfs_args" that are otherwise
822 * not being provided anywhere else.
823 */
824void
825print_nfs_args(const nfs_args_t *nap, u_long nfs_version)
826{
827   int fhlen = 32;	/* default: NFS V.2 file handle length is 32 */
828#ifdef HAVE_TRANSPORT_TYPE_TLI
829  struct netbuf *nbp;
830  struct knetconfig *kncp;
831#else /* not HAVE_TRANSPORT_TYPE_TLI */
832  struct sockaddr_in *sap;
833#endif /* not HAVE_TRANSPORT_TYPE_TLI */
834
835  if (!nap) {
836    plog(XLOG_DEBUG, "NULL nfs_args!");
837    return;
838  }
839
840  /* override default file handle size */
841#ifdef FHSIZE
842   fhlen = FHSIZE;
843#endif /* FHSIZE */
844#ifdef NFS_FHSIZE
845   fhlen = NFS_FHSIZE;
846#endif /* NFS_FHSIZE */
847
848#ifdef HAVE_TRANSPORT_TYPE_TLI
849  nbp = nap->addr;
850  plog(XLOG_DEBUG, "NA->addr {netbuf} (maxlen=%d, len=%d) = \"%s\"",
851       nbp->maxlen, nbp->len,
852       get_hex_string(nbp->len, nbp->buf));
853  nbp = nap->syncaddr;
854  plog(XLOG_DEBUG, "NA->syncaddr {netbuf} 0x%x", (int) nbp);
855  kncp = nap->knconf;
856  plog(XLOG_DEBUG, "NA->knconf->semantics %lu", (u_long) kncp->knc_semantics);
857  plog(XLOG_DEBUG, "NA->knconf->protofmly \"%s\"", kncp->knc_protofmly);
858  plog(XLOG_DEBUG, "NA->knconf->proto \"%s\"", kncp->knc_proto);
859  plog(XLOG_DEBUG, "NA->knconf->rdev %lu", (u_long) kncp->knc_rdev);
860  /* don't print knconf->unused field */
861#else /* not HAVE_TRANSPORT_TYPE_TLI */
862  sap = (struct sockaddr_in *) &nap->addr;
863  plog(XLOG_DEBUG, "NA->addr {sockaddr_in} (len=%d) = \"%s\"",
864       (int) sizeof(struct sockaddr_in),
865       get_hex_string(sizeof(struct sockaddr_in), (const char *)sap));
866#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
867  plog(XLOG_DEBUG, "NA->addr.sin_len = \"%d\"", sap->sin_len);
868#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
869  plog(XLOG_DEBUG, "NA->addr.sin_family = \"%d\"", sap->sin_family);
870  plog(XLOG_DEBUG, "NA->addr.sin_port = \"%d\"", sap->sin_port);
871  plog(XLOG_DEBUG, "NA->addr.sin_addr = \"%s\"",
872       get_hex_string(sizeof(struct in_addr), (const char *) &sap->sin_addr));
873#endif /* not HAVE_TRANSPORT_TYPE_TLI */
874
875  plog(XLOG_DEBUG, "NA->hostname = \"%s\"", nap->hostname ? nap->hostname : "null");
876#ifdef HAVE_NFS_ARGS_T_NAMLEN
877  plog(XLOG_DEBUG, "NA->namlen = %d", nap->namlen);
878#endif /* HAVE_NFS_ARGS_T_NAMLEN */
879
880#ifdef MNT2_NFS_OPT_FSNAME
881  plog(XLOG_DEBUG, "NA->fsname = \"%s\"", nap->fsname ? nap->fsname : "null");
882#endif /* MNT2_NFS_OPT_FSNAME */
883
884#ifdef HAVE_NFS_ARGS_T_FHSIZE
885  plog(XLOG_DEBUG, "NA->fhsize = %d", nap->fhsize);
886  fhlen = nap->fhsize;
887#endif /* HAVE_NFS_ARGS_T_FHSIZE */
888#ifdef HAVE_NFS_ARGS_T_FH_LEN
889  plog(XLOG_DEBUG, "NA->fh_len = %d", nap->fh_len);
890  fhlen = nap->fh_len;
891#endif /* HAVE_NFS_ARGS_T_FH_LEN */
892
893  /*
894   * XXX: need to figure out how to correctly print file handles,
895   * since some times they are pointers, and sometimes the real structure
896   * is stored in nfs_args.  Even if it is a pointer, it can be the actual
897   * char[] array, or a structure containing multiple fields.
898   */
899  plog(XLOG_DEBUG, "NA->filehandle = \"%s\"",
900       get_hex_string(fhlen, (const char *) &nap->NFS_FH_FIELD));
901
902#ifdef HAVE_NFS_ARGS_T_SOTYPE
903  plog(XLOG_DEBUG, "NA->sotype = %d", nap->sotype);
904#endif /* HAVE_NFS_ARGS_T_SOTYPE */
905#ifdef HAVE_NFS_ARGS_T_PROTO
906  plog(XLOG_DEBUG, "NA->proto = %d", (int) nap->proto);
907#endif /* HAVE_NFS_ARGS_T_PROTO */
908#ifdef HAVE_NFS_ARGS_T_VERSION
909  plog(XLOG_DEBUG, "NA->version = %d", nap->version);
910#endif /* HAVE_NFS_ARGS_T_VERSION */
911
912  plog(XLOG_DEBUG, "NA->flags = 0x%x", (int) nap->flags);
913
914  plog(XLOG_DEBUG, "NA->rsize = %d", (int) nap->rsize);
915  plog(XLOG_DEBUG, "NA->wsize = %d", (int) nap->wsize);
916#ifdef HAVE_NFS_ARGS_T_BSIZE
917  plog(XLOG_DEBUG, "NA->bsize = %d", nap->bsize);
918#endif /* HAVE_NFS_ARGS_T_BSIZE */
919  plog(XLOG_DEBUG, "NA->timeo = %d", (int) nap->timeo);
920  plog(XLOG_DEBUG, "NA->retrans = %d", (int) nap->retrans);
921
922#ifdef HAVE_NFS_ARGS_T_ACREGMIN
923  plog(XLOG_DEBUG, "NA->acregmin = %d", (int) nap->acregmin);
924  plog(XLOG_DEBUG, "NA->acregmax = %d", (int) nap->acregmax);
925  plog(XLOG_DEBUG, "NA->acdirmin = %d", (int) nap->acdirmin);
926  plog(XLOG_DEBUG, "NA->acdirmax = %d", (int) nap->acdirmax);
927#endif /* HAVE_NFS_ARGS_T_ACREGMIN */
928#ifdef MNTTAB_OPT_SYMTTL
929  plog(XLOG_DEBUG, "NA->symttl = %d", nap->symttl);
930#endif /* MNTTAB_OPT_SYMTTL */
931#ifdef MNTTAB_OPT_PG_THRESH
932  plog(XLOG_DEBUG, "NA->pg_thresh = %d", nap->pg_thresh);
933#endif /* MNTTAB_OPT_PG_THRESH */
934
935#ifdef MNT2_NFS_OPT_BIODS
936  plog(XLOG_DEBUG, "NA->biods = %d", nap->biods);
937#endif /* MNT2_NFS_OPT_BIODS */
938
939}
940#endif /* DEBUG */
941