home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume21 / amd / part02 / efs_ops.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-10  |  2.5 KB  |  119 lines

  1. /*
  2.  * $Id: efs_ops.c,v 5.1.1.2 90/01/11 17:06:03 jsp Exp Locker: jsp $
  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.  * Redistribution and use in source and binary forms are permitted
  13.  * provided that the above copyright notice and this paragraph are
  14.  * duplicated in all such forms and that any documentation,
  15.  * advertising materials, and other materials related to such
  16.  * distribution and use acknowledge that the software was developed
  17.  * by Imperial College of Science, Technology and Medicine, London, UK.
  18.  * The names of the College and University may not be used to endorse
  19.  * or promote products derived from this software without specific
  20.  * prior written permission.
  21.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  22.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  23.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  24.  *
  25.  *    %W% (Berkeley) %G%
  26.  */
  27.  
  28. #include "am.h"
  29.  
  30. #ifdef HAS_EFS
  31.  
  32. /*
  33.  * Error file system.
  34.  * This is used as a last resort catchall if
  35.  * nothing else worked.  EFS just returns lots
  36.  * of error codes, except for unmount which
  37.  * always works of course.
  38.  */
  39.  
  40. /*
  41.  * EFS file system always matches
  42.  */
  43. static int efs_match(fo)
  44. am_opts *fo;
  45. {
  46.     fo->fs_mtab = strealloc(fo->fs_mtab, "(error-hook)");
  47.     return 1;
  48. }
  49.  
  50. /*ARGSUSED*/
  51. static int efs_mount(mp)
  52. am_node *mp;
  53. {
  54.     return ENOENT;
  55. }
  56.  
  57. /*ARGSUSED*/
  58. static int efs_umount(mp)
  59. am_node *mp;
  60. {
  61.     /*
  62.      * Always succeed
  63.      */
  64.  
  65.     return 0;
  66. }
  67.  
  68. /*
  69.  * EFS interface to RPC lookup() routine.
  70.  * Should never get here in the automounter.
  71.  * If we do then just give an error.
  72.  */
  73. /*ARGSUSED*/
  74. am_node *efs_lookuppn(mp, fname, error_return, op)
  75. am_node *mp;
  76. char *fname;
  77. int *error_return;
  78. int op;
  79. {
  80.     *error_return = ESTALE;
  81.     return 0;
  82. }
  83.  
  84. /*
  85.  * EFS interface to RPC readdir() routine.
  86.  * Should never get here in the automounter.
  87.  * If we do then just give an error.
  88.  */
  89. /*ARGSUSED*/
  90. int efs_readdir(mp, cookie, dp, ep)
  91. am_node *mp;
  92. nfscookie cookie;
  93. dirlist *dp;
  94. entry *ep;
  95. {
  96.     return ESTALE;
  97. }
  98.  
  99. /*
  100.  * Ops structure
  101.  */
  102. am_ops efs_ops = {
  103.     "error",
  104.     efs_match,
  105.     0, /* efs_init */
  106.     efs_mount,
  107.     efs_umount,
  108.     efs_lookuppn,
  109.     efs_readdir,
  110.     0, /* efs_readlink */
  111.     0, /* efs_mounted */
  112.     0, /* efs_umounted */
  113.     find_afs_srvr,
  114.     FS_DISCARD,
  115.     &afs_srvr_list
  116. };
  117.  
  118. #endif
  119.