1 /* 2 * Copyright (c) 1989 Jan-Simon Pendry 3 * Copyright (c) 1989 Imperial College of Science, Technology & Medicine 4 * Copyright (c) 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Jan-Simon Pendry at Imperial College, London. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)efs_ops.c 8.1 (Berkeley) 06/06/93 13 * 14 * $Id: efs_ops.c,v 5.2.2.1 1992/02/09 15:08:21 jsp beta $ 15 * 16 */ 17 18 #include "am.h" 19 20 #ifdef HAS_EFS 21 22 /* 23 * Error file system. 24 * This is used as a last resort catchall if 25 * nothing else worked. EFS just returns lots 26 * of error codes, except for unmount which 27 * always works of course. 28 */ 29 30 /* 31 * EFS file system always matches 32 */ 33 static char *efs_match(fo) 34 am_opts *fo; 35 { 36 return strdup("(error-hook)"); 37 } 38 39 /*ARGSUSED*/ 40 static int efs_fmount(mf) 41 mntfs *mf; 42 { 43 return ENOENT; 44 } 45 46 /*ARGSUSED*/ 47 static int efs_fumount(mf) 48 mntfs *mf; 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, count) 80 am_node *mp; 81 nfscookie cookie; 82 dirlist *dp; 83 entry *ep; 84 int count; 85 { 86 return ESTALE; 87 } 88 89 /* 90 * Ops structure 91 */ 92 am_ops efs_ops = { 93 "error", 94 efs_match, 95 0, /* efs_init */ 96 auto_fmount, 97 efs_fmount, 98 auto_fumount, 99 efs_fumount, 100 efs_lookuppn, 101 efs_readdir, 102 0, /* efs_readlink */ 103 0, /* efs_mounted */ 104 0, /* efs_umounted */ 105 find_afs_srvr, 106 FS_DISCARD 107 }; 108 109 #endif /* HAS_EFS */ 110