* Copyright (c) 1989 Jan-Simon Pendry
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
* Copyright (c) 1989 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Jan-Simon Pendry at Imperial College, London.
* %sccs.include.redist.c%
* @(#)am_ops.c 5.3 (Berkeley) %G%
* $Id: am_ops.c,v 5.2.1.5 91/05/07 22:17:46 jsp Alpha $
static am_ops
*vops
[] = {
&afs_ops
, /* These four should be last ... */
&efs_ops
, /* ... in the order afs; dfs; toplvl; efs */
void ops_showfstypes
P((FILE *fp
));
for (ap
= vops
; *ap
; ap
++) {
fprintf(fp
, "%s%s", sep
, (*ap
)->fs_type
);
* Crack a SunOS4-style host:fs:sub-link line
* Construct an amd-style line and call the
am_ops
*sunos4_match(fo
, key
, g_key
, path
, keym
, map
)
char *fs
= strchr(host
, ':');
char *sublink
= fs
? strchr(fs
+1, ':') : 0;
sprintf(keybuf
, "type:=nfs;rhost:=%s;rfs:=%s;sublink:=%s;opts:=%s", host
,
sublink
? sublink
+1 : "",
return ops_match(fo
, keybuf
, "", path
, keym
, map
);
#endif /* SUNOS4_COMPAT */
am_ops
*ops_match(fo
, key
, g_key
, path
, keym
, map
)
* First crack the global opts and the local opts
if (!eval_fs_opts(fo
, key
, g_key
, path
, keym
, map
)) {
} else if (fo
->opt_type
== 0) {
plog(XLOG_USER
, "No fs type specified (key = \"%s\", map = \"%s\")", keym
, map
);
* Next find the correct filesystem type
for (vp
= vops
; rop
= *vp
; vp
++)
if (strcmp(rop
->fs_type
, fo
->opt_type
) == 0)
plog(XLOG_USER
, "fs type \"%s\" not recognised", fo
->opt_type
);
* Make sure we have a default mount option.
* Otherwise skip past any leading '-'.
fo
->opt_opts
= "rw,defaults";
else if (*fo
->opt_opts
== '-')
* Check the filesystem is happy
free((voidp
) fo
->fs_mtab
);
if (fo
->fs_mtab
= (*rop
->fs_match
)(fo
))
* Return error file system
fo
->fs_mtab
= (*efs_ops
.fs_match
)(fo
);