Deleted Added
full compact
mount_fs.c (131706) mount_fs.c (174313)
1/*
1/*
2 * Copyright (c) 1997-2004 Erez Zadok
2 * Copyright (c) 1997-2006 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *

--- 20 unchanged lines hidden (view full) ---

31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *

--- 20 unchanged lines hidden (view full) ---

31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
39 *
41 * $Id: mount_fs.c,v 1.11.2.12 2004/01/06 03:15:24 ezk Exp $
42 * $FreeBSD: head/contrib/amd/libamu/mount_fs.c 131706 2004-07-06 13:16:49Z mbr $
40 * File: am-utils/libamu/mount_fs.c
43 *
44 */
45
46#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 */
41 *
42 */
43
44#ifdef HAVE_CONFIG_H
45# include <config.h>
46#endif /* HAVE_CONFIG_H */
47#include <am_defs.h>
48#include <amu.h>
49
50
51/* 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); }
52#define append_opts(old, l, new) { \
53 if (*(old) != '\0') \
54 xstrlcat(old, ",", l); \
55 xstrlcat(old, new, l); }
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},

--- 38 unchanged lines hidden (view full) ---

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
56
57/*
58 * Standard mount flags
59 */
60struct opt_tab mnt_flags[] =
61{
62#if defined(MNT2_GEN_OPT_RDONLY) && defined(MNTTAB_OPT_RO)
63 {MNTTAB_OPT_RO, MNT2_GEN_OPT_RDONLY},

--- 38 unchanged lines hidden (view full) ---

102#endif /* defined(MNT2_GEN_OPT_SYNC) && defined(MNTTAB_OPT_SYNC) */
103
104#if defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY)
105 {MNTTAB_OPT_OVERLAY, MNT2_GEN_OPT_OVERLAY},
106#endif /* defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY) */
107
108 /*
109 * Do not define MNT2_NFS_OPT_* entries here! This is for generic
111 * mount(2) options only, not for NFS mount options.
110 * mount(2) options only, not for NFS mount options. If you need to put
111 * something here, it's probably not the right place: see
112 * include/am_compat.h.
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
113 */
114
115 {0, 0}
116};
117
118
119/* compute generic mount flags */
120int
121compute_mount_flags(mntent_t *mntp)
122{
123 struct opt_tab *opt;
124 int flags = 0;
125
126#ifdef MNT2_GEN_OPT_NEWTYPE
126 flags = MNT2_GEN_OPT_NEWTYPE;
127 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++) {
128#endif /* MNT2_GEN_OPT_NEWTYPE */
129#ifdef MNT2_GEN_OPT_AUTOMOUNTED
130 flags |= MNT2_GEN_OPT_AUTOMOUNTED;
131#endif /* not MNT2_GEN_OPT_AUTOMOUNTED */
132
133 /*
134 * Crack basic mount options
135 */
136 for (opt = mnt_flags; opt->opt; opt++) {
136 flags |= hasmntopt(mntp, opt->opt) ? opt->flag : 0;
137 flags |= amu_hasmntopt(mntp, opt->opt) ? opt->flag : 0;
137 }
138
139 return flags;
140}
141
142
143/* compute generic mount flags for automounter mounts */
144int

--- 8 unchanged lines hidden (view full) ---

153 flags |= MNT2_GEN_OPT_AUTOMNTFS;
154#endif /* not MNT2_GEN_OPT_AUTOMNTFS */
155
156 return flags;
157}
158
159
160int
138 }
139
140 return flags;
141}
142
143
144/* compute generic mount flags for automounter mounts */
145int

--- 8 unchanged lines hidden (view full) ---

154 flags |= MNT2_GEN_OPT_AUTOMNTFS;
155#endif /* not MNT2_GEN_OPT_AUTOMNTFS */
156
157 return flags;
158}
159
160
161int
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)
162mount_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, int on_autofs)
162{
163 int error = 0;
164#ifdef MOUNT_TABLE_ON_FILE
163{
164 int error = 0;
165#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;
166 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) */
167 size_t l;
172#endif /* MOUNT_TABLE_ON_FILE */
168#endif /* MOUNT_TABLE_ON_FILE */
169 char *mnt_dir = 0;
173
170
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 */
171#ifdef NEED_AUTOFS_SPACE_HACK
172 char *old_mnt_dir = 0;
173 /* perform space hack */
174 if (on_autofs) {
175 old_mnt_dir = mnt->mnt_dir;
176 mnt->mnt_dir = mnt_dir = autofs_strdup_space_hack(old_mnt_dir);
177 } else
178#endif /* NEED_AUTOFS_SPACE_HACK */
179 mnt_dir = strdup(mnt->mnt_dir);
178
180
179again:
180 clock_valid = 0;
181 dlog("'%s' fstype " MTYPE_PRINTF_TYPE " (%s) flags %#x (%s)",
182 mnt_dir, type, mnt->mnt_type, flags, mnt->mnt_opts);
181
183
184again:
182 error = MOUNT_TRAP(type, mnt, flags, mnt_data);
183
184 if (error < 0) {
185 error = MOUNT_TRAP(type, mnt, flags, mnt_data);
186
187 if (error < 0) {
185 plog(XLOG_ERROR, "%s: mount: %m", mnt->mnt_dir);
188 plog(XLOG_ERROR, "'%s': mount: %m", 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 */
189 /*
190 * The following code handles conditions which shouldn't
191 * occur. They are possible either because amd screws up
192 * in preparing for the mount, or because some human
193 * messed with the mount point. Both have been known to
194 * happen. -- stolcke 2/22/95
195 */
193 if (errno == ENOENT) {
196 if (errno == EBUSY) {
194 /*
197 /*
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 */
198 * Also, sometimes unmount isn't called, e.g., because
199 * our mountlist is garbled. This leaves old mount
200 * points around which need to be removed before we
201 * can mount something new in their place.
202 */
214 errno = umount_fs(mnt->mnt_dir, mnttabname);
203 errno = umount_fs(mnt_dir, mnttabname, on_autofs);
215 if (errno != 0)
204 if (errno != 0)
216 plog(XLOG_ERROR, "%s: umount: %m", mnt->mnt_dir);
205 plog(XLOG_ERROR, "'%s': umount: %m", mnt_dir);
217 else {
206 else {
218 plog(XLOG_WARNING, "extra umount required for %s",
219 mnt->mnt_dir);
207 plog(XLOG_WARNING, "extra umount required for '%s'", 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 }
208 error = MOUNT_TRAP(type, mnt, flags, mnt_data);
209 }
210 }
211 }
212
213 if (error < 0 && --retry > 0) {
214 sleep(1);
215 goto again;
216 }
217
218#ifdef NEED_AUTOFS_SPACE_HACK
219 /* Undo space hack */
220 if (on_autofs)
221 mnt->mnt_dir = old_mnt_dir;
222#endif /* NEED_AUTOFS_SPACE_HACK */
223
229 if (error < 0) {
224 if (error < 0) {
230 return errno;
225 error = errno;
226 goto out;
231 }
232
233#ifdef MOUNT_TABLE_ON_FILE
234 /*
235 * Allocate memory for options:
236 * dev=..., vers={2,3}, proto={tcp,udp}
237 */
227 }
228
229#ifdef MOUNT_TABLE_ON_FILE
230 /*
231 * Allocate memory for options:
232 * dev=..., vers={2,3}, proto={tcp,udp}
233 */
238 zopts = (char *) xmalloc(strlen(mnt->mnt_opts) + 48);
234 l = strlen(mnt->mnt_opts) + 48;
235 zopts = (char *) xmalloc(l);
239
240 /* copy standard options */
241 xopts = mnt->mnt_opts;
242
236
237 /* copy standard options */
238 xopts = mnt->mnt_opts;
239
243 strcpy(zopts, xopts);
240 xstrlcpy(zopts, xopts, l);
244
245# ifdef MNTTAB_OPT_DEV
241
242# 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);
243 {
244 /* add the extra dev= field to the mount table */
245 struct stat stb;
246 if (lstat(mnt_dir, &stb) == 0) {
247 char optsbuf[48];
248 if (sizeof(stb.st_dev) == 2) /* e.g. SunOS 4.1 */
249 xsnprintf(optsbuf, sizeof(optsbuf), "%s=%04lx",
250 MNTTAB_OPT_DEV, (u_long) stb.st_dev & 0xffff);
251 else /* e.g. System Vr4 */
252 xsnprintf(optsbuf, sizeof(optsbuf), "%s=%08lx",
253 MNTTAB_OPT_DEV, (u_long) stb.st_dev);
254 append_opts(zopts, l, optsbuf);
255 }
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) {
256 }
257# endif /* MNTTAB_OPT_DEV */
258
259# if defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS)
260 /*
261 * add the extra vers={2,3} field to the mount table,
262 * unless already specified by user
263 */
264 if (nfs_version == NFS_VERSION3 &&
265 hasmntval(mnt, MNTTAB_OPT_VERS) != NFS_VERSION3) {
265 sprintf(optsbuf, "%s=%d", MNTTAB_OPT_VERS, NFS_VERSION3);
266 append_opts(zopts, optsbuf);
266 char optsbuf[48];
267 xsnprintf(optsbuf, sizeof(optsbuf),
268 "%s=%d", MNTTAB_OPT_VERS, NFS_VERSION3);
269 append_opts(zopts, l, 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 */
270 }
271# endif /* defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS) */
272
273# ifdef MNTTAB_OPT_PROTO
274 /*
275 * add the extra proto={tcp,udp} field to the mount table,
276 * unless already specified by user.
277 */
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 if (nfs_proto && !amu_hasmntopt(mnt, MNTTAB_OPT_PROTO)) {
279 char optsbuf[48];
280 xsnprintf(optsbuf, sizeof(optsbuf), "%s=%s", MNTTAB_OPT_PROTO, nfs_proto);
281 append_opts(zopts, l, 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
282 }
283# endif /* MNTTAB_OPT_PROTO */
284
285 /* finally, store the options into the mount table structure */
286 mnt->mnt_opts = zopts;
287
288 /*
289 * Additional fields in mntent_t
290 * are fixed up here
291 */
292# ifdef HAVE_MNTENT_T_MNT_CNODE
293 mnt->mnt_cnode = 0;
294# endif /* HAVE_MNTENT_T_MNT_CNODE */
295
296# ifdef HAVE_MNTENT_T_MNT_RO
293 mnt->mnt_ro = (hasmntopt(mnt, MNTTAB_OPT_RO) != NULL);
297 mnt->mnt_ro = (amu_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 */
298# endif /* HAVE_MNTENT_T_MNT_RO */
299
300# ifdef HAVE_MNTENT_T_MNT_TIME
301# ifdef HAVE_MNTENT_T_MNT_TIME_STRING
302 { /* allocate enough space for a long */
299 char *str = (char *) xmalloc(13 * sizeof(char));
300 sprintf(str, "%ld", time((time_t *) NULL));
303 size_t l = 13 * sizeof(char);
304 char *str = (char *) xmalloc(l);
305 xsnprintf(str, l, "%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
306 mnt->mnt_time = str;
307 }
308# else /* not HAVE_MNTENT_T_MNT_TIME_STRING */
309 mnt->mnt_time = time((time_t *) NULL);
310# endif /* not HAVE_MNTENT_T_MNT_TIME_STRING */
311# endif /* HAVE_MNTENT_T_MNT_TIME */
312
313 write_mntent(mnt, mnttabname);
314
315# ifdef MNTTAB_OPT_DEV
316 if (xopts) {
317 XFREE(mnt->mnt_opts);
318 mnt->mnt_opts = xopts;
319 }
320# endif /* MNTTAB_OPT_DEV */
321#endif /* MOUNT_TABLE_ON_FILE */
322
318 return 0;
323 out:
324 XFREE(mnt_dir);
325 return error;
319}
320
321
322/*
326}
327
328
329/*
330 * Compute all NFS attribute cache related flags separately. Note that this
331 * function now computes attribute-cache flags for both Amd's automount
332 * points (NFS) as well as any normal NFS mount that Amd performs. Edit
333 * with caution.
334 */
335static void
336compute_nfs_attrcache_flags(nfs_args_t *nap, mntent_t *mntp)
337{
338 int acval = 0;
339 int err_acval = 1; /* 1 means we found no 'actimeo' value */
340#if defined(HAVE_NFS_ARGS_T_ACREGMIN) || defined(HAVE_NFS_ARGS_T_ACREGMAX) || defined(HAVE_NFS_ARGS_T_ACDIRMIN) || defined(HAVE_NFS_ARGS_T_ACDIRMAX)
341 int err_acrdmm; /* for ac{reg,dir}{min,max} */
342#endif /* HAVE_NFS_ARGS_T_AC{REG,DIR}{MIN,MAX} */
343
344 /************************************************************************/
345 /*** ATTRIBUTE CACHES ***/
346 /************************************************************************/
347 /*
348 * acval is set to 0 at the top of the function. If actimeo mount option
349 * exists and defined in mntopts, then its acval is set to it.
350 * If the value is non-zero, then we set all attribute cache fields to it.
351 * If acval is zero, it means it was never defined in mntopts or the
352 * actimeo mount option does not exist, in which case we check for
353 * individual mount options per attribute cache.
354 * Regardless of the value of acval, mount flags are set based directly
355 * on the values of the attribute caches.
356 */
357#ifdef MNTTAB_OPT_ACTIMEO
358 err_acval = hasmntvalerr(mntp, MNTTAB_OPT_ACTIMEO, &acval); /* attr cache timeout (sec) */
359#endif /* MNTTAB_OPT_ACTIMEO */
360
361 /*** acregmin ***/
362#ifdef HAVE_NFS_ARGS_T_ACREGMIN
363 err_acrdmm = 1; /* 1 means we found no acregmin value */
364 if (!err_acval) {
365 nap->acregmin = acval; /* min ac timeout for reg files (sec) */
366 } else {
367# ifdef MNTTAB_OPT_ACREGMIN
368 err_acrdmm = hasmntvalerr(mntp, MNTTAB_OPT_ACREGMIN, (int *) &nap->acregmin);
369# else /* not MNTTAB_OPT_ACREGMIN */
370 nap->acregmin = 0;
371# endif /* not MNTTAB_OPT_ACREGMIN */
372 }
373 /* set this flag iff we changed acregmin (possibly to zero) */
374# ifdef MNT2_NFS_OPT_ACREGMIN
375 if (!err_acval || !err_acrdmm)
376 nap->flags |= MNT2_NFS_OPT_ACREGMIN;
377# endif /* MNT2_NFS_OPT_ACREGMIN */
378#endif /* HAVE_NFS_ARGS_T_ACREGMIN */
379
380 /*** acregmax ***/
381#ifdef HAVE_NFS_ARGS_T_ACREGMAX
382 err_acrdmm = 1; /* 1 means we found no acregmax value */
383 if (!err_acval) {
384 nap->acregmax = acval; /* max ac timeout for reg files (sec) */
385 } else {
386# ifdef MNTTAB_OPT_ACREGMAX
387 err_acrdmm = hasmntvalerr(mntp, MNTTAB_OPT_ACREGMAX, (int *) &nap->acregmax);
388# else /* not MNTTAB_OPT_ACREGMAX */
389 nap->acregmax = 0;
390# endif /* not MNTTAB_OPT_ACREGMAX */
391 }
392 /* set this flag iff we changed acregmax (possibly to zero) */
393# ifdef MNT2_NFS_OPT_ACREGMAX
394 if (!err_acval || !err_acrdmm)
395 nap->flags |= MNT2_NFS_OPT_ACREGMAX;
396# endif /* MNT2_NFS_OPT_ACREGMAX */
397#endif /* HAVE_NFS_ARGS_T_ACREGMAX */
398
399 /*** acdirmin ***/
400#ifdef HAVE_NFS_ARGS_T_ACDIRMIN
401 err_acrdmm = 1; /* 1 means we found no acdirmin value */
402 if (!err_acval) {
403 nap->acdirmin = acval; /* min ac timeout for dirs (sec) */
404 } else {
405# ifdef MNTTAB_OPT_ACDIRMIN
406 err_acrdmm = hasmntvalerr(mntp, MNTTAB_OPT_ACDIRMIN, (int *) &nap->acdirmin);
407# else /* not MNTTAB_OPT_ACDIRMIN */
408 nap->acdirmin = 0;
409# endif /* not MNTTAB_OPT_ACDIRMIN */
410 }
411 /* set this flag iff we changed acdirmin (possibly to zero) */
412# ifdef MNT2_NFS_OPT_ACDIRMIN
413 if (!err_acval || !err_acrdmm)
414 nap->flags |= MNT2_NFS_OPT_ACDIRMIN;
415# endif /* MNT2_NFS_OPT_ACDIRMIN */
416#endif /* HAVE_NFS_ARGS_T_ACDIRMIN */
417
418 /*** acdirmax ***/
419#ifdef HAVE_NFS_ARGS_T_ACDIRMAX
420 err_acrdmm = 1; /* 1 means we found no acdirmax value */
421 if (!err_acval) {
422 nap->acdirmax = acval; /* max ac timeout for dirs (sec) */
423 } else {
424# ifdef MNTTAB_OPT_ACDIRMAX
425 err_acrdmm = hasmntvalerr(mntp, MNTTAB_OPT_ACDIRMAX, (int *) &nap->acdirmax);
426# else /* not MNTTAB_OPT_ACDIRMAX */
427 nap->acdirmax = 0;
428# endif /* not MNTTAB_OPT_ACDIRMAX */
429 }
430 /* set this flag iff we changed acdirmax (possibly to zero) */
431# ifdef MNT2_NFS_OPT_ACDIRMAX
432 if (!err_acval || !err_acrdmm)
433 nap->flags |= MNT2_NFS_OPT_ACDIRMAX;
434# endif /* MNT2_NFS_OPT_ACDIRMAX */
435#endif /* HAVE_NFS_ARGS_T_ACDIRMAX */
436
437
438 /* don't cache attributes */
439#if defined(MNTTAB_OPT_NOAC) && defined(MNT2_NFS_OPT_NOAC)
440 if (amu_hasmntopt(mntp, MNTTAB_OPT_NOAC) != NULL)
441 nap->flags |= MNT2_NFS_OPT_NOAC;
442#endif /* defined(MNTTAB_OPT_NOAC) && defined(MNT2_NFS_OPT_NOAC) */
443}
444
445
446/*
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
447 * Fill in the many possible fields and flags of struct nfs_args.
448 *
449 * nap: pre-allocated structure to fill in.
450 * mntp: mount entry structure (includes options)
451 * genflags: generic mount flags already determined
452 * nfsncp: (TLI only) netconfig entry for this NFS mount
453 * ip_addr: IP address of file server
454 * nfs_version: 2, 3, (4 in the future), or 0 if unknown
455 * nfs_proto: "udp", "tcp", or NULL.
456 * fhp: file handle structure pointer
457 * host_name: name of remote NFS host
458 * fs_name: remote file system name to mount
459 */
460void
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 */
461compute_nfs_args(nfs_args_t *nap,
462 mntent_t *mntp,
463 int genflags,
464 struct netconfig *nfsncp,
465 struct sockaddr_in *ip_addr,
466 u_long nfs_version,
467 char *nfs_proto,
468 am_nfs_handle_t *fhp,
469 char *host_name,
470 char *fs_name)
342{
471{
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
472 /* initialize just in case */
473 memset((voidp) nap, 0, sizeof(nfs_args_t));
474
475 /* compute all of the NFS attribute-cache flags */
476 compute_nfs_attrcache_flags(nap, mntp);
477
351 /************************************************************************/
352 /*** FILEHANDLE DATA AND LENGTH ***/
353 /************************************************************************/
354#ifdef HAVE_FS_NFS3
355 if (nfs_version == NFS_VERSION3) {
478 /************************************************************************/
479 /*** FILEHANDLE DATA AND LENGTH ***/
480 /************************************************************************/
481#ifdef HAVE_FS_NFS3
482 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 */
483# if defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN)
484 /*
485 * Some systems (Irix/bsdi3) have a separate field in nfs_args for
486 * the length of the file handle for NFS V3. They insist that
487 * the file handle set in nfs_args be plain bytes, and not
488 * include the length field.
489 */
369 NFS_FH_DREF(nap->NFS_FH_FIELD, &(fh3.fh3_u.data));
490 NFS_FH_DREF(nap->NFS_FH_FIELD, &fhp->v3.am_fh3_data);
370# else /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
491# else /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
371 NFS_FH_DREF(nap->NFS_FH_FIELD, &fh3);
492 NFS_FH_DREF(nap->NFS_FH_FIELD, &fhp->v3);
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 */
493# endif /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
494# ifdef MNT2_NFS_OPT_NFSV3
495 nap->flags |= MNT2_NFS_OPT_NFSV3;
496# endif /* MNT2_NFS_OPT_NFSV3 */
497# ifdef MNT2_NFS_OPT_VER3
498 nap->flags |= MNT2_NFS_OPT_VER3;
499# endif /* MNT2_NFS_OPT_VER3 */
500 } else
501#endif /* HAVE_FS_NFS3 */
381 NFS_FH_DREF(nap->NFS_FH_FIELD, &(fhp->v2.fhs_fh));
502 NFS_FH_DREF(nap->NFS_FH_FIELD, &fhp->v2);
382
383#ifdef HAVE_NFS_ARGS_T_FHSIZE
384# ifdef HAVE_FS_NFS3
385 if (nfs_version == NFS_VERSION3)
503
504#ifdef HAVE_NFS_ARGS_T_FHSIZE
505# ifdef HAVE_FS_NFS3
506 if (nfs_version == NFS_VERSION3)
386 nap->fhsize = fh3.fh3_length;
507 nap->fhsize = fhp->v3.am_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)
508 else
509# endif /* HAVE_FS_NFS3 */
510 nap->fhsize = FHSIZE;
511#endif /* HAVE_NFS_ARGS_T_FHSIZE */
512
513 /* this is the version of the nfs_args structure, not of NFS! */
514#ifdef HAVE_NFS_ARGS_T_FH_LEN
515# ifdef HAVE_FS_NFS3
516 if (nfs_version == NFS_VERSION3)
396 nap->fh_len = fh3.fh3_length;
517 nap->fh_len = fhp->v3.am_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 /************************************************************************/
518 else
519# endif /* HAVE_FS_NFS3 */
520 nap->fh_len = FHSIZE;
521#endif /* HAVE_NFS_ARGS_T_FH_LEN */
522
523 /************************************************************************/
524 /*** HOST NAME ***/
525 /************************************************************************/
526 /*
527 * XXX: warning, using xstrlcpy in NFS_HN_DREF, which may corrupt a
528 * struct nfs_args, or truncate our concocted "hostname:/path"
529 * string prematurely.
530 */
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 /************************************************************************/
531 NFS_HN_DREF(nap->hostname, host_name);
532#ifdef MNT2_NFS_OPT_HOSTNAME
533 nap->flags |= MNT2_NFS_OPT_HOSTNAME;
534#endif /* MNT2_NFS_OPT_HOSTNAME */
535
536 /************************************************************************/
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 }

--- 37 unchanged lines hidden (view full) ---

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 */
537 /*** IP ADDRESS OF REMOTE HOST ***/
538 /************************************************************************/
539 if (ip_addr) {
540#ifdef HAVE_TRANSPORT_TYPE_TLI
541 nap->addr = ALLOC(struct netbuf); /* free()'ed at end of mount_nfs_fh() */
542#endif /* HAVE_TRANSPORT_TYPE_TLI */
543 NFS_SA_DREF(nap, ip_addr);
544 }

--- 37 unchanged lines hidden (view full) ---

582# endif /* DG_MOUNT_NFS_VERSION */
583#endif /* HAVE_NFS_ARGS_VERSION */
584
585 /************************************************************************/
586 /*** OTHER NFS SOCKET RELATED OPTIONS AND FLAGS ***/
587 /************************************************************************/
588#ifdef MNT2_NFS_OPT_NOCONN
589 /* check if user specified to use unconnected or connected sockets */
527 if (hasmntopt(mntp, MNTTAB_OPT_NOCONN) != NULL)
590 if (amu_hasmntopt(mntp, MNTTAB_OPT_NOCONN) != NULL)
528 nap->flags |= MNT2_NFS_OPT_NOCONN;
591 nap->flags |= MNT2_NFS_OPT_NOCONN;
529 else if (hasmntopt(mntp, MNTTAB_OPT_CONN) != NULL)
592 else if (amu_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

--- 11 unchanged lines hidden (view full) ---

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
593 nap->flags &= ~MNT2_NFS_OPT_NOCONN;
594 else {
595 /*
596 * Some OSs want you to set noconn always. Some want you to always turn
597 * it off. Others want you to turn it on/off only if NFS V.3 is used.
598 * And all of that changes from revision to another. This is
599 * particularly true of OpenBSD, NetBSD, and FreeBSD. So, rather than
600 * attempt to auto-detect this, I'm forced to "fix" it in the individual

--- 11 unchanged lines hidden (view full) ---

612 plog(XLOG_WARNING, "noconn option specified, and was just turned OFF (OS override)! (May cause NFS hangs on some systems...)");
613 }
614# endif /* USE_CONNECTED_NFS_SOCKETS */
615 }
616#endif /* MNT2_NFS_OPT_NOCONN */
617
618#ifdef MNT2_NFS_OPT_RESVPORT
619# ifdef MNTTAB_OPT_RESVPORT
557 if (hasmntopt(mntp, MNTTAB_OPT_RESVPORT) != NULL)
620 if (amu_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 ***/

--- 17 unchanged lines hidden (view full) ---

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 */
621 nap->flags |= MNT2_NFS_OPT_RESVPORT;
622# else /* not MNTTAB_OPT_RESVPORT */
623 nap->flags |= MNT2_NFS_OPT_RESVPORT;
624# endif /* not MNTTAB_OPT_RESVPORT */
625#endif /* MNT2_NFS_OPT_RESVPORT */
626
627 /************************************************************************/
628 /*** OTHER FLAGS AND OPTIONS ***/

--- 17 unchanged lines hidden (view full) ---

646 nap->flags |= MNT2_NFS_OPT_FSNAME;
647#endif /* MNT2_NFS_OPT_FSNAME */
648
649 nap->rsize = hasmntval(mntp, MNTTAB_OPT_RSIZE);
650#ifdef MNT2_NFS_OPT_RSIZE
651 if (nap->rsize)
652 nap->flags |= MNT2_NFS_OPT_RSIZE;
653#endif /* MNT2_NFS_OPT_RSIZE */
654 if (nfs_version == NFS_VERSION && nap->rsize > 8192)
655 nap->rsize = 8192;
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 */
656
657 nap->wsize = hasmntval(mntp, MNTTAB_OPT_WSIZE);
658#ifdef MNT2_NFS_OPT_WSIZE
659 if (nap->wsize)
660 nap->flags |= MNT2_NFS_OPT_WSIZE;
661#endif /* MNT2_NFS_OPT_WSIZE */
662 if (nfs_version == NFS_VERSION && nap->wsize > 8192)
663 nap->wsize = 8192;
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
664
665 nap->timeo = hasmntval(mntp, MNTTAB_OPT_TIMEO);
666#ifdef MNT2_NFS_OPT_TIMEO
667 if (nap->timeo)
668 nap->flags |= MNT2_NFS_OPT_TIMEO;
669#endif /* MNT2_NFS_OPT_TIMEO */
670
671 nap->retrans = hasmntval(mntp, MNTTAB_OPT_RETRANS);
672#ifdef MNT2_NFS_OPT_RETRANS
673 if (nap->retrans)
674 nap->flags |= MNT2_NFS_OPT_RETRANS;
675#endif /* MNT2_NFS_OPT_RETRANS */
676
677#ifdef MNT2_NFS_OPT_BIODS
678 if ((nap->biods = hasmntval(mntp, MNTTAB_OPT_BIODS)))
679 nap->flags |= MNT2_NFS_OPT_BIODS;
680#endif /* MNT2_NFS_OPT_BIODS */
681
615 if (hasmntopt(mntp, MNTTAB_OPT_SOFT) != NULL)
682#ifdef MNT2_NFS_OPT_SOFT
683 if (amu_hasmntopt(mntp, MNTTAB_OPT_SOFT) != NULL)
616 nap->flags |= MNT2_NFS_OPT_SOFT;
684 nap->flags |= MNT2_NFS_OPT_SOFT;
685#endif /* MNT2_NFS_OPT_SOFT */
617
618#ifdef MNT2_NFS_OPT_SPONGY
686
687#ifdef MNT2_NFS_OPT_SPONGY
619 if (hasmntopt(mntp, MNTTAB_OPT_SPONGY) != NULL) {
688 if (amu_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
689 nap->flags |= MNT2_NFS_OPT_SPONGY;
690 if (nap->flags & MNT2_NFS_OPT_SOFT) {
691 plog(XLOG_USER, "Mount opts soft and spongy are incompatible - soft ignored");
692 nap->flags &= ~MNT2_NFS_OPT_SOFT;
693 }
694 }
695#endif /* MNT2_NFS_OPT_SPONGY */
696
697#if defined(MNT2_GEN_OPT_RONLY) && defined(MNT2_NFS_OPT_RONLY)
698 /* Ultrix has separate generic and NFS ro flags */
699 if (genflags & MNT2_GEN_OPT_RONLY)
700 nap->flags |= MNT2_NFS_OPT_RONLY;
701#endif /* defined(MNT2_GEN_OPT_RONLY) && defined(MNT2_NFS_OPT_RONLY) */
702
703#ifdef MNTTAB_OPT_INTR
635 if (hasmntopt(mntp, MNTTAB_OPT_INTR) != NULL)
704 if (amu_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
705 /*
706 * Either turn on the "allow interrupts" option, or
707 * turn off the "disallow interrupts" option"
708 */
709# ifdef MNT2_NFS_OPT_INTR
710 nap->flags |= MNT2_NFS_OPT_INTR;
711# endif /* MNT2_NFS_OPT_INTR */
712# ifdef MNT2_NFS_OPT_NOINTR
713 nap->flags &= ~MNT2_NFS_OPT_NOINTR;
714# endif /* MNT2_NFS_OPT_NOINTR */
715# ifdef MNT2_NFS_OPT_INT
716 nap->flags |= MNT2_NFS_OPT_INT;
717# endif /* MNT2_NFS_OPT_INT */
718# ifdef MNT2_NFS_OPT_NOINT
719 nap->flags &= ~MNT2_NFS_OPT_NOINT;
720# endif /* MNT2_NFS_OPT_NOINT */
721#endif /* MNTTAB_OPT_INTR */
722
723#ifdef MNTTAB_OPT_NODEVS
655 if (hasmntopt(mntp, MNTTAB_OPT_NODEVS) != NULL)
724 if (amu_hasmntopt(mntp, MNTTAB_OPT_NODEVS) != NULL)
656 nap->flags |= MNT2_NFS_OPT_NODEVS;
657#endif /* MNTTAB_OPT_NODEVS */
658
659#ifdef MNTTAB_OPT_COMPRESS
725 nap->flags |= MNT2_NFS_OPT_NODEVS;
726#endif /* MNTTAB_OPT_NODEVS */
727
728#ifdef MNTTAB_OPT_COMPRESS
660 if (hasmntopt(mntp, MNTTAB_OPT_COMPRESS) != NULL)
729 if (amu_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 */
730 nap->flags |= MNT2_NFS_OPT_COMPRESS;
731#endif /* MNTTAB_OPT_COMPRESS */
732
733#ifdef MNTTAB_OPT_PRIVATE /* mount private, single-client tree */
665 if (hasmntopt(mntp, MNTTAB_OPT_PRIVATE) != NULL)
734 if (amu_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)
735 nap->flags |= MNT2_NFS_OPT_PRIVATE;
736#endif /* MNTTAB_OPT_PRIVATE */
737
738#ifdef MNTTAB_OPT_SYMTTL /* symlink cache time-to-live */
739 if ((nap->symttl = hasmntval(mntp, MNTTAB_OPT_SYMTTL)))
740 nap->flags |= MNT2_NFS_OPT_SYMTTL;
741#endif /* MNTTAB_OPT_SYMTTL */
742
743#ifdef MNT2_NFS_OPT_PGTHRESH /* paging threshold */
744 if ((nap->pg_thresh = hasmntval(mntp, MNTTAB_OPT_PGTHRESH)))
745 nap->flags |= MNT2_NFS_OPT_PGTHRESH;
746#endif /* MNT2_NFS_OPT_PGTHRESH */
747
748#if defined(MNT2_NFS_OPT_NOCTO) && defined(MNTTAB_OPT_NOCTO)
680 if (hasmntopt(mntp, MNTTAB_OPT_NOCTO) != NULL)
749 if (amu_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)
750 nap->flags |= MNT2_NFS_OPT_NOCTO;
751#endif /* defined(MNT2_NFS_OPT_NOCTO) && defined(MNTTAB_OPT_NOCTO) */
752
753#if defined(MNT2_NFS_OPT_POSIX) && defined(MNTTAB_OPT_POSIX)
685 if (hasmntopt(mntp, MNTTAB_OPT_POSIX) != NULL) {
754 if (amu_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)
755 nap->flags |= MNT2_NFS_OPT_POSIX;
756 nap->pathconf = NULL;
757 }
758#endif /* MNT2_NFS_OPT_POSIX && MNTTAB_OPT_POSIX */
759
760#if defined(MNT2_NFS_OPT_PROPLIST) && defined(MNTTAB_OPT_PROPLIST)
692 if (hasmntopt(mntp, MNTTAB_OPT_PROPLIST) != NULL)
761 if (amu_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);
762 nap->flags |= MNT2_NFS_OPT_PROPLIST;
763#endif /* defined(MNT2_NFS_OPT_PROPLIST) && defined(MNTTAB_OPT_PROPLIST) */
764
765#if defined(MNT2_NFS_OPT_MAXGRPS) && defined(MNTTAB_OPT_MAXGROUPS)
766 nap->maxgrouplist = hasmntval(mntp, MNTTAB_OPT_MAXGROUPS);
698 if (nap->maxgrouplist != NULL)
767 if (nap->maxgrouplist != 0)
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)
768 nap->flags |= MNT2_NFS_OPT_MAXGRPS;
769#endif /* defined(MNT2_NFS_OPT_MAXGRPS) && defined(MNTTAB_OPT_MAXGROUPS) */
770
771#if defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK)
703 if (hasmntopt(mntp, MNTTAB_OPT_NOLOCK) != NULL)
772 if (amu_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
773 nap->flags |= MNT2_NFS_OPT_NONLM;
774#endif /* defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) */
775
776#if defined(MNT2_NFS_OPT_XLATECOOKIE) && defined(MNTTAB_OPT_XLATECOOKIE)
777 if (amu_hasmntopt(mntp, MNTTAB_OPT_XLATECOOKIE) != NULL)
778 nap->flags |= MNT2_NFS_OPT_XLATECOOKIE;
779#endif /* defined(MNT2_NFS_OPT_XLATECOOKIE) && defined(MNTTAB_OPT_XLATECOOKIE) */
780
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

--- 42 unchanged lines hidden (view full) ---

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
781#ifdef HAVE_NFS_ARGS_T_OPTSTR
782 nap->optstr = mntp->mnt_opts;
783#endif /* HAVE_NFS_ARGS_T_OPTSTR */
784
785 /************************************************************************/
786 /*** FINAL ACTIONS ***/
787 /************************************************************************/
788

--- 42 unchanged lines hidden (view full) ---

831 /*
832 * Don't let the kernel start computing throughput of Amd. The numbers
833 * will be meaningless because of the way Amd does mount retries.
834 */
835 plog(XLOG_INFO, "%s: disabling nfs congestion window", mntp->mnt_dir);
836 nap->flags |= MNT2_NFS_OPT_DUMBTIMR;
837#endif /* MNT2_NFS_OPT_DUMBTIMR */
838
765#ifdef MNT2_NFS_OPT_NOAC
839 /* compute all of the NFS attribute-cache flags */
840 compute_nfs_attrcache_flags(nap, mntp);
841
766 /*
842 /*
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{
843 * Provide a slight bit more security by requiring the kernel to use
844 * reserved ports.
845 */
846#ifdef MNT2_NFS_OPT_RESVPORT
847 nap->flags |= MNT2_NFS_OPT_RESVPORT;
848#endif /* MNT2_NFS_OPT_RESVPORT */
849}
850
851
852#ifdef DEBUG
853/* get string version (in hex) of identifier */
854static char *
855get_hex_string(u_int len, const char *fhdata)
856{
802 int i;
857 u_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);
858 static char buf[128]; /* better not go over it! */
859 char str[16];
860 short int arr[64];
861
862 if (!fhdata)
863 return NULL;
864 buf[0] = '\0';
865 memset(&arr[0], 0, (64 * sizeof(short int)));
866 memcpy(&arr[0], &fhdata[0], len);
812 for (i=0; i813 sprintf(str, "%04x", ntohs(arr[i]));
814 strcat(buf, str);
867 for (i=0; i<len/sizeof(unsigned short int); i++) {
868 xsnprintf(str, sizeof(str), "%04x", ntohs(arr[i]));
869 xstrlcat(buf, str, sizeof(buf));
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{
870 }
871 return buf;
872}
873
874
875/*
876 * print a subset of fields from "struct nfs_args" that are otherwise
877 * not being provided anywhere else.
878 */
879void
880print_nfs_args(const nfs_args_t *nap, u_long nfs_version)
881{
827 int fhlen = 32; /* default: NFS V.2 file handle length is 32 */
882 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) {

--- 10 unchanged lines hidden (view full) ---

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;
883#ifdef HAVE_TRANSPORT_TYPE_TLI
884 struct netbuf *nbp;
885 struct knetconfig *kncp;
886#else /* not HAVE_TRANSPORT_TYPE_TLI */
887 struct sockaddr_in *sap;
888#endif /* not HAVE_TRANSPORT_TYPE_TLI */
889
890 if (!nap) {

--- 10 unchanged lines hidden (view full) ---

901#endif /* NFS_FHSIZE */
902
903#ifdef HAVE_TRANSPORT_TYPE_TLI
904 nbp = nap->addr;
905 plog(XLOG_DEBUG, "NA->addr {netbuf} (maxlen=%d, len=%d) = \"%s\"",
906 nbp->maxlen, nbp->len,
907 get_hex_string(nbp->len, nbp->buf));
908 nbp = nap->syncaddr;
854 plog(XLOG_DEBUG, "NA->syncaddr {netbuf} 0x%x", (int) nbp);
909 plog(XLOG_DEBUG, "NA->syncaddr {netbuf} %p", 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 */
910 kncp = nap->knconf;
911 plog(XLOG_DEBUG, "NA->knconf->semantics %lu", (u_long) kncp->knc_semantics);
912 plog(XLOG_DEBUG, "NA->knconf->protofmly \"%s\"", kncp->knc_protofmly);
913 plog(XLOG_DEBUG, "NA->knconf->proto \"%s\"", kncp->knc_proto);
914 plog(XLOG_DEBUG, "NA->knconf->rdev %lu", (u_long) kncp->knc_rdev);
915 /* don't print knconf->unused field */
916#else /* not HAVE_TRANSPORT_TYPE_TLI */
862 sap = (struct sockaddr_in *) &nap->addr;
917# ifdef NFS_ARGS_T_ADDR_IS_POINTER
918 sap = (struct sockaddr_in *) nap->addr;
919# else /* not NFS_ARGS_T_ADDR_IS_POINTER */
920 sap = (struct sockaddr_in *) &nap->addr;
921# endif /* not NFS_ARGS_T_ADDR_IS_POINTER */
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
922 plog(XLOG_DEBUG, "NA->addr {sockaddr_in} (len=%d) = \"%s\"",
923 (int) sizeof(struct sockaddr_in),
924 get_hex_string(sizeof(struct sockaddr_in), (const char *)sap));
925#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
867 plog(XLOG_DEBUG, "NA->addr.sin_len = \"%d\"", sap->sin_len);
926 /* as per POSIX, sin_len need not be set (used internally by kernel) */
927 plog(XLOG_DEBUG, "NA->addr.sin_len = %d", sap->sin_len);
868#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
928#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);
929 plog(XLOG_DEBUG, "NA->addr.sin_family = %d", sap->sin_family);
930 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 */
931 plog(XLOG_DEBUG, "NA->addr.sin_addr = \"%s\"",
932 get_hex_string(sizeof(struct in_addr), (const char *) &sap->sin_addr));
933#endif /* not HAVE_TRANSPORT_TYPE_TLI */
934#ifdef HAVE_NFS_ARGS_T_ADDRLEN
935 plog(XLOG_DEBUG, "NA->addrlen = %d", nap->addrlen);
936#endif /* ifdef HAVE_NFS_ARGS_T_ADDRLEN */
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");

--- 59 unchanged lines hidden ---
937
938 plog(XLOG_DEBUG, "NA->hostname = \"%s\"", nap->hostname ? nap->hostname : "null");
939#ifdef HAVE_NFS_ARGS_T_NAMLEN
940 plog(XLOG_DEBUG, "NA->namlen = %d", nap->namlen);
941#endif /* HAVE_NFS_ARGS_T_NAMLEN */
942
943#ifdef MNT2_NFS_OPT_FSNAME
944 plog(XLOG_DEBUG, "NA->fsname = \"%s\"", nap->fsname ? nap->fsname : "null");

--- 59 unchanged lines hidden ---