xref: /original-bsd/usr.sbin/amd/amd/efs_ops.c (revision 92ab646d)
1 /*
2  * $Id: efs_ops.c,v 5.2 90/06/23 22:19:23 jsp Rel $
3  *
4  * Copyright (c) 1989 Jan-Simon Pendry
5  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
6  * Copyright (c) 1989 The Regents of the University of California.
7  * All rights reserved.
8  *
9  * This code is derived from software contributed to Berkeley by
10  * Jan-Simon Pendry at Imperial College, London.
11  *
12  * %sccs.include.redist.c%
13  *
14  *	@(#)efs_ops.c	5.1 (Berkeley) 06/29/90
15  */
16 
17 #include "am.h"
18 
19 #ifdef HAS_EFS
20 
21 /*
22  * Error file system.
23  * This is used as a last resort catchall if
24  * nothing else worked.  EFS just returns lots
25  * of error codes, except for unmount which
26  * always works of course.
27  */
28 
29 /*
30  * EFS file system always matches
31  */
32 static int efs_match(fo)
33 am_opts *fo;
34 {
35 	fo->fs_mtab = strealloc(fo->fs_mtab, "(error-hook)");
36 	return 1;
37 }
38 
39 /*ARGSUSED*/
40 static int efs_mount(mp)
41 am_node *mp;
42 {
43 	return ENOENT;
44 }
45 
46 /*ARGSUSED*/
47 static int efs_umount(mp)
48 am_node *mp;
49 {
50 	/*
51 	 * Always succeed
52 	 */
53 
54 	return 0;
55 }
56 
57 /*
58  * EFS interface to RPC lookup() routine.
59  * Should never get here in the automounter.
60  * If we do then just give an error.
61  */
62 /*ARGSUSED*/
63 am_node *efs_lookuppn(mp, fname, error_return, op)
64 am_node *mp;
65 char *fname;
66 int *error_return;
67 int op;
68 {
69 	*error_return = ESTALE;
70 	return 0;
71 }
72 
73 /*
74  * EFS interface to RPC readdir() routine.
75  * Should never get here in the automounter.
76  * If we do then just give an error.
77  */
78 /*ARGSUSED*/
79 int efs_readdir(mp, cookie, dp, ep)
80 am_node *mp;
81 nfscookie cookie;
82 dirlist *dp;
83 entry *ep;
84 {
85 	return ESTALE;
86 }
87 
88 /*
89  * Ops structure
90  */
91 am_ops efs_ops = {
92 	"error",
93 	efs_match,
94 	0, /* efs_init */
95 	efs_mount,
96 	efs_umount,
97 	efs_lookuppn,
98 	efs_readdir,
99 	0, /* efs_readlink */
100 	0, /* efs_mounted */
101 	0, /* efs_umounted */
102 	find_afs_srvr,
103 	FS_DISCARD
104 };
105 
106 #endif /* HAS_EFS */
107