xref: /original-bsd/usr.sbin/amd/amd/efs_ops.c (revision 95a66346)
1 /*
2  * $Id: efs_ops.c,v 5.2.1.2 90/11/04 23:17:14 jsp Exp $
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.2 (Berkeley) 03/17/91
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 char *efs_match(fo)
33 am_opts *fo;
34 {
35 	return strdup("(error-hook)");
36 }
37 
38 /*ARGSUSED*/
39 static int efs_fmount(mf)
40 mntfs *mf;
41 {
42 	return ENOENT;
43 }
44 
45 /*ARGSUSED*/
46 static int efs_fumount(mf)
47 mntfs *mf;
48 {
49 	/*
50 	 * Always succeed
51 	 */
52 
53 	return 0;
54 }
55 
56 /*
57  * EFS interface to RPC lookup() routine.
58  * Should never get here in the automounter.
59  * If we do then just give an error.
60  */
61 /*ARGSUSED*/
62 am_node *efs_lookuppn(mp, fname, error_return, op)
63 am_node *mp;
64 char *fname;
65 int *error_return;
66 int op;
67 {
68 	*error_return = ESTALE;
69 	return 0;
70 }
71 
72 /*
73  * EFS interface to RPC readdir() routine.
74  * Should never get here in the automounter.
75  * If we do then just give an error.
76  */
77 /*ARGSUSED*/
78 int efs_readdir(mp, cookie, dp, ep, count)
79 am_node *mp;
80 nfscookie cookie;
81 dirlist *dp;
82 entry *ep;
83 int count;
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 	auto_fmount,
96 	efs_fmount,
97 	auto_fumount,
98 	efs_fumount,
99 	efs_lookuppn,
100 	efs_readdir,
101 	0, /* efs_readlink */
102 	0, /* efs_mounted */
103 	0, /* efs_umounted */
104 	find_afs_srvr,
105 	FS_DISCARD
106 };
107 
108 #endif /* HAS_EFS */
109