home *** CD-ROM | disk | FTP | other *** search
/ Computer Club Elmshorn Atari PD / CCE_PD.iso / pc / 0600 / CCE_0646.ZIP / CCE_0646.PD / MFS606S / MINIXFS / DUMMYFS.C < prev    next >
C/C++ Source or Header  |  1993-07-24  |  3KB  |  217 lines

  1. /* 
  2.  * This file contains a 'dummy' filesystem; which does almost nothing. In fact
  3.  * all it does do is to allow changes to call the 'real' m_root.
  4.  * Why have such a thing you may ask? Two reasons, firstly if a minix filesystem
  5.  * on the disk is inaccesible for some reason (directory increment too big for
  6.  * example) then minixfs shouldn't touch it; however we don't want it sent to 
  7.  * other filesystems where it could get trashed. The second case is for physical
  8.  * partitions: minit has to have some way of finding out the currently invalid
  9.  * partition's parameters.
  10.  */
  11.  
  12. #include "minixfs.h"
  13. #include "proto.h"
  14. #include "global.h"
  15.  
  16. FILESYS dummy_filesys = {
  17.     (FILESYS *) 0,0,
  18.     m_root, no_lookup, no_creat, no_getdev,
  19.     no_getxattr, no_chattr, no_chown,
  20.     no_chmode, no_mkdir,
  21.     no_rmdir, no_remove, no_getname,
  22.     no_rename, no_opendir, no_readdir,
  23.     no_rewinddir, no_closedir,
  24.     no_pathconf, no_dfree,
  25.     no_wlabel, no_rlabel,
  26.     no_symlink, no_readlink,
  27.     no_hardlink, dummy_fscntl, m_dskchng,
  28.     m_release,m_dupcookie
  29. };
  30.  
  31. long no_lookup(dir,name,entry)
  32. fcookie *dir; 
  33. char *name;
  34. fcookie *entry;
  35. {
  36.     return EFILNF;
  37. }
  38.  
  39. long no_creat(dir,name,mode,attr,entry)
  40. fcookie *dir;
  41. char *name;
  42. unsigned mode;
  43. int attr;
  44. fcookie *entry;
  45. {
  46.     return EACCDN;
  47. }
  48.  
  49. DEVDRV * no_getdev(file,special)
  50. fcookie *file;
  51. long *special;
  52. {
  53.     *special=EINVFN;
  54.     return NULL;
  55. }
  56.  
  57. long no_getxattr(file,xattr)
  58. fcookie *file;
  59. XATTR *xattr;
  60. {
  61.     return EACCDN;
  62. }
  63.  
  64. long no_chown(file, uid , gid)
  65. fcookie *file;
  66. int uid,gid;
  67. {
  68.         return EINVFN;
  69. }
  70.  
  71. long no_chmode(file, mode)
  72. fcookie *file;
  73. unsigned mode;
  74. {
  75.         return EINVFN;
  76. }
  77.  
  78.  
  79. long no_mkdir(dir,name,mode)
  80. fcookie *dir;
  81. char *name;
  82. unsigned mode;
  83. {
  84.     return EACCDN;
  85. }
  86.  
  87. long no_rmdir(dir,name)
  88. fcookie *dir;
  89. char *name;
  90. {
  91.         return EACCDN;
  92. }
  93.  
  94. long no_remove(dir,name)
  95. fcookie *dir;
  96. char *name;
  97. {
  98.     return EACCDN;
  99. }
  100.  
  101. long no_getname(root,dir,pathname,length)
  102. fcookie *root,*dir;
  103. char *pathname;
  104. short length;
  105. {
  106.     return EACCDN;
  107. }
  108.  
  109.  
  110. long no_opendir(dirh,flag)
  111. DIR *dirh;
  112. int flag;
  113. {
  114.     return 0;
  115. }
  116.  
  117. long no_readdir(dirh,name,namelen,fc)
  118. DIR *dirh;
  119. char *name;
  120. int namelen;
  121. fcookie *fc;
  122. {
  123.         return ENMFIL;
  124. }
  125.  
  126. long no_rewinddir(dirh)
  127. DIR *dirh;
  128. {
  129.     return 0;
  130. }
  131.  
  132. long no_closedir(dirh)
  133. DIR *dirh;
  134. {
  135.     return 0;
  136. }
  137.  
  138. long no_rlabel(dir,name,namelen)
  139. fcookie *dir;
  140. char *name;
  141. int namelen;
  142. {
  143.     return EFILNF;
  144. }
  145.  
  146. long no_wlabel(dir,name)
  147. fcookie *dir;
  148. char *name;
  149. {
  150.     return EACCDN;
  151. }
  152.  
  153. long no_dfree(dir,buffer)
  154. fcookie *dir;
  155. long *buffer;
  156. {
  157.     return EINVFN;
  158. }
  159.  
  160. long dummy_fscntl(dir,name,cmd,arg)
  161. fcookie *dir;
  162. char *name;
  163. int cmd;
  164. long arg;
  165. {
  166.     if(cmd!=MFS_PHYS) return EINVFN;
  167.     return m_fscntl(dir,name,cmd,arg);
  168. }
  169.  
  170. long no_rename(olddir,oldname,newdir,newname)
  171. fcookie *olddir;
  172. char *oldname;
  173. fcookie *newdir;
  174. char *newname;
  175. {
  176.         return EACCDN;
  177. }
  178.  
  179. long no_hardlink(fromdir,fromname,todir,toname)
  180. fcookie *fromdir;
  181. char *fromname;
  182. fcookie *todir;
  183. char *toname;
  184. {
  185.         return EINVFN;
  186. }
  187.  
  188. long no_symlink(dir,name,to)
  189. fcookie *dir;
  190. char *name;
  191. char *to;
  192. {
  193.         return EINVFN;
  194. }
  195.  
  196. long no_readlink(file,buf,len)
  197. fcookie *file;
  198. char *buf;
  199. int len;
  200. {
  201.     return EINVFN;
  202. }
  203.  
  204. long no_chattr(file,attr)
  205. fcookie *file;
  206. int attr;
  207. {
  208.     return EFILNF;
  209. }
  210.  
  211. long no_pathconf(dir,which)
  212. fcookie *dir;
  213. int which;
  214. {
  215.     return EINVFN;
  216. }
  217.