home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.1 / slackwar.003 < prev    next >
Text File  |  1995-10-10  |  118KB  |  3,724 lines

  1. diff -u --recursive --new-file linux-1.1.55/arch/i386/config.in linux/arch/i386/config.in
  2. --- linux-1.1.55/arch/i386/config.in    Thu Oct 20 15:14:23 1994
  3. +++ linux/arch/i386/config.in    Thu Oct 20 17:09:39 1994
  4. @@ -5,10 +5,11 @@
  5.  
  6.  comment 'General setup'
  7.  
  8. -bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
  9. +bool 'Kernel math emulation' CONFIG_MATH_EMULATION y
  10.  bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
  11.  bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
  12.  bool 'Networking support' CONFIG_NET y
  13. +bool 'Filesystem quota support' CONFIG_QUOTA n
  14.  bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
  15.  bool 'System V IPC' CONFIG_SYSVIPC y
  16.  bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
  17. @@ -31,7 +32,7 @@
  18.  
  19.  comment 'SCSI support'
  20.  
  21. -bool 'SCSI support?' CONFIG_SCSI n
  22. +bool 'SCSI support?' CONFIG_SCSI y
  23.  
  24.  if [ "$CONFIG_SCSI" = "n" ]; then
  25.  
  26. @@ -42,25 +43,25 @@
  27.  comment 'SCSI support type (disk, tape, CDrom)'
  28.  
  29.  bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  30. -bool 'Scsi tape support' CONFIG_CHR_DEV_ST n
  31. -bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n
  32. +bool 'Scsi tape support' CONFIG_CHR_DEV_ST y
  33. +bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR y
  34.  bool 'Scsi generic support' CONFIG_CHR_DEV_SG n
  35.  
  36.  comment 'SCSI low-level drivers'
  37.  
  38. -bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X n
  39. +bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X y
  40.  bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 y
  41. -bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 n
  42. -bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n
  43. -bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
  44. -bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n
  45. -bool 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx n
  46. +bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 y
  47. +bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC y
  48. +bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN y
  49. +bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 y
  50. +bool 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx y
  51.  #bool 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 n
  52. -bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n
  53. -bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
  54. -bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 n
  55. -bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
  56. -bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST n
  57. +bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 y
  58. +bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE y
  59. +bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 y
  60. +bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR y
  61. +bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST y
  62.  #bool 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n
  63.  fi
  64.  
  65. @@ -76,56 +77,56 @@
  66.  
  67.  else
  68.  bool 'Dummy net driver support' CONFIG_DUMMY n
  69. -bool 'SLIP (serial line) support' CONFIG_SLIP n
  70. +bool 'SLIP (serial line) support' CONFIG_SLIP y
  71.  if [ "$CONFIG_SLIP" = "y" ]; then
  72.    bool ' CSLIP compressed headers' SL_COMPRESSED y
  73.  #  bool ' SLIP debugging on' SL_DUMP y
  74.  fi
  75. -bool 'PPP (point-to-point) support' CONFIG_PPP n
  76. +bool 'PPP (point-to-point) support' CONFIG_PPP y
  77.  bool 'PLIP (parallel port) support' CONFIG_PLIP n
  78.  bool 'Load balancing support (experimental)' CONFIG_SLAVE_BALANCING n
  79. -bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA n
  80. -bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC n
  81. +bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA y
  82. +bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC y
  83.  if [ "$CONFIG_NET_VENDOR_SMC" = "y" ]; then
  84. -    bool 'WD80*3 support' CONFIG_WD80x3 n
  85. -    bool 'SMC Ultra support' CONFIG_ULTRA n
  86. +    bool 'WD80*3 support' CONFIG_WD80x3 y
  87. +    bool 'SMC Ultra support' CONFIG_ULTRA y
  88.  fi
  89.  bool '3COM cards' CONFIG_NET_VENDOR_3COM y
  90.  if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
  91. -    bool '3c501 support' CONFIG_EL1 n
  92. -    bool '3c503 support' CONFIG_EL2 n
  93. +    bool '3c501 support' CONFIG_EL1 y
  94. +    bool '3c503 support' CONFIG_EL2 y
  95.      if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  96. -        bool '3c505 support' CONFIG_ELPLUS n
  97. -        bool '3c507 support' CONFIG_EL16 n
  98. +        bool '3c505 support' CONFIG_ELPLUS y
  99. +        bool '3c507 support' CONFIG_EL16 y
  100.      fi
  101.      bool '3c509/3c579 support' CONFIG_EL3 y
  102.  fi
  103. -bool 'Other ISA cards' CONFIG_NET_ISA n
  104. +bool 'Other ISA cards' CONFIG_NET_ISA y
  105.  if [ "$CONFIG_NET_ISA" = "y" ]; then
  106. -    bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE n
  107. -    bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 n
  108. -    bool 'DEPCA support' CONFIG_DEPCA n
  109. +    bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE y
  110. +    bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 y
  111. +    bool 'DEPCA support' CONFIG_DEPCA y
  112.      if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  113. -        bool 'EtherExpress support' CONFIG_EEXPRESS n
  114. -        bool 'AT1700 support' CONFIG_AT1700 n
  115. -        bool 'NI5210 support' CONFIG_NI52 n
  116. -        bool 'NI6510 support' CONFIG_NI65 n
  117. +        bool 'EtherExpress support' CONFIG_EEXPRESS y
  118. +        bool 'AT1700 support' CONFIG_AT1700 y
  119. +        bool 'NI5210 support' CONFIG_NI52 y
  120. +        bool 'NI6510 support' CONFIG_NI65 y
  121.      fi
  122. -    bool 'HP PCLAN support' CONFIG_HPLAN n
  123. +    bool 'HP PCLAN support' CONFIG_HPLAN y
  124.      bool 'NE2000/NE1000 support' CONFIG_NE2000 y
  125. -    bool 'SK_G16 support' CONFIG_SK_G16 n
  126. +    bool 'SK_G16 support' CONFIG_SK_G16 y
  127.  fi
  128. -bool 'EISA and on board controllers' CONFIG_NET_EISA n
  129. +bool 'EISA and on board controllers' CONFIG_NET_EISA y
  130.      if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  131. -        bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
  132. +        bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 y
  133.      fi
  134. -    bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
  135. -bool 'Pocket and portable adaptors' CONFIG_NET_POCKET n
  136. +    bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT y
  137. +bool 'Pocket and portable adaptors' CONFIG_NET_POCKET y
  138.  if [ "$CONFIG_NET_POCKET" = "y" ]; then
  139. -    bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
  140. -    bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 n
  141. -    bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
  142. -    bool 'Zenith Z-Note support' CONFIG_ZNET n
  143. +    bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 y
  144. +    bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 y
  145. +    bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP y
  146. +    bool 'Zenith Z-Note support' CONFIG_ZNET y
  147.  fi
  148.  fi
  149.  fi
  150. @@ -150,30 +151,30 @@
  151.  bool 'Standard (minix) fs support' CONFIG_MINIX_FS y
  152.  bool 'Extended fs support' CONFIG_EXT_FS n
  153.  bool 'Second extended fs support' CONFIG_EXT2_FS y
  154. -bool 'xiafs filesystem support' CONFIG_XIA_FS n
  155. +bool 'xiafs filesystem support' CONFIG_XIA_FS y
  156.  bool 'msdos fs support' CONFIG_MSDOS_FS y
  157.  if [ "$CONFIG_MSDOS_FS" = "y" ]; then
  158. -bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n
  159. +bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS y
  160.  fi
  161.  bool '/proc filesystem support' CONFIG_PROC_FS y
  162.  if [ "$CONFIG_INET" = "y" ]; then
  163.  bool 'NFS filesystem support' CONFIG_NFS_FS y
  164.  fi
  165. -bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n
  166. -bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS n
  167. +bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
  168. +bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS y
  169.  bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
  170.  
  171.  comment 'character devices'
  172.  
  173. -bool 'Parallel printer support' CONFIG_PRINTER n
  174. +bool 'Parallel printer support' CONFIG_PRINTER y
  175.  bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
  176. -bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE n
  177. +bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE y
  178.  if [ "$CONFIG_PSMOUSE" = "y" ]; then
  179.  bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE y
  180.  fi
  181.  bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
  182.  bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
  183. -bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n
  184. +bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION y
  185.  
  186.  bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
  187.  if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
  188. @@ -190,7 +191,7 @@
  189.  fi
  190.  fi
  191.  
  192. -bool 'QIC-117 tape support' CONFIG_FTAPE n
  193. +bool 'QIC-117 tape support' CONFIG_FTAPE y
  194.  if [ "$CONFIG_FTAPE" = "y" ]; then
  195.  int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
  196.  fi
  197. @@ -204,5 +205,5 @@
  198.  #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
  199.  bool 'Kernel profiling support' CONFIG_PROFILE n
  200.  if [ "$CONFIG_SCSI" = "y" ]; then
  201. -bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  202. +bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS n
  203.  fi
  204. diff -u --recursive --new-file linux-1.1.55/config.in linux/config.in
  205. --- linux-1.1.55/config.in    Sat Sep 17 21:48:10 1994
  206. +++ linux/config.in    Thu Oct 20 17:09:26 1994
  207. @@ -5,12 +5,14 @@
  208.  
  209.  comment 'General setup'
  210.  
  211. -bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
  212. +bool 'Kernel math emulation' CONFIG_MATH_EMULATION y
  213.  bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
  214.  bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
  215.  bool 'Networking support' CONFIG_NET y
  216. +bool 'Filesystem quota support' CONFIG_QUOTA n
  217.  bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
  218.  bool 'System V IPC' CONFIG_SYSVIPC y
  219. +bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
  220.  bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
  221.  
  222.  if [ "$CONFIG_NET" = "y" ]; then
  223. @@ -24,13 +26,13 @@
  224.  bool 'Assume subnets are local' CONFIG_INET_SNARL y
  225.  bool 'Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n
  226.  fi
  227. -bool 'The IPX protocol' CONFIG_IPX y
  228. +bool 'The IPX protocol' CONFIG_IPX n
  229.  #bool 'Amateur Radio AX.25 Level 2' CONFIG_AX25 n
  230.  fi
  231.  
  232.  comment 'SCSI support'
  233.  
  234. -bool 'SCSI support?' CONFIG_SCSI n
  235. +bool 'SCSI support?' CONFIG_SCSI y
  236.  
  237.  if [ "$CONFIG_SCSI" = "n" ]; then
  238.  
  239. @@ -41,25 +43,25 @@
  240.  comment 'SCSI support type (disk, tape, CDrom)'
  241.  
  242.  bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  243. -bool 'Scsi tape support' CONFIG_CHR_DEV_ST n
  244. -bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n
  245. +bool 'Scsi tape support' CONFIG_CHR_DEV_ST y
  246. +bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR y
  247.  bool 'Scsi generic support' CONFIG_CHR_DEV_SG n
  248.  
  249.  comment 'SCSI low-level drivers'
  250.  
  251. -bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X n
  252. +bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X y
  253.  bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 y
  254. -bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 n
  255. -bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n
  256. -bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
  257. -bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n
  258. -bool 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx n
  259. +bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 y
  260. +bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC y
  261. +bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN y
  262. +bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 y
  263. +bool 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx y
  264.  #bool 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 n
  265. -bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n
  266. -bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
  267. -bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 n
  268. -bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
  269. -bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST n
  270. +bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 y
  271. +bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE y
  272. +bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 y
  273. +bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR y
  274. +bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST y
  275.  #bool 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n
  276.  fi
  277.  
  278. @@ -75,56 +77,56 @@
  279.  
  280.  else
  281.  bool 'Dummy net driver support' CONFIG_DUMMY n
  282. -bool 'SLIP (serial line) support' CONFIG_SLIP n
  283. +bool 'SLIP (serial line) support' CONFIG_SLIP y
  284.  if [ "$CONFIG_SLIP" = "y" ]; then
  285.    bool ' CSLIP compressed headers' SL_COMPRESSED y
  286.  #  bool ' SLIP debugging on' SL_DUMP y
  287.  fi
  288. -bool 'PPP (point-to-point) support' CONFIG_PPP n
  289. +bool 'PPP (point-to-point) support' CONFIG_PPP y
  290.  bool 'PLIP (parallel port) support' CONFIG_PLIP n
  291.  bool 'Load balancing support (experimental)' CONFIG_SLAVE_BALANCING n
  292. -bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA n
  293. -bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC n
  294. +bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA y
  295. +bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC y
  296.  if [ "$CONFIG_NET_VENDOR_SMC" = "y" ]; then
  297. -    bool 'WD80*3 support' CONFIG_WD80x3 n
  298. -    bool 'SMC Ultra support' CONFIG_ULTRA n
  299. +    bool 'WD80*3 support' CONFIG_WD80x3 y
  300. +    bool 'SMC Ultra support' CONFIG_ULTRA y
  301.  fi
  302.  bool '3COM cards' CONFIG_NET_VENDOR_3COM y
  303.  if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
  304. -    bool '3c501 support' CONFIG_EL1 n
  305. -    bool '3c503 support' CONFIG_EL2 n
  306. +    bool '3c501 support' CONFIG_EL1 y
  307. +    bool '3c503 support' CONFIG_EL2 y
  308.      if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  309. -        bool '3c505 support' CONFIG_ELPLUS n
  310. -        bool '3c507 support' CONFIG_EL16 n
  311. +        bool '3c505 support' CONFIG_ELPLUS y
  312. +        bool '3c507 support' CONFIG_EL16 y
  313.      fi
  314.      bool '3c509/3c579 support' CONFIG_EL3 y
  315.  fi
  316. -bool 'Other ISA cards' CONFIG_NET_ISA n
  317. +bool 'Other ISA cards' CONFIG_NET_ISA y
  318.  if [ "$CONFIG_NET_ISA" = "y" ]; then
  319. -    bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE n
  320. -    bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 n
  321. -    bool 'DEPCA support' CONFIG_DEPCA n
  322. +    bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE y
  323. +    bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 y
  324. +    bool 'DEPCA support' CONFIG_DEPCA y
  325.      if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  326. -        bool 'EtherExpress support' CONFIG_EEXPRESS n
  327. -        bool 'AT1700 support' CONFIG_AT1700 n
  328. +        bool 'EtherExpress support' CONFIG_EEXPRESS y
  329. +        bool 'AT1700 support' CONFIG_AT1700 y
  330. +        bool 'NI5210 support' CONFIG_NI52 y
  331. +        bool 'NI6510 support' CONFIG_NI65 y
  332.      fi
  333. -    bool 'HP PCLAN support' CONFIG_HPLAN n
  334. +    bool 'HP PCLAN support' CONFIG_HPLAN y
  335.      bool 'NE2000/NE1000 support' CONFIG_NE2000 y
  336. -    bool 'SK_G16 support' CONFIG_SK_G16 n
  337. +    bool 'SK_G16 support' CONFIG_SK_G16 y
  338.  fi
  339. -bool 'EISA and on board controllers' CONFIG_NET_EISA n
  340. +bool 'EISA and on board controllers' CONFIG_NET_EISA y
  341.      if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  342. -        bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
  343. +        bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 y
  344.      fi
  345. -    bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
  346. -#bool 'NI52EE support' CONFIG_NI52 n
  347. -#bool 'NI65EE support' CONFIG_NI65 n
  348. -bool 'Pocket and portable adaptors' CONFIG_NET_POCKET n
  349. +    bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT y
  350. +bool 'Pocket and portable adaptors' CONFIG_NET_POCKET y
  351.  if [ "$CONFIG_NET_POCKET" = "y" ]; then
  352. -    bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
  353. -    bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 n
  354. -    bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
  355. -    bool 'Zenith Z-Note support' CONFIG_ZNET n
  356. +    bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 y
  357. +    bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 y
  358. +    bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP y
  359. +    bool 'Zenith Z-Note support' CONFIG_ZNET y
  360.  fi
  361.  fi
  362.  fi
  363. @@ -149,30 +151,30 @@
  364.  bool 'Standard (minix) fs support' CONFIG_MINIX_FS y
  365.  bool 'Extended fs support' CONFIG_EXT_FS n
  366.  bool 'Second extended fs support' CONFIG_EXT2_FS y
  367. -bool 'xiafs filesystem support' CONFIG_XIA_FS n
  368. +bool 'xiafs filesystem support' CONFIG_XIA_FS y
  369.  bool 'msdos fs support' CONFIG_MSDOS_FS y
  370.  if [ "$CONFIG_MSDOS_FS" = "y" ]; then
  371. -bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n
  372. +bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS y
  373.  fi
  374.  bool '/proc filesystem support' CONFIG_PROC_FS y
  375.  if [ "$CONFIG_INET" = "y" ]; then
  376.  bool 'NFS filesystem support' CONFIG_NFS_FS y
  377.  fi
  378. -bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n
  379. -bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS n
  380. +bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
  381. +bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS y
  382.  bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
  383.  
  384.  comment 'character devices'
  385.  
  386. -bool 'Parallel printer support' CONFIG_PRINTER n
  387. +bool 'Parallel printer support' CONFIG_PRINTER y
  388.  bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
  389. -bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE n
  390. +bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE y
  391.  if [ "$CONFIG_PSMOUSE" = "y" ]; then
  392.  bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE y
  393.  fi
  394.  bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
  395.  bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
  396. -bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n
  397. +bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION y
  398.  
  399.  bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
  400.  if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
  401. @@ -189,7 +191,7 @@
  402.  fi
  403.  fi
  404.  
  405. -bool 'QIC-117 tape support' CONFIG_FTAPE n
  406. +bool 'QIC-117 tape support' CONFIG_FTAPE y
  407.  if [ "$CONFIG_FTAPE" = "y" ]; then
  408.  int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
  409.  fi
  410. @@ -203,5 +205,5 @@
  411.  #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
  412.  bool 'Kernel profiling support' CONFIG_PROFILE n
  413.  if [ "$CONFIG_SCSI" = "y" ]; then
  414. -bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  415. +bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS n
  416.  fi
  417. diff -u --recursive --new-file linux-1.1.55/config.old linux/config.old
  418. --- linux-1.1.55/config.old    Wed Dec 31 18:00:00 1969
  419. +++ linux/config.old    Thu Oct 20 17:09:06 1994
  420. @@ -0,0 +1,209 @@
  421. +#
  422. +# For a description of the syntax of this configuration file,
  423. +# see the Configure script.
  424. +#
  425. +
  426. +comment 'General setup'
  427. +
  428. +bool 'Kernel math emulation' CONFIG_MATH_EMULATION y
  429. +bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
  430. +bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
  431. +bool 'Networking support' CONFIG_NET y
  432. +bool 'Filesystem quota support' CONFIG_QUOTA n
  433. +bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
  434. +bool 'System V IPC' CONFIG_SYSVIPC y
  435. +bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
  436. +bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
  437. +
  438. +if [ "$CONFIG_NET" = "y" ]; then
  439. +comment 'Networking options'
  440. +bool 'TCP/IP networking' CONFIG_INET y
  441. +if [ "$CONFIG_INET" "=" "y" ]; then
  442. +bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n
  443. +comment '(it is safe to leave these untouched)'
  444. +bool 'PC/TCP compatibility mode' CONFIG_INET_PCTCP n
  445. +bool 'Reverse ARP' CONFIG_INET_RARP n
  446. +bool 'Assume subnets are local' CONFIG_INET_SNARL y
  447. +bool 'Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n
  448. +fi
  449. +bool 'The IPX protocol' CONFIG_IPX n
  450. +#bool 'Amateur Radio AX.25 Level 2' CONFIG_AX25 n
  451. +fi
  452. +
  453. +comment 'SCSI support'
  454. +
  455. +bool 'SCSI support?' CONFIG_SCSI y
  456. +
  457. +if [ "$CONFIG_SCSI" = "n" ]; then
  458. +
  459. +comment 'Skipping SCSI configuration options...'
  460. +
  461. +else
  462. +
  463. +comment 'SCSI support type (disk, tape, CDrom)'
  464. +
  465. +bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  466. +bool 'Scsi tape support' CONFIG_CHR_DEV_ST y
  467. +bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR y
  468. +bool 'Scsi generic support' CONFIG_CHR_DEV_SG n
  469. +
  470. +comment 'SCSI low-level drivers'
  471. +
  472. +bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X y
  473. +bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 y
  474. +bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 y
  475. +bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC y
  476. +bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN y
  477. +bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 y
  478. +bool 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx y
  479. +#bool 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 n
  480. +bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 y
  481. +bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE y
  482. +bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 y
  483. +bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR y
  484. +bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST y
  485. +#bool 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n
  486. +fi
  487. +
  488. +
  489. +if [ "$CONFIG_NET" = "y" ]; then
  490. +
  491. +comment 'Network device support'
  492. +
  493. +bool 'Network device support?' CONFIG_NETDEVICES y
  494. +if [ "$CONFIG_NETDEVICES" = "n" ]; then
  495. +
  496. +comment 'Skipping network driver configuration options...'
  497. +
  498. +else
  499. +bool 'Dummy net driver support' CONFIG_DUMMY n
  500. +bool 'SLIP (serial line) support' CONFIG_SLIP y
  501. +if [ "$CONFIG_SLIP" = "y" ]; then
  502. +  bool ' CSLIP compressed headers' SL_COMPRESSED y
  503. +#  bool ' SLIP debugging on' SL_DUMP y
  504. +fi
  505. +bool 'PPP (point-to-point) support' CONFIG_PPP y
  506. +bool 'PLIP (parallel port) support' CONFIG_PLIP n
  507. +bool 'Load balancing support (experimental)' CONFIG_SLAVE_BALANCING n
  508. +bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA n
  509. +bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC y
  510. +if [ "$CONFIG_NET_VENDOR_SMC" = "y" ]; then
  511. +    bool 'WD80*3 support' CONFIG_WD80x3 y
  512. +    bool 'SMC Ultra support' CONFIG_ULTRA y
  513. +fi
  514. +bool '3COM cards' CONFIG_NET_VENDOR_3COM y
  515. +if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
  516. +    bool '3c501 support' CONFIG_EL1 y
  517. +    bool '3c503 support' CONFIG_EL2 y
  518. +    if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  519. +        bool '3c505 support' CONFIG_ELPLUS n
  520. +        bool '3c507 support' CONFIG_EL16 n
  521. +    fi
  522. +    bool '3c509/3c579 support' CONFIG_EL3 y
  523. +fi
  524. +bool 'Other ISA cards' CONFIG_NET_ISA y
  525. +if [ "$CONFIG_NET_ISA" = "y" ]; then
  526. +    bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE y
  527. +    bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 y
  528. +    bool 'DEPCA support' CONFIG_DEPCA y
  529. +    if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  530. +        bool 'EtherExpress support' CONFIG_EEXPRESS n
  531. +        bool 'AT1700 support' CONFIG_AT1700 n
  532. +        bool 'NI5210 support' CONFIG_NI52 n
  533. +        bool 'NI6510 support' CONFIG_NI65 n
  534. +    fi
  535. +    bool 'HP PCLAN support' CONFIG_HPLAN y
  536. +    bool 'NE2000/NE1000 support' CONFIG_NE2000 y
  537. +    bool 'SK_G16 support' CONFIG_SK_G16 y
  538. +fi
  539. +bool 'EISA and on board controllers' CONFIG_NET_EISA y
  540. +    if [ "$CONFIG_NET_ALPHA" = "y" ]; then
  541. +        bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
  542. +    fi
  543. +    bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT y
  544. +bool 'Pocket and portable adaptors' CONFIG_NET_POCKET y
  545. +if [ "$CONFIG_NET_POCKET" = "y" ]; then
  546. +    bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 y
  547. +    bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 y
  548. +    bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP y
  549. +    bool 'Zenith Z-Note support' CONFIG_ZNET y
  550. +fi
  551. +fi
  552. +fi
  553. +
  554. +comment 'CD-ROM drivers'
  555. +
  556. +bool 'Sony CDU31A/CDU33A CDROM driver support' CONFIG_CDU31A n
  557. +bool 'Mitsumi CDROM driver support' CONFIG_MCD n
  558. +bool 'Matsushita/Panasonic CDROM driver support' CONFIG_SBPCD n
  559. +if [ "$CONFIG_SBPCD" = "y" ]; then
  560. +  bool 'Matsushita/Panasonic second CDROM controller support' CONFIG_SBPCD2 n
  561. +  if [ "$CONFIG_SBPCD2" = "y" ]; then
  562. +    bool 'Matsushita/Panasonic third CDROM controller support' CONFIG_SBPCD3 n
  563. +    if [ "$CONFIG_SBPCD3" = "y" ]; then
  564. +      bool 'Matsushita/Panasonic fourth CDROM controller support' CONFIG_SBPCD4 n
  565. +    fi
  566. +  fi
  567. +fi
  568. +
  569. +comment 'Filesystems'
  570. +
  571. +bool 'Standard (minix) fs support' CONFIG_MINIX_FS y
  572. +bool 'Extended fs support' CONFIG_EXT_FS n
  573. +bool 'Second extended fs support' CONFIG_EXT2_FS y
  574. +bool 'xiafs filesystem support' CONFIG_XIA_FS y
  575. +bool 'msdos fs support' CONFIG_MSDOS_FS y
  576. +if [ "$CONFIG_MSDOS_FS" = "y" ]; then
  577. +bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS y
  578. +fi
  579. +bool '/proc filesystem support' CONFIG_PROC_FS y
  580. +if [ "$CONFIG_INET" = "y" ]; then
  581. +bool 'NFS filesystem support' CONFIG_NFS_FS y
  582. +fi
  583. +bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
  584. +bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS y
  585. +bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
  586. +
  587. +comment 'character devices'
  588. +
  589. +bool 'Parallel printer support' CONFIG_PRINTER y
  590. +bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
  591. +bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE y
  592. +if [ "$CONFIG_PSMOUSE" = "y" ]; then
  593. +bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE y
  594. +fi
  595. +bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
  596. +bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
  597. +bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION y
  598. +
  599. +bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
  600. +if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
  601. +bool 'Do you want runtime configuration for QIC-02' CONFIG_QIC02_DYNCONF y
  602. +if [ "$CONFIG_QIC02_DYNCONF" != "y" ]; then
  603. +
  604. +comment '>>> Edit configuration parameters in ./include/linux/tpqic02.h!'
  605. +
  606. +else
  607. +
  608. +comment '>>> Setting runtime QIC-02 configuration is done with qic02conf'
  609. +comment '>>> Which is available from ftp://ftp.funet.fi/pub/OS/Linux/BETA/QIC-02/'
  610. +
  611. +fi
  612. +fi
  613. +
  614. +bool 'QIC-117 tape support' CONFIG_FTAPE y
  615. +if [ "$CONFIG_FTAPE" = "y" ]; then
  616. +int ' number of ftape buffers' NR_FTAPE_BUFFERS 3
  617. +fi
  618. +
  619. +comment 'Sound'
  620. +
  621. +bool 'Sound card support' CONFIG_SOUND n
  622. +
  623. +comment 'Kernel hacking'
  624. +
  625. +#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
  626. +bool 'Kernel profiling support' CONFIG_PROFILE n
  627. +if [ "$CONFIG_SCSI" = "y" ]; then
  628. +bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS n
  629. +fi
  630. diff -u --recursive --new-file linux-1.1.55/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
  631. --- linux-1.1.55/drivers/block/ll_rw_blk.c    Sat Sep 17 21:50:28 1994
  632. +++ linux/drivers/block/ll_rw_blk.c    Thu Oct 20 17:01:16 1994
  633. @@ -149,6 +149,23 @@
  634.  static void add_request(struct blk_dev_struct * dev, struct request * req)
  635.  {
  636.      struct request * tmp;
  637. +    short disk_index;
  638. +
  639. +    switch (MAJOR(req->dev)) {
  640. +        case SCSI_DISK_MAJOR:
  641. +            disk_index = (MINOR(req->dev) & 0x0070) >> 4;
  642. +            if (disk_index < 4)
  643. +                kstat.dk_drive[disk_index]++;
  644. +            break;
  645. +        case HD_MAJOR:
  646. +        case XT_DISK_MAJOR:
  647. +            disk_index = (MINOR(req->dev) & 0x00C0) >> 6;
  648. +            if (disk_index < 4)
  649. +                kstat.dk_drive[disk_index]++;
  650. +            break;
  651. +        default:
  652. +            break;
  653. +    }
  654.  
  655.      req->next = NULL;
  656.      cli();
  657. diff -u --recursive --new-file linux-1.1.55/fs/Makefile linux/fs/Makefile
  658. --- linux-1.1.55/fs/Makefile    Thu Oct 20 15:14:26 1994
  659. +++ linux/fs/Makefile    Thu Oct 20 17:01:16 1994
  660. @@ -56,9 +56,9 @@
  661.  .s.o:
  662.      $(AS) -o $*.o $<
  663.  
  664. -OBJS=    open.o read_write.o inode.o devices.o file_table.o buffer.o super.o \
  665. -    block_dev.o stat.o exec.o pipe.o namei.o fcntl.o ioctl.o \
  666. -    select.o fifo.o locks.o filesystems.o dcache.o $(BINFMTS)
  667. +OBJS=    open.o read_write.o inode.o devices.o file_table.o fileio.o buffer.o \
  668. +    super.o block_dev.o stat.o exec.o pipe.o namei.o fcntl.o ioctl.o \
  669. +    select.o fifo.o locks.o dcache.o dquot.o filesystems.o $(BINFMTS)
  670.  
  671.  all: fs.o filesystems.a modules
  672.  
  673. diff -u --recursive --new-file linux-1.1.55/fs/binfmt_elf.c linux/fs/binfmt_elf.c
  674. --- linux-1.1.55/fs/binfmt_elf.c    Thu Oct 20 15:14:27 1994
  675. +++ linux/fs/binfmt_elf.c    Thu Oct 20 17:01:16 1994
  676. @@ -497,6 +497,8 @@
  677.      current->mm->end_code = 0;
  678.      current->mm->start_mmap = ELF_START_MMAP;
  679.      current->mm->mmap = NULL;
  680. +    current->flags &= ~PF_FORKNOEXEC; /* accounting flags */
  681. +        current->io_usage = 0;
  682.      elf_entry = (unsigned int) elf_ex.e_entry;
  683.      
  684.      /* Do this so that we can load the interpreter, if need be.  We will
  685. diff -u --recursive --new-file linux-1.1.55/fs/buffer.c linux/fs/buffer.c
  686. --- linux-1.1.55/fs/buffer.c    Thu Oct 13 21:31:07 1994
  687. +++ linux/fs/buffer.c    Thu Oct 20 17:01:16 1994
  688. @@ -217,6 +217,9 @@
  689.      sync_supers(dev);
  690.      sync_inodes(dev);
  691.      sync_buffers(dev, 0);
  692. +#ifdef CONFIG_QUOTA
  693. +    sync_dquots(dev, -1);
  694. +#endif
  695.  }
  696.  
  697.  int fsync_dev(dev_t dev)
  698. @@ -224,6 +227,9 @@
  699.      sync_buffers(dev, 0);
  700.      sync_supers(dev);
  701.      sync_inodes(dev);
  702. +#ifdef CONFIG_QUOTA
  703. +    sync_dquots(dev, -1);
  704. +#endif
  705.      return sync_buffers(dev, 1);
  706.  }
  707.  
  708. diff -u --recursive --new-file linux-1.1.55/fs/dquot.c linux/fs/dquot.c
  709. --- linux-1.1.55/fs/dquot.c    Wed Dec 31 18:00:00 1969
  710. +++ linux/fs/dquot.c    Thu Oct 20 17:01:17 1994
  711. @@ -0,0 +1,1008 @@
  712. +/*
  713. + * QUOTA    An implementation of the diskquota system for the LINUX operating
  714. + *          system. QUOTA is implemented using the BSD systemcall interface as
  715. + *          the means of communication with the user level. Should work for all
  716. + *          filesystems because of integration into the VFS layer of the
  717. + *          operating system. This is based on the Melbourne quota system wich
  718. + *          uses both user and group quota files.
  719. + * 
  720. + *          Main layer of quota management
  721. + * 
  722. + * Version: $Id: dquot.c,v 3.11 1994/10/17 09:52:47 mvw Exp mvw $
  723. + * 
  724. + * Authors: Marco van Wieringen <v892273@si.hhs.nl> <mvw@mcs.ow.org>
  725. + *          Edvard Tuinder <v892231@si.hhs.nl> <ed@delirium.ow.org>
  726. + *          Linus Torvalds <Linus.Torvalds@cc.helsinki.FI>
  727. + * 
  728. + *          This program is free software; you can redistribute it and/or
  729. + *          modify it under the terms of the GNU General Public License as
  730. + *          published by the Free Software Foundation; either version 2 of the
  731. + *          License, or (at your option) any later version.
  732. + */
  733. +
  734. +#include <linux/errno.h>
  735. +#include <linux/kernel.h>
  736. +#include <linux/sched.h>
  737. +#include <linux/config.h>
  738. +
  739. +#ifdef CONFIG_QUOTA
  740. +#include <linux/types.h>
  741. +#include <linux/string.h>
  742. +#include <linux/fcntl.h>
  743. +#include <linux/stat.h>
  744. +#include <linux/segment.h>
  745. +#include <linux/tty.h>
  746. +#include <linux/malloc.h>
  747. +#include <linux/mount.h>
  748. +#include <linux/fileio.h>
  749. +#include <linux/delay.h>
  750. +
  751. +#include <asm/segment.h>
  752. +#include <sys/sysmacros.h>
  753. +
  754. +static char quotamessage[MAX_QUOTA_MESSAGE];
  755. +static char *quotatypes[] = INITQFNAMES;
  756. +
  757. +static int nr_dquots = 0, nr_free_dquots = 0;
  758. +static struct dquot *hash_table[NR_DQHASH];
  759. +static struct dquot *first_dquot;
  760. +
  761. +static struct wait_queue *dquot_wait = (struct wait_queue *)NULL;
  762. +
  763. +extern void add_dquot_ref(dev_t dev, short type);
  764. +extern void reset_dquot_ptrs(dev_t dev, short type);
  765. +extern void close_fp(struct file *filp, int fd);
  766. +
  767. +#ifndef min
  768. +#define min(a,b) ((a) < (b)) ? (a) : (b)
  769. +#endif
  770. +
  771. +/*
  772. + * Functions for management of the hashlist.
  773. + */
  774. +static inline int const hashfn(dev_t dev, unsigned int id, short type)
  775. +{
  776. +   return ((dev ^ id) * (MAXQUOTAS - type)) % NR_DQHASH;
  777. +}
  778. +
  779. +static inline struct dquot **const hash(dev_t dev, unsigned int id, short type)
  780. +{
  781. +   return hash_table + hashfn(dev, id, type);
  782. +}
  783. +
  784. +static void insert_dquot_free(struct dquot *dquot)
  785. +{
  786. +   dquot->dq_next = first_dquot;
  787. +   dquot->dq_prev = first_dquot->dq_prev;
  788. +   dquot->dq_next->dq_prev = dquot;
  789. +   dquot->dq_prev->dq_next = dquot;
  790. +   first_dquot = dquot;
  791. +}
  792. +
  793. +static void remove_dquot_free(struct dquot *dquot)
  794. +{
  795. +   if (first_dquot == dquot)
  796. +      first_dquot = first_dquot->dq_next;
  797. +   if (dquot->dq_next)
  798. +      dquot->dq_next->dq_prev = dquot->dq_prev;
  799. +   if (dquot->dq_prev)
  800. +      dquot->dq_prev->dq_next = dquot->dq_next;
  801. +   dquot->dq_next = dquot->dq_prev = NODQUOT;
  802. +}
  803. +
  804. +static void insert_dquot_hash(struct dquot *dquot)
  805. +{
  806. +   struct dquot **h;
  807. +
  808. +   h = hash(dquot->dq_dev, dquot->dq_id, dquot->dq_type);
  809. +   dquot->dq_hash_next = *h;
  810. +   dquot->dq_hash_prev = NODQUOT;
  811. +   if (dquot->dq_hash_next)
  812. +      dquot->dq_hash_next->dq_hash_prev = dquot;
  813. +   *h = dquot;
  814. +}
  815. +
  816. +static void remove_dquot_hash(struct dquot *dquot)
  817. +{
  818. +   struct dquot **h;
  819. +
  820. +   h = hash(dquot->dq_dev, dquot->dq_id, dquot->dq_type);
  821. +   if (*h == dquot)
  822. +      *h = dquot->dq_hash_next;
  823. +   if (dquot->dq_hash_next)
  824. +      dquot->dq_hash_next->dq_hash_prev = dquot->dq_hash_prev;
  825. +   if (dquot->dq_hash_prev)
  826. +      dquot->dq_hash_prev->dq_hash_next = dquot->dq_hash_next;
  827. +   dquot->dq_hash_prev = dquot->dq_hash_next = NODQUOT;
  828. +}
  829. +
  830. +static void put_last_free(struct dquot *dquot)
  831. +{
  832. +   remove_dquot_free(dquot);
  833. +   dquot->dq_prev = first_dquot->dq_prev;
  834. +   dquot->dq_prev->dq_next = dquot;
  835. +   dquot->dq_next = first_dquot;
  836. +   dquot->dq_next->dq_prev = dquot;
  837. +}
  838. +
  839. +static void grow_dquots(void)
  840. +{
  841. +   struct dquot *dquot;
  842. +   int i;
  843. +
  844. +   if (!(dquot = (struct dquot*) get_free_page(GFP_KERNEL)))
  845. +      return;
  846. +   i = PAGE_SIZE / sizeof(struct dquot);
  847. +   nr_dquots += i;
  848. +   nr_free_dquots += i;
  849. +   if (!first_dquot)
  850. +      dquot->dq_next = dquot->dq_prev = first_dquot = dquot++, i--;
  851. +   for ( ; i ; i-- )
  852. +      insert_dquot_free(dquot++);
  853. +}
  854. +
  855. +/*
  856. + * Functions for locking and waiting on dquots.
  857. + */
  858. +static void __wait_on_dquot(struct dquot *dquot)
  859. +{
  860. +   struct wait_queue wait = {current, NULL};
  861. +
  862. +   add_wait_queue(&dquot->dq_wait, &wait);
  863. +repeat:
  864. +   current->state = TASK_UNINTERRUPTIBLE;
  865. +   if (dquot->dq_flags & DQ_LOCKED) {
  866. +      dquot->dq_flags |= DQ_WANT;
  867. +      schedule();
  868. +      goto repeat;
  869. +   }
  870. +   remove_wait_queue(&dquot->dq_wait, &wait);
  871. +   current->state = TASK_RUNNING;
  872. +}
  873. +
  874. +static inline void wait_on_dquot(struct dquot *dquot)
  875. +{
  876. +   if (dquot->dq_flags & DQ_LOCKED)
  877. +      __wait_on_dquot(dquot);
  878. +}
  879. +
  880. +static inline void lock_dquot(struct dquot *dquot)
  881. +{
  882. +   wait_on_dquot(dquot);
  883. +   dquot->dq_flags |= DQ_LOCKED;
  884. +}
  885. +
  886. +static inline void unlock_dquot(struct dquot *dquot)
  887. +{
  888. +   dquot->dq_flags &= ~DQ_LOCKED;
  889. +   if (dquot->dq_flags & DQ_WANT) {
  890. +      dquot->dq_flags &= ~DQ_WANT;
  891. +      wake_up(&dquot->dq_wait);
  892. +   }
  893. +}
  894. +/*
  895. + * Note that we don't want to disturb any wait-queues when we discard
  896. + * an dquot.
  897. + *
  898. + * FIXME: As soon as we have a nice solution for the inode problem we
  899. + *        can also fix this one. I.e. the volatile part.
  900. + */
  901. +static void clear_dquot(struct dquot * dquot)
  902. +{
  903. +   struct wait_queue *wait;
  904. +
  905. +   wait_on_dquot(dquot);
  906. +   remove_dquot_hash(dquot);
  907. +   remove_dquot_free(dquot);
  908. +   wait = ((volatile struct dquot *) dquot)->dq_wait;
  909. +   if (dquot->dq_count)
  910. +      nr_free_dquots++;
  911. +   memset(dquot, 0, sizeof(*dquot));
  912. +   ((volatile struct dquot *) dquot)->dq_wait = wait;
  913. +   insert_dquot_free(dquot);
  914. +}
  915. +
  916. +static void write_dquot(struct dquot *dquot)
  917. +{
  918. +   short type = dquot->dq_type;
  919. +   struct file *filp = dquot->dq_mnt->mnt_quotas[type];
  920. +   unsigned short fs;
  921. +
  922. +   if (!(dquot->dq_flags & DQ_MOD) || (filp == (struct file *)0))
  923. +      return;
  924. +   lock_dquot(dquot);
  925. +   down(&dquot->dq_mnt->mnt_sem);
  926. +   if (filp->f_op->lseek) {
  927. +      if (filp->f_op->lseek(filp->f_inode, filp,
  928. +          dqoff(dquot->dq_id), 0) != dqoff(dquot->dq_id)) {
  929. +         up(&dquot->dq_mnt->mnt_sem);
  930. +         return;
  931. +      }
  932. +   } else
  933. +      filp->f_pos = dqoff(dquot->dq_id);
  934. +   fs = get_fs();
  935. +   set_fs(KERNEL_DS);
  936. +   if (filp->f_op->write(filp->f_inode, filp,
  937. +       (char *)&dquot->dq_dqb, sizeof(struct dqblk)) == sizeof(struct dqblk))
  938. +      dquot->dq_flags &= ~DQ_MOD;
  939. +   up(&dquot->dq_mnt->mnt_sem);
  940. +   set_fs(fs);
  941. +   unlock_dquot(dquot);
  942. +}
  943. +
  944. +static void read_dquot(struct dquot *dquot)
  945. +{
  946. +   short type = dquot->dq_type;
  947. +   struct file *filp = dquot->dq_mnt->mnt_quotas[type];
  948. +   unsigned short fs;
  949. +
  950. +   if (filp == (struct file *)0)
  951. +      return;
  952. +   lock_dquot(dquot);
  953. +   down(&dquot->dq_mnt->mnt_sem);
  954. +   if (filp->f_op->lseek) {
  955. +      if (filp->f_op->lseek(filp->f_inode, filp,
  956. +          dqoff(dquot->dq_id),0) != dqoff(dquot->dq_id)) {
  957. +         up(&dquot->dq_mnt->mnt_sem);
  958. +         return;
  959. +      }
  960. +   } else
  961. +      filp->f_pos = dqoff(dquot->dq_id);
  962. +   fs = get_fs();
  963. +   set_fs(KERNEL_DS);
  964. +   filp->f_op->read(filp->f_inode, filp,
  965. +                    (char *)&dquot->dq_dqb, sizeof(struct dqblk));
  966. +   up(&dquot->dq_mnt->mnt_sem);
  967. +   set_fs(fs);
  968. +   if (dquot->dq_bhardlimit == 0 && dquot->dq_bsoftlimit == 0 &&
  969. +       dquot->dq_ihardlimit == 0 && dquot->dq_isoftlimit == 0)
  970. +      dquot->dq_flags |= DQ_FAKE;
  971. +   unlock_dquot(dquot);
  972. +}
  973. +
  974. +int sync_dquots(dev_t dev, short type)
  975. +{
  976. +   struct dquot *dquot = first_dquot;
  977. +   int i;
  978. +
  979. +   for(i = 0; i < nr_dquots * 2; i++, dquot = dquot->dq_next) {
  980. +      if (!dquot->dq_count || (dev && dquot->dq_dev != dev))
  981. +         continue;
  982. +      if (type != -1 && dquot->dq_type != type)
  983. +         continue;
  984. +      wait_on_dquot(dquot);
  985. +      if (dquot->dq_flags & DQ_MOD)
  986. +         write_dquot(dquot);
  987. +   }
  988. +   return 0;
  989. +   /* NOTREACHED */
  990. +}
  991. +
  992. +/*
  993. + * Trash the cache for a certain type on a device.
  994. + */
  995. +void invalidate_dquots(dev_t dev, short type)
  996. +{
  997. +   struct dquot *dquot, *next;
  998. +   int i;
  999. +
  1000. +   next = first_dquot;
  1001. +   for(i = nr_dquots ; i > 0 ; i--) {
  1002. +      dquot = next;
  1003. +      next = dquot->dq_next;
  1004. +      if (dquot->dq_dev != dev || dquot->dq_type != type)
  1005. +         continue;
  1006. +      if (dquot->dq_flags & DQ_LOCKED) {
  1007. +         printk("VFS: dquot busy on removed device %d/%d\n", MAJOR(dev), MINOR(dev));
  1008. +         continue;
  1009. +      }
  1010. +      if (dquot->dq_flags & DQ_MOD)
  1011. +         write_dquot(dquot);
  1012. +      clear_dquot(dquot);
  1013. +   }
  1014. +}
  1015. +
  1016. +/*
  1017. + * Check quota for inodes. Returns QUOTA_OK if can allocate and
  1018. + * NO_QUOTA if it can't.
  1019. + */
  1020. +static int check_idq(struct dquot *dquot, int id, short type, u_long wanted_inodes)
  1021. +{
  1022. +   if (wanted_inodes == 0 || dquot->dq_flags & DQ_FAKE)
  1023. +      return QUOTA_OK;
  1024. +   if (dquot->dq_ihardlimit &&
  1025. +      (dquot->dq_curinodes + wanted_inodes) >= dquot->dq_ihardlimit) {
  1026. +      if (!(dquot->dq_flags & DQ_INODES)) {
  1027. +         sprintf(quotamessage,
  1028. +                "File LIMIT reached on %s for %s %d. !! NO MORE !!\n\r",
  1029. +                dquot->dq_mnt->mnt_devname, quotatypes[type], id);
  1030. +         tty_write_message(current->tty, quotamessage);
  1031. +         dquot->dq_flags |= DQ_INODES;
  1032. +      }
  1033. +      return NO_QUOTA;
  1034. +   }
  1035. +   if (dquot->dq_isoftlimit &&
  1036. +      (dquot->dq_curinodes + wanted_inodes) >= dquot->dq_isoftlimit &&
  1037. +       dquot->dq_itime && CURRENT_TIME >= dquot->dq_itime) {
  1038. +      sprintf(quotamessage,
  1039. +              "File QUOTA exceeded TOO long on %s for %s %d. !! NO MORE !!\n\r",
  1040. +              dquot->dq_mnt->mnt_devname, quotatypes[type], id);
  1041. +      tty_write_message(current->tty, quotamessage);
  1042. +      return NO_QUOTA;
  1043. +   }
  1044. +   if (dquot->dq_isoftlimit &&
  1045. +      (dquot->dq_curinodes + wanted_inodes) >= dquot->dq_isoftlimit &&
  1046. +       dquot->dq_itime == 0) {
  1047. +      sprintf(quotamessage,
  1048. +              "File QUOTA exceeded on %s for %s %d\n\r",
  1049. +              dquot->dq_mnt->mnt_devname, quotatypes[type], id);
  1050. +      tty_write_message(current->tty, quotamessage);
  1051. +      dquot->dq_itime = CURRENT_TIME + dquot->dq_mnt->mnt_iexp[type];
  1052. +   }
  1053. +   return QUOTA_OK;
  1054. +   /* NOTREACHED */
  1055. +}
  1056. +
  1057. +/*
  1058. + * Check quota for blocks. Returns QUOTA_OK if can allocate and
  1059. + * NO_QUOTA if it can't. When we can't allocate wanted_blocks you get
  1060. + * the number we can allocate in avail_blocks.
  1061. + */
  1062. +static int check_bdq(struct dquot *dquot, int id, short type,
  1063. +                     u_long wanted_blocks, u_long *avail_blocks)
  1064. +{
  1065. +   *avail_blocks = wanted_blocks;
  1066. +   if (wanted_blocks == 0 || dquot->dq_flags & DQ_FAKE)
  1067. +      return QUOTA_OK;
  1068. +   if (dquot->dq_bhardlimit &&
  1069. +      (dquot->dq_curblocks + wanted_blocks) >= dquot->dq_bhardlimit) {
  1070. +      if ((dquot->dq_flags & DQ_BLKS) == 0) {
  1071. +         sprintf(quotamessage,
  1072. +                 "Block LIMIT reached on %s for %s %d. !! NO MORE !!\n\r",
  1073. +                 dquot->dq_mnt->mnt_devname, quotatypes[type], id);
  1074. +         tty_write_message(current->tty, quotamessage);
  1075. +         dquot->dq_flags |= DQ_BLKS;
  1076. +      }
  1077. +      if (dquot->dq_curblocks < dquot->dq_bhardlimit) {
  1078. +         *avail_blocks = dquot->dq_bhardlimit - dquot->dq_curblocks;
  1079. +         return QUOTA_OK;
  1080. +      } else
  1081. +         return NO_QUOTA;
  1082. +   }
  1083. +   if (dquot->dq_bsoftlimit &&
  1084. +      (dquot->dq_curblocks + wanted_blocks) >= dquot->dq_bsoftlimit &&
  1085. +       dquot->dq_btime && CURRENT_TIME >= dquot->dq_btime) {
  1086. +      sprintf(quotamessage,
  1087. +              "Block QUOTA exceeded TOO long on %s for %s %d. !! NO MORE !!\n\r",
  1088. +              dquot->dq_mnt->mnt_devname, quotatypes[type], id);
  1089. +      tty_write_message(current->tty, quotamessage);
  1090. +      return NO_QUOTA;
  1091. +   }
  1092. +   if (dquot->dq_bsoftlimit &&
  1093. +      (dquot->dq_curblocks + wanted_blocks) >= dquot->dq_bsoftlimit &&
  1094. +       dquot->dq_btime == 0) {
  1095. +      sprintf(quotamessage,
  1096. +              "Block QUOTA exceeded on %s for %s %d\n\r",
  1097. +              dquot->dq_mnt->mnt_devname, quotatypes[type], id);
  1098. +      tty_write_message(current->tty, quotamessage);
  1099. +      dquot->dq_btime = CURRENT_TIME + dquot->dq_mnt->mnt_bexp[type];
  1100. +   }
  1101. +   return QUOTA_OK;
  1102. +   /* NOTREACHED */
  1103. +}
  1104. +
  1105. +/*
  1106. + * Add a number of inodes and blocks to a diskquota.
  1107. + */
  1108. +static inline void incr_quota(struct dquot *dquot, u_long inodes, u_long blocks)
  1109. +{
  1110. +   lock_dquot(dquot);
  1111. +   dquot->dq_curinodes += inodes;
  1112. +   dquot->dq_curblocks += blocks;
  1113. +   dquot->dq_flags |= DQ_MOD;
  1114. +   unlock_dquot(dquot);
  1115. +}
  1116. +
  1117. +/*
  1118. + * Remove a number of inodes and blocks from a quota.
  1119. + * Reset gracetimes if under softlimit.
  1120. + */
  1121. +static inline void decr_quota(struct dquot *dquot, u_long inodes, u_long blocks)
  1122. +{
  1123. +   lock_dquot(dquot);
  1124. +   if (dquot->dq_curinodes >= inodes)
  1125. +      dquot->dq_curinodes -= inodes;
  1126. +   else
  1127. +      dquot->dq_curinodes = 0;
  1128. +   if (dquot->dq_curinodes < dquot->dq_isoftlimit)
  1129. +      dquot->dq_itime = (time_t) 0;
  1130. +   dquot->dq_flags &= ~DQ_INODES;
  1131. +   if (dquot->dq_curblocks >= blocks)
  1132. +      dquot->dq_curblocks -= blocks;
  1133. +   else
  1134. +      dquot->dq_curblocks = 0;
  1135. +   if (dquot->dq_curblocks < dquot->dq_bsoftlimit)
  1136. +      dquot->dq_btime = (time_t) 0;
  1137. +   dquot->dq_flags &= ~DQ_BLKS;
  1138. +   dquot->dq_flags |= DQ_MOD;
  1139. +   unlock_dquot(dquot);
  1140. +}
  1141. +
  1142. +/*
  1143. + * Initialize a dquot-struct with new quota info. This is used by the
  1144. + * systemcall interface functions.
  1145. + */ 
  1146. +static int set_dqblk(dev_t dev, int id, short type, int flags, struct dqblk *dqblk)
  1147. +{
  1148. +   struct dquot *dquot;
  1149. +   struct dqblk dq_dqblk;
  1150. +   int error;
  1151. +
  1152. +   if (dqblk == (struct dqblk *)0)
  1153. +      return -EFAULT;
  1154. +
  1155. +   if (flags & QUOTA_SYSCALL) {
  1156. +      if ((error = verify_area(VERIFY_READ, dqblk, sizeof(struct dqblk))) != 0)
  1157. +         return error;
  1158. +      memcpy_fromfs(&dq_dqblk, dqblk, sizeof(struct dqblk));
  1159. +   } else {
  1160. +      memcpy(&dq_dqblk, dqblk, sizeof(struct dqblk));
  1161. +   }
  1162. +   if ((dquot = dqget(dev, id, type)) != NODQUOT) {
  1163. +      lock_dquot(dquot);
  1164. +      if (id > 0 && ((flags & SET_QUOTA) || (flags & SET_QLIMIT))) {
  1165. +         dquot->dq_bhardlimit = dq_dqblk.dqb_bhardlimit;
  1166. +         dquot->dq_bsoftlimit = dq_dqblk.dqb_bsoftlimit;
  1167. +         dquot->dq_ihardlimit = dq_dqblk.dqb_ihardlimit;
  1168. +         dquot->dq_isoftlimit = dq_dqblk.dqb_isoftlimit;
  1169. +      }
  1170. +      if ((flags & SET_QUOTA) || (flags & SET_USE)) {
  1171. +         if (dquot->dq_isoftlimit &&
  1172. +             dquot->dq_curinodes < dquot->dq_isoftlimit &&
  1173. +             dq_dqblk.dqb_curinodes >= dquot->dq_isoftlimit)
  1174. +            dquot->dq_itime = CURRENT_TIME + dquot->dq_mnt->mnt_iexp[type];
  1175. +         dquot->dq_curinodes = dq_dqblk.dqb_curinodes;
  1176. +         if (dquot->dq_curinodes < dquot->dq_isoftlimit)
  1177. +            dquot->dq_flags &= ~DQ_INODES;
  1178. +         if (dquot->dq_bsoftlimit &&
  1179. +             dquot->dq_curblocks < dquot->dq_bsoftlimit &&
  1180. +             dq_dqblk.dqb_curblocks >= dquot->dq_bsoftlimit)
  1181. +            dquot->dq_btime = CURRENT_TIME + dquot->dq_mnt->mnt_bexp[type];
  1182. +         dquot->dq_curblocks = dq_dqblk.dqb_curblocks;
  1183. +         if (dquot->dq_curblocks < dquot->dq_bsoftlimit)
  1184. +            dquot->dq_flags &= ~DQ_BLKS;
  1185. +      }
  1186. +      if (id == 0) {
  1187. +         /* 
  1188. +          * Change in expiretimes, change them in dq_mnt.
  1189. +          */
  1190. +         dquot->dq_mnt->mnt_bexp[type] = dquot->dq_btime = dq_dqblk.dqb_btime;
  1191. +         dquot->dq_mnt->mnt_iexp[type] = dquot->dq_itime = dq_dqblk.dqb_itime;
  1192. +      }
  1193. +      if (dq_dqblk.dqb_bhardlimit == 0 && dq_dqblk.dqb_bsoftlimit == 0 &&
  1194. +          dq_dqblk.dqb_ihardlimit == 0 && dq_dqblk.dqb_isoftlimit == 0)
  1195. +         dquot->dq_flags |= DQ_FAKE; /* No limits, only usage */
  1196. +      dquot->dq_flags |= DQ_MOD;
  1197. +      unlock_dquot(dquot);
  1198. +      dqput(dquot);
  1199. +   }
  1200. +   return 0;
  1201. +}
  1202. +
  1203. +static int get_quota(dev_t dev, int id, short type, struct dqblk * dqblk)
  1204. +{
  1205. +   struct vfsmount *vfsmnt;
  1206. +   struct dquot *dquot;
  1207. +   int error;
  1208. +
  1209. +   if ((vfsmnt = lookup_vfsmnt(dev)) != (struct vfsmount *)0 &&
  1210. +        vfsmnt->mnt_quotas[type] != (struct file *)0) {
  1211. +      if (dqblk == (struct dqblk *) 0)
  1212. +         return -EFAULT;
  1213. +
  1214. +      if ((error = verify_area(VERIFY_WRITE, dqblk, sizeof(struct dqblk))) != 0)
  1215. +         return (error);
  1216. +
  1217. +      if ((dquot = dqget(dev, id, type)) != NODQUOT) {
  1218. +         memcpy_tofs(dqblk, (char *)&dquot->dq_dqb, sizeof(struct dqblk));
  1219. +         dqput(dquot);
  1220. +         return 0;
  1221. +      }
  1222. +   }
  1223. +   return -ESRCH;
  1224. +}
  1225. +
  1226. +/*
  1227. + * Turn quota off on a device. type == -1 ==> quotaoff for all types (umount)
  1228. + */
  1229. +int quota_off(dev_t dev, short type)
  1230. +{
  1231. +   struct vfsmount *vfsmnt;
  1232. +   short cnt;
  1233. +
  1234. +   for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1235. +      if (type != -1 && cnt != type)
  1236. +         continue;
  1237. +      if ((vfsmnt = lookup_vfsmnt(dev)) == (struct vfsmount *)0 ||
  1238. +           vfsmnt->mnt_quotas[cnt] == (struct file *)0)
  1239. +         continue;
  1240. +      vfsmnt->mnt_flags |= QF_CLOSING;
  1241. +      reset_dquot_ptrs(dev, cnt);
  1242. +      invalidate_dquots(dev, cnt);
  1243. +      close_fp(vfsmnt->mnt_quotas[cnt], 0);
  1244. +      vfsmnt->mnt_quotas[cnt] = (struct file *)0;
  1245. +      vfsmnt->mnt_iexp[cnt] = vfsmnt->mnt_bexp[cnt] = (time_t)0;
  1246. +      vfsmnt->mnt_flags &= ~QF_CLOSING;
  1247. +   }
  1248. +   return 0;
  1249. +}
  1250. +
  1251. +static int quota_on(dev_t dev, short type, char *path)
  1252. +{
  1253. +   struct file *filp = (struct file *)0;
  1254. +   struct vfsmount *vfsmnt;
  1255. +   struct inode *inode;
  1256. +   struct dquot *dquot;
  1257. +   char *tmp;
  1258. +   int error;
  1259. +
  1260. +   if ((vfsmnt = lookup_vfsmnt(dev)) == (struct vfsmount *)0)
  1261. +      return -ENODEV;
  1262. +   if (vfsmnt->mnt_quotas[type] != (struct file *)0)
  1263. +      return -EBUSY;
  1264. +   if ((error = getname(path, &tmp)) != 0)
  1265. +      return (error);
  1266. +   vfsmnt->mnt_flags |= QF_OPENING;
  1267. +   error = open_namei(tmp, O_RDWR, 0600, &inode, 0);
  1268. +   putname(tmp);
  1269. +   if (error) {
  1270. +      vfsmnt->mnt_flags &= ~QF_OPENING;
  1271. +      return (error);
  1272. +   }
  1273. +   if (!S_ISREG(inode->i_mode)) {
  1274. +      vfsmnt->mnt_flags &= ~QF_OPENING;
  1275. +      iput(inode);
  1276. +      return -EACCES;
  1277. +   }
  1278. +   if (!inode->i_op || !inode->i_op->default_file_ops)
  1279. +      goto end_quotaon;
  1280. +   if ((filp = get_empty_filp()) == (struct file *)0)
  1281. +      goto end_quotaon;
  1282. +   filp->f_mode = (O_RDWR + 1) & O_ACCMODE;
  1283. +   filp->f_flags = O_RDWR;
  1284. +   filp->f_inode = inode;
  1285. +   filp->f_pos = 0;
  1286. +   filp->f_reada = 0;
  1287. +   filp->f_op = inode->i_op->default_file_ops;
  1288. +   if (filp->f_op->open)
  1289. +      if (filp->f_op->open(filp->f_inode, filp))
  1290. +         goto end_quotaon;
  1291. +   if (!filp->f_op->read || !filp->f_op->write)
  1292. +      goto end_quotaon;
  1293. +   vfsmnt->mnt_quotas[type] = filp;
  1294. +   vfs_open(filp);
  1295. +   vfsmnt->mnt_flags &= ~QF_OPENING;
  1296. +   dquot = dqget(dev, 0, type);
  1297. +   vfsmnt->mnt_iexp[type] = (dquot) ? dquot->dq_itime : MAX_IQ_TIME;
  1298. +   vfsmnt->mnt_bexp[type] = (dquot) ? dquot->dq_btime : MAX_DQ_TIME;
  1299. +   dqput(dquot);
  1300. +   add_dquot_ref(dev, type);
  1301. +   return 0;
  1302. +end_quotaon:
  1303. +   vfsmnt->mnt_flags &= ~QF_OPENING;
  1304. +   if (filp != (struct file *)0)
  1305. +      filp->f_count--;
  1306. +   iput(inode);
  1307. +   return -EIO;
  1308. +}
  1309. +
  1310. +/*
  1311. + * Just like iput, decrement referencecount of dquot.
  1312. + */
  1313. +void dqput(struct dquot *dquot)
  1314. +{
  1315. +   if (!dquot)
  1316. +      return;
  1317. +   /*
  1318. +    * If the dq_mnt pointer isn't initialized this entry needs no
  1319. +    * checking and doesn't need to be written. It just an empty
  1320. +    * dquot that is put back into the freelist.
  1321. +    */
  1322. +   if (dquot->dq_mnt != (struct vfsmount *)0) {
  1323. +      wait_on_dquot(dquot);
  1324. +      if (!dquot->dq_count) {
  1325. +         printk("VFS: iput: trying to free free dquot\n");
  1326. +         printk("VFS: device %d/%d, dquot of %s %d\n",
  1327. +                MAJOR(dquot->dq_dev), MINOR(dquot->dq_dev),
  1328. +                quotatypes[dquot->dq_type], dquot->dq_id);
  1329. +         return;
  1330. +      }
  1331. +repeat:
  1332. +      if (dquot->dq_count > 1) {
  1333. +         dquot->dq_count--;
  1334. +         return;
  1335. +      }
  1336. +      wake_up(&dquot_wait);
  1337. +      if (dquot->dq_flags & DQ_MOD) {
  1338. +         write_dquot(dquot);   /* we can sleep - so do again */
  1339. +         wait_on_dquot(dquot);
  1340. +         goto repeat;
  1341. +      }
  1342. +   }
  1343. +   if (dquot->dq_count) {
  1344. +      dquot->dq_count--;
  1345. +      nr_free_dquots++;
  1346. +   }
  1347. +   return;
  1348. +}
  1349. +
  1350. +static struct dquot *get_empty_dquot(void)
  1351. +{
  1352. +   struct dquot *dquot, *best;
  1353. +   int i;
  1354. +
  1355. +   if (nr_dquots < NR_DQUOTS && nr_free_dquots < (nr_dquots >> 2))
  1356. +      grow_dquots();
  1357. +
  1358. +repeat:
  1359. +   dquot = first_dquot;
  1360. +   best = NODQUOT;
  1361. +   for (i = 0; i < nr_dquots; dquot = dquot->dq_next, i++) {
  1362. +      if (!dquot->dq_count) {
  1363. +         if (!best)
  1364. +            best = dquot;
  1365. +         if (!(dquot->dq_flags & DQ_MOD) && !(dquot->dq_flags & DQ_LOCKED)) {
  1366. +            best = dquot;
  1367. +            break;
  1368. +         }
  1369. +      }
  1370. +   }
  1371. +   if (!best || best->dq_flags & DQ_MOD || best->dq_flags & DQ_LOCKED)
  1372. +      if (nr_dquots < NR_DQUOTS) {
  1373. +         grow_dquots();
  1374. +         goto repeat;
  1375. +      }
  1376. +   dquot = best;
  1377. +   if (!dquot) {
  1378. +      printk("VFS: No free dquots - contact mvw@mcs.ow.org\n");
  1379. +      sleep_on(&dquot_wait);
  1380. +      goto repeat;
  1381. +   }
  1382. +   if (dquot->dq_flags & DQ_LOCKED) {
  1383. +      wait_on_dquot(dquot);
  1384. +      goto repeat;
  1385. +   }
  1386. +   if (dquot->dq_flags & DQ_MOD) {
  1387. +      write_dquot(dquot);
  1388. +      goto repeat;
  1389. +   }
  1390. +   if (dquot->dq_count)
  1391. +      goto repeat;
  1392. +   clear_dquot(dquot);
  1393. +   dquot->dq_count = 1;
  1394. +   nr_free_dquots--;
  1395. +   if (nr_free_dquots < 0) {
  1396. +      printk ("VFS: get_empty_dquot: bad free dquot count.\n");
  1397. +      nr_free_dquots = 0;
  1398. +   }
  1399. +   return dquot;
  1400. +}
  1401. +
  1402. +/*
  1403. + * Just like iget, increment referencecount of a dquot and return
  1404. + * pointer to it in the hashqueue.
  1405. + */
  1406. +struct dquot *dqget(dev_t dev, unsigned int id, short type)
  1407. +{
  1408. +   struct dquot *dquot, *empty;
  1409. +   struct vfsmount *vfsmnt;
  1410. +
  1411. +   if ((vfsmnt = lookup_vfsmnt(dev)) == (struct vfsmount *)0 ||
  1412. +       (vfsmnt->mnt_flags & (QF_OPENING | QF_CLOSING)) ||
  1413. +       (vfsmnt->mnt_quotas[type] == (struct file *)0))
  1414. +      return (NODQUOT);
  1415. +   empty = get_empty_dquot();
  1416. +repeat:
  1417. +   dquot = *(hash(dev, id, type));
  1418. +   while (dquot) {
  1419. +      if (dquot->dq_dev != dev || dquot->dq_id != id) {
  1420. +         dquot = dquot->dq_hash_next;
  1421. +         continue;
  1422. +      }
  1423. +      wait_on_dquot(dquot);
  1424. +      if (dquot->dq_dev != dev || dquot->dq_id != id)
  1425. +         goto repeat;
  1426. +      if (!dquot->dq_count)
  1427. +         nr_free_dquots--;
  1428. +      dquot->dq_count++;
  1429. +      if (empty)
  1430. +         dqput(empty);
  1431. +      return dquot;
  1432. +   }
  1433. +   if (!empty)
  1434. +      return (NODQUOT);
  1435. +   dquot = empty;
  1436. +   dquot->dq_id = id;
  1437. +   dquot->dq_type = type;
  1438. +   dquot->dq_dev = dev;
  1439. +   dquot->dq_mnt = vfsmnt;
  1440. +   put_last_free(dquot);
  1441. +   insert_dquot_hash(dquot);
  1442. +   read_dquot(dquot);
  1443. +   return dquot;
  1444. +}
  1445. +
  1446. +/*
  1447. + * Initialize pointer in a inode to the right dquots.
  1448. + * Be smart and increment count only if already valid pointervalue.
  1449. + */
  1450. +void getinoquota(struct inode *inode, short type)
  1451. +{
  1452. +   unsigned int id = 0;
  1453. +   short cnt;
  1454. +
  1455. +   for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1456. +      if (type != -1 && cnt != type)
  1457. +         continue;
  1458. +      if (inode->i_dquot[cnt] != NODQUOT) {
  1459. +         inode->i_dquot[cnt]->dq_count++;
  1460. +         continue;
  1461. +      }
  1462. +      switch (cnt) {
  1463. +         case USRQUOTA:
  1464. +            id = inode->i_uid;
  1465. +            break;
  1466. +         case GRPQUOTA:
  1467. +            id = inode->i_gid;
  1468. +            break;
  1469. +      }
  1470. +      inode->i_dquot[cnt] = dqget(inode->i_dev, id, cnt);
  1471. +   }
  1472. +}
  1473. +
  1474. +void putinoquota(struct inode *inode)
  1475. +{
  1476. +   short cnt;
  1477. +
  1478. +   for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1479. +      if (inode->i_dquot[cnt] == NODQUOT)
  1480. +         continue;
  1481. +      dqput(inode->i_dquot[cnt]);
  1482. +      if (!inode->i_writecount)
  1483. +         inode->i_dquot[cnt] = NODQUOT;
  1484. +   }
  1485. +}
  1486. +
  1487. +/*
  1488. + * This are two simple algorithms that calculates the size of a file in blocks
  1489. + * and from a number of blocks to a isize.
  1490. + * It is not perfect but works most of the time.
  1491. + */
  1492. +u_long isize_to_blocks(size_t isize, size_t blksize)
  1493. +{
  1494. +   u_long blocks;
  1495. +   u_long indirect;
  1496. +
  1497. +   if (!blksize)
  1498. +      blksize = BLOCK_SIZE;
  1499. +   blocks = (isize / blksize) + ((isize % blksize) ? 1 : 0);
  1500. +   if (blocks > 10) {
  1501. +      indirect = ((blocks - 11) >> 8) + 1; /* single indirect blocks */
  1502. +      if (blocks > (10 + 256)) {
  1503. +         indirect += ((blocks - 267) >> 16) + 1; /* double indirect blocks */
  1504. +         if (blocks > (10 + 256 + (256 << 8)))
  1505. +            indirect++; /* triple indirect blocks */
  1506. +      }
  1507. +      blocks += indirect;
  1508. +   }
  1509. +   return blocks;
  1510. +}
  1511. +
  1512. +size_t blocks_to_isize(u_long blocks, size_t blksize)
  1513. +{
  1514. +   size_t isize;
  1515. +   u_long indirect;
  1516. +
  1517. +   if (!blksize)
  1518. +      blksize = BLOCK_SIZE;
  1519. +   isize = blocks * blksize;
  1520. +   if (blocks > 10) {
  1521. +      indirect = ((blocks - 11) >> 8) + 1; /* single indirect blocks */
  1522. +      if (blocks > (10 + 256)) {
  1523. +         indirect += ((blocks - 267) >> 16) + 1; /* double indirect blocks */
  1524. +         if (blocks > (10 + 256 + (256 << 8)))
  1525. +            indirect++; /* triple indirect blocks */
  1526. +      }
  1527. +      isize -= indirect * blksize;
  1528. +   }
  1529. +   return isize;
  1530. +}
  1531. +
  1532. +/*
  1533. + * Allocate the number of inodes and blocks from a diskquota.
  1534. + */
  1535. +int quota_alloc(struct inode *inode, u_long wanted_inodes, u_long wanted_blocks,
  1536. +                u_long *avail_blocks)
  1537. +{
  1538. +   u_long availblocks, local_avail;
  1539. +   unsigned short cnt;
  1540. +
  1541. +   availblocks = wanted_blocks;
  1542. +   if (wanted_inodes > 0 || wanted_blocks > 0) {
  1543. +      for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1544. +         if (inode->i_dquot[cnt] == NODQUOT)
  1545. +            continue;
  1546. +         if (check_idq(inode->i_dquot[cnt], inode->i_dquot[cnt]->dq_id,
  1547. +                       cnt, wanted_inodes) == NO_QUOTA ||
  1548. +             check_bdq(inode->i_dquot[cnt], inode->i_dquot[cnt]->dq_id,
  1549. +                       cnt, wanted_blocks, &local_avail) == NO_QUOTA)
  1550. +            return NO_QUOTA;
  1551. +         availblocks = min(availblocks, local_avail);
  1552. +      }
  1553. +      for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1554. +         if (inode->i_dquot[cnt] == NODQUOT)
  1555. +            continue;
  1556. +         incr_quota(inode->i_dquot[cnt], wanted_inodes, availblocks);
  1557. +      }
  1558. +   }
  1559. +   if (avail_blocks != (u_long *)0)
  1560. +      *avail_blocks = availblocks;
  1561. +   return QUOTA_OK;
  1562. +   /* NOTREACHED */
  1563. +}
  1564. +
  1565. +/*
  1566. + * Remove the number of inodes and blocks from a diskquota.
  1567. + */
  1568. +void quota_remove(struct inode *inode, u_long inodes, u_long blocks)
  1569. +{
  1570. +   short cnt;
  1571. +
  1572. +   if (inodes > 0 || blocks > 0) {
  1573. +      for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1574. +         if (inode->i_dquot[cnt] == NODQUOT)
  1575. +            continue;
  1576. +         decr_quota(inode->i_dquot[cnt], inodes, blocks);
  1577. +      }
  1578. +   }
  1579. +}
  1580. +
  1581. +/*
  1582. + * Transfer the number of inode and blocks from one diskquota to an other.
  1583. + */
  1584. +int quota_transfer(struct inode *inode, uid_t newuid, gid_t newgid,
  1585. +                   u_long inodes, u_long blocks)
  1586. +{
  1587. +   struct dquot *transfer_to[MAXQUOTAS];
  1588. +   u_long availblocks;
  1589. +   unsigned int id = 0;
  1590. +   short cnt, disc;
  1591. +
  1592. +   if (inodes > 0 || blocks > 0) {
  1593. +      for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1594. +         transfer_to[cnt] = NODQUOT;
  1595. +         switch(cnt) {
  1596. +            case USRQUOTA:
  1597. +               if (inode->i_uid == newuid)
  1598. +                  continue;
  1599. +               id = newuid;
  1600. +               break;
  1601. +            case GRPQUOTA:
  1602. +               if (inode->i_gid == newgid)
  1603. +                  continue;
  1604. +               id = newgid;
  1605. +               break;
  1606. +         }
  1607. +         if ((transfer_to[cnt] = dqget(inode->i_dev, id, cnt)) == NODQUOT)
  1608. +            continue;
  1609. +
  1610. +         if (check_idq(transfer_to[cnt], id, cnt, inodes) == NO_QUOTA ||
  1611. +             check_bdq(transfer_to[cnt], id, cnt, blocks, &availblocks) == NO_QUOTA ||
  1612. +             availblocks != blocks) {
  1613. +            for (disc = 0; disc <= cnt; disc++)
  1614. +               dqput(transfer_to[disc]);
  1615. +            return NO_QUOTA;
  1616. +         }
  1617. +      }
  1618. +      for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
  1619. +         if (transfer_to[cnt] == NODQUOT)
  1620. +            continue;
  1621. +         decr_quota(inode->i_dquot[cnt], inodes, blocks);
  1622. +         incr_quota(transfer_to[cnt], inodes, blocks);
  1623. +         transfer_to[cnt]->dq_count += inode->i_writecount;
  1624. +         inode->i_dquot[cnt]->dq_count -= inode->i_writecount;
  1625. +         dqput(inode->i_dquot[cnt]);
  1626. +         inode->i_dquot[cnt] = transfer_to[cnt];
  1627. +      }
  1628. +   }
  1629. +   return QUOTA_OK;
  1630. +   /* NOTREACHED */
  1631. +}
  1632. +
  1633. +void quota_init(void)
  1634. +{
  1635. +   memset(hash_table, 0, sizeof(hash_table));
  1636. +   first_dquot = NODQUOT;
  1637. +}
  1638. +
  1639. +/*
  1640. + * Ok this is the systemcall interface, this communicates with
  1641. + * the userlevel programs.
  1642. + */
  1643. +asmlinkage int sys_quotactl(int cmd, const char *special, int id, caddr_t addr)
  1644. +{
  1645. +   int cmds = 0, type = 0, flags = 0;
  1646. +   struct vfsmount *vfsmnt;
  1647. +   struct inode *ino;
  1648. +   dev_t dev;
  1649. +
  1650. +   cmds = cmd >> SUBCMDSHIFT;
  1651. +   type = cmd & SUBCMDMASK;
  1652. +
  1653. +   if ((u_int) type >= MAXQUOTAS)
  1654. +      return -EINVAL;
  1655. +   switch (cmds) {
  1656. +      case Q_SYNC:
  1657. +         break;
  1658. +      case Q_GETQUOTA:
  1659. +         if (((type == USRQUOTA && current->uid != id) ||
  1660. +              (type == GRPQUOTA && current->gid != id)) && !suser())
  1661. +            return -EPERM;
  1662. +         break;
  1663. +      default:
  1664. +         if (!suser())
  1665. +            return -EPERM;
  1666. +   }
  1667. +
  1668. +   if (special == (char *)0 && cmds == Q_SYNC)
  1669. +      dev = 0;
  1670. +   else {
  1671. +      if (namei(special, &ino))
  1672. +         return -EINVAL;
  1673. +      dev = ino->i_rdev;
  1674. +      if (!S_ISBLK(ino->i_mode)) {
  1675. +         iput(ino);
  1676. +         return -ENOTBLK;
  1677. +      }
  1678. +      iput(ino);
  1679. +   }
  1680. +
  1681. +   switch (cmds) {
  1682. +      case Q_QUOTAON:
  1683. +         return quota_on(dev, type, (char *) addr);
  1684. +      case Q_QUOTAOFF:
  1685. +         return quota_off(dev, type);
  1686. +      case Q_GETQUOTA:
  1687. +         return get_quota(dev, id, type, (struct dqblk *) addr);
  1688. +      case Q_SETQUOTA:
  1689. +         flags |= SET_QUOTA;
  1690. +         break;
  1691. +      case Q_SETUSE:
  1692. +         flags |= SET_USE;
  1693. +         break;
  1694. +      case Q_SETQLIM:
  1695. +         flags |= SET_QLIMIT;
  1696. +         break;
  1697. +      case Q_SYNC:
  1698. +         return sync_dquots(dev, type);
  1699. +      default:
  1700. +         return -EINVAL;
  1701. +   }
  1702. +
  1703. +   flags |= QUOTA_SYSCALL;
  1704. +   if ((vfsmnt = lookup_vfsmnt(dev)) != (struct vfsmount *)0 &&
  1705. +        vfsmnt->mnt_quotas[type] != (struct file *)0)
  1706. +      return set_dqblk(dev, id, type, flags, (struct dqblk *) addr);
  1707. +   return -ESRCH;
  1708. +   /* NOTREACHED */
  1709. +}
  1710. +
  1711. +#else
  1712. +
  1713. +asmlinkage int sys_quotactl(int cmd, const char *special, int id, caddr_t addr)
  1714. +{
  1715. +   return -ENOSYS;
  1716. +}
  1717. +
  1718. +#endif /* CONFIG_QUOTA */
  1719. +
  1720. diff -u --recursive --new-file linux-1.1.55/fs/exec.c linux/fs/exec.c
  1721. --- linux-1.1.55/fs/exec.c    Thu Oct 20 15:14:26 1994
  1722. +++ linux/fs/exec.c    Thu Oct 20 17:01:17 1994
  1723. @@ -43,6 +43,7 @@
  1724.  
  1725.  #include <linux/binfmts.h>
  1726.  #include <linux/personality.h>
  1727. +#include <linux/fileio.h>
  1728.  
  1729.  #include <asm/segment.h>
  1730.  #include <asm/system.h>
  1731. @@ -137,6 +138,7 @@
  1732.              return error;
  1733.          }
  1734.      }
  1735. +    vfs_open(f);
  1736.      inode->i_count++;
  1737.      return fd;
  1738.  }
  1739. @@ -146,7 +148,7 @@
  1740.   * macros to write out all the necessary info.
  1741.   */
  1742.  #define DUMP_WRITE(addr,nr) \
  1743. -while (file.f_op->write(inode,&file,(char *)(addr),(nr)) != (nr)) goto close_coredump
  1744. +while (vfs_write(inode,&file,(char *)(addr),(nr)) != (nr)) goto close_coredump
  1745.  
  1746.  #define DUMP_SEEK(offset) \
  1747.  if (file.f_op->lseek) { \
  1748. @@ -154,6 +156,8 @@
  1749.           goto close_coredump; \
  1750.  } else file.f_pos = (offset)        
  1751.  
  1752. +extern int close_fp(struct file *filp, unsigned int fd);
  1753. +
  1754.  /*
  1755.   * Routine writes a core dump image in the current directory.
  1756.   * Currently only a stub-function.
  1757. @@ -207,9 +211,11 @@
  1758.      if (file.f_op->open)
  1759.          if (file.f_op->open(inode,&file))
  1760.              goto end_coredump;
  1761. +    vfs_open(&file);
  1762.      if (!file.f_op->write)
  1763.          goto close_coredump;
  1764.      has_dumped = 1;
  1765. +    current->flags |= PF_DUMPCORE;
  1766.  /* changed the size calculations - should hopefully work better. lbt */
  1767.      dump.magic = CMAGIC;
  1768.      dump.start_code = 0;
  1769. @@ -271,8 +277,9 @@
  1770.      set_fs(KERNEL_DS);
  1771.      DUMP_WRITE(current,sizeof(*current));
  1772.  close_coredump:
  1773. -    if (file.f_op->release)
  1774. -        file.f_op->release(inode,&file);
  1775. +    close_fp(&file, 0);
  1776. +    set_fs(fs);
  1777. +    return has_dumped;
  1778.  end_coredump:
  1779.      set_fs(fs);
  1780.      iput(inode);
  1781. @@ -824,6 +831,8 @@
  1782.      current->mm->mmap = NULL;
  1783.      current->suid = current->euid = current->fsuid = bprm->e_uid;
  1784.      current->sgid = current->egid = current->fsgid = bprm->e_gid;
  1785. +    current->flags &= ~PF_FORKNOEXEC; /* accounting flags */
  1786. +    current->io_usage = 0;
  1787.      if (N_MAGIC(ex) == OMAGIC) {
  1788.          do_mmap(NULL, 0, ex.a_text+ex.a_data,
  1789.              PROT_READ|PROT_WRITE|PROT_EXEC,
  1790. diff -u --recursive --new-file linux-1.1.55/fs/ext2/super.c linux/fs/ext2/super.c
  1791. --- linux-1.1.55/fs/ext2/super.c    Sat Sep 17 21:49:55 1994
  1792. +++ linux/fs/ext2/super.c    Thu Oct 20 17:01:17 1994
  1793. @@ -260,11 +260,8 @@
  1794.                  return 0;
  1795.              }
  1796.          }
  1797. -        else {
  1798. -            printk ("EXT2-fs: Unrecognized mount option %s\n", this_char);
  1799. -            return 0;
  1800. +        else return 1;
  1801.          }
  1802. -    }
  1803.      return 1;
  1804.  }
  1805.  
  1806. diff -u --recursive --new-file linux-1.1.55/fs/fcntl.c linux/fs/fcntl.c
  1807. --- linux-1.1.55/fs/fcntl.c    Sat Sep 17 21:49:56 1994
  1808. +++ linux/fs/fcntl.c    Thu Oct 20 17:01:17 1994
  1809. @@ -12,6 +12,7 @@
  1810.  #include <linux/stat.h>
  1811.  #include <linux/fcntl.h>
  1812.  #include <linux/string.h>
  1813. +#include <linux/fileio.h>
  1814.  
  1815.  extern int fcntl_getlk(unsigned int, struct flock *);
  1816.  extern int fcntl_setlk(unsigned int, unsigned int, struct flock *);
  1817. @@ -32,6 +33,7 @@
  1818.          return -EMFILE;
  1819.      FD_CLR(arg, ¤t->files->close_on_exec);
  1820.      (current->files->fd[arg] = current->files->fd[fd])->f_count++;
  1821. +       vfs_open(current->files->fd[fd]);
  1822.      return arg;
  1823.  }
  1824.  
  1825. diff -u --recursive --new-file linux-1.1.55/fs/file_table.c linux/fs/file_table.c
  1826. --- linux-1.1.55/fs/file_table.c    Tue Feb  8 04:52:14 1994
  1827. +++ linux/fs/file_table.c    Thu Oct 20 17:01:17 1994
  1828. @@ -7,6 +7,7 @@
  1829.  #include <linux/fs.h>
  1830.  #include <linux/string.h>
  1831.  #include <linux/mm.h>
  1832. +#include <linux/config.h>
  1833.  
  1834.  struct file * first_file;
  1835.  int nr_files = 0;
  1836. @@ -87,3 +88,34 @@
  1837.      }
  1838.      return NULL;
  1839.  }
  1840. +
  1841. +#ifdef CONFIG_QUOTA
  1842. +void add_dquot_ref(dev_t dev, short type)
  1843. +{
  1844. +    struct file *filp;
  1845. +    int i;
  1846. +
  1847. +    /* Check files that are currently opened for writing. */
  1848. +    for (filp = first_file, i = 0; i < nr_files; i++, filp = filp->f_next) {
  1849. +        if (!filp->f_count || !filp->f_inode || filp->f_inode->i_dev != dev)
  1850. +            continue;
  1851. +        if (filp->f_inode->i_writecount > 0) {
  1852. +            getinoquota(filp->f_inode, type);
  1853. +            if (filp->f_inode->i_dquot[type] != NODQUOT)
  1854. +                filp->f_inode->i_dquot[type]->dq_count +=
  1855. +                (filp->f_inode->i_writecount - 1);
  1856. +        }
  1857. +    }
  1858. +}
  1859. +
  1860. +void reset_dquot_ptrs(dev_t dev, short type)
  1861. +{
  1862. +    struct file *filp;
  1863. +    int i;
  1864. +
  1865. +    for (filp = first_file, i = 0; i < nr_files; i++, filp = filp->f_next)
  1866. +        if (filp->f_count && filp->f_inode &&
  1867. +            filp->f_inode->i_writecount && filp->f_inode->i_dev == dev)
  1868. +            filp->f_inode->i_dquot[type] = NODQUOT;
  1869. +}
  1870. +#endif
  1871. diff -u --recursive --new-file linux-1.1.55/fs/fileio.c linux/fs/fileio.c
  1872. --- linux-1.1.55/fs/fileio.c    Wed Dec 31 18:00:00 1969
  1873. +++ linux/fs/fileio.c    Thu Oct 20 17:01:17 1994
  1874. @@ -0,0 +1,379 @@
  1875. +/*
  1876. + *
  1877. + * Simple VFS definitions for fileio.
  1878. + *
  1879. + * Authors: Marco van Wieringen <v892273@si.hhs.nl> <mvw@mcs.ow.org>
  1880. + *          Edvard Tuinder <v892231@si.hhs.nl> <ed@delirium.ow.org>
  1881. + *
  1882. + * Version: $Id: fileio.c,v 1.10 1994/10/17 15:59:26 mvw Exp mvw $
  1883. + *
  1884. + */
  1885. +
  1886. +#include <linux/config.h>
  1887. +#include <linux/kernel.h>
  1888. +#include <linux/sched.h>
  1889. +#include <linux/stat.h>
  1890. +#include <linux/string.h>
  1891. +#include <linux/fcntl.h>
  1892. +
  1893. +#ifdef CONFIG_QUOTA
  1894. +extern int lookup(struct inode *, const char *, int, struct inode **);
  1895. +
  1896. +int vfs_write(struct inode *inode, struct file *filp, char *addr, size_t bytes)
  1897. +{
  1898. +   size_t written;
  1899. +   u_long cur_blocks, wanted_blocks = 0, avail_blocks = 0;
  1900. +
  1901. +   if (S_ISREG(inode->i_mode)) {
  1902. +      cur_blocks = isize_to_blocks(inode->i_size, inode->i_blksize);
  1903. +      if ((filp->f_pos + bytes) > inode->i_size) {
  1904. +         wanted_blocks = isize_to_blocks(filp->f_pos + bytes,
  1905. +                         inode->i_blksize) - cur_blocks;
  1906. +         if (wanted_blocks && quota_alloc(inode, 0, wanted_blocks,
  1907. +                                          &avail_blocks) == NO_QUOTA)
  1908. +            return -EDQUOT;
  1909. +         if (wanted_blocks && (avail_blocks < wanted_blocks))
  1910. +            bytes = blocks_to_isize((cur_blocks + avail_blocks),
  1911. +                    inode->i_blksize) - filp->f_pos;
  1912. +      }
  1913. +      if ((written = filp->f_op->write(inode, filp, addr, bytes)) != bytes) {
  1914. +         quota_remove(inode, 0, avail_blocks -
  1915. +                     (isize_to_blocks(inode->i_size, inode->i_blksize) -
  1916. +                      isize_to_blocks((inode->i_size - written), inode->i_blksize)));
  1917. +      }
  1918. +      current->io_usage += written;
  1919. +      if (wanted_blocks && (avail_blocks < wanted_blocks))
  1920. +         return -EDQUOT;
  1921. +
  1922. +      return written;
  1923. +   } else {
  1924. +      current->io_usage += bytes;
  1925. +      return filp->f_op->write(inode, filp, (char *)addr, bytes);
  1926. +   }
  1927. +}
  1928. +
  1929. +int vfs_create(struct inode *dir, const char *basename,
  1930. +               int namelen, int mode, struct inode **res_ino)
  1931. +{
  1932. +   int error;
  1933. +   struct inode new_inode;
  1934. +
  1935. +   memset(&new_inode, 0, sizeof(struct inode));
  1936. +   new_inode.i_dev = dir->i_dev;
  1937. +   new_inode.i_uid = current->fsuid;
  1938. +   new_inode.i_gid = current->fsgid;
  1939. +   getinoquota(&new_inode, -1);
  1940. +
  1941. +   if (quota_alloc(&new_inode, 1, 0, (u_long *)0) == NO_QUOTA) {
  1942. +      putinoquota(&new_inode);
  1943. +      return -EDQUOT;
  1944. +   }
  1945. +   error = dir->i_op->create(dir, basename, namelen, mode, res_ino);
  1946. +   if (error)
  1947. +      quota_remove(&new_inode, 1, 0);
  1948. +   putinoquota(&new_inode);
  1949. +
  1950. +   return error;
  1951. +}
  1952. +
  1953. +int vfs_truncate(struct inode *ino, size_t lenght)
  1954. +{
  1955. +   int error;
  1956. +   size_t old_isize;
  1957. +
  1958. +   old_isize = ino->i_size;
  1959. +   ino->i_size = lenght;
  1960. +   if (ino->i_op && ino->i_op->truncate)
  1961. +      ino->i_op->truncate(ino);
  1962. +   ino->i_ctime = ino->i_mtime = CURRENT_TIME;
  1963. +   ino->i_dirt = 1;
  1964. +   if ((error = notify_change(NOTIFY_SIZE, ino)))
  1965. +      return error;
  1966. +   getinoquota(ino, -1);
  1967. +   quota_remove(ino, 0, isize_to_blocks(old_isize, ino->i_blksize));
  1968. +   putinoquota(ino);
  1969. +
  1970. +   return error;
  1971. +}
  1972. +
  1973. +int vfs_mknod(struct inode *dir, const char *basename,
  1974. +              int namelen, int mode, dev_t dev)
  1975. +{
  1976. +   int error;
  1977. +   struct inode new_inode;
  1978. +
  1979. +   memset(&new_inode, 0, sizeof(struct inode));
  1980. +   new_inode.i_dev = dir->i_dev;
  1981. +   new_inode.i_uid = current->fsuid;
  1982. +   new_inode.i_gid = current->fsgid;
  1983. +   getinoquota(&new_inode, -1);
  1984. +
  1985. +   if (quota_alloc(&new_inode, 1, 0, (u_long *)0) == NO_QUOTA) {
  1986. +      putinoquota(&new_inode);
  1987. +      iput(dir);
  1988. +      return -EDQUOT;
  1989. +   }
  1990. +   dir->i_count++;
  1991. +   error = dir->i_op->mknod(dir, basename, namelen, mode, dev);
  1992. +   if (error)
  1993. +      quota_remove(&new_inode, 1, 0);
  1994. +   putinoquota(&new_inode);
  1995. +   iput(dir);
  1996. +
  1997. +   return error;
  1998. +}
  1999. +
  2000. +int vfs_mkdir(struct inode *dir, const char *basename, int namelen, int mode)
  2001. +{
  2002. +   int error;
  2003. +   struct inode new_inode;
  2004. +
  2005. +   memset(&new_inode, 0, sizeof(struct inode));
  2006. +   new_inode.i_dev = dir->i_dev;
  2007. +   new_inode.i_uid = current->fsuid;
  2008. +   new_inode.i_gid = current->fsgid;
  2009. +   getinoquota(&new_inode, -1);
  2010. +
  2011. +   if (quota_alloc(&new_inode, 1, 1, (u_long *)0) == NO_QUOTA) {
  2012. +      putinoquota(&new_inode);
  2013. +      iput(dir);
  2014. +      return -EDQUOT;
  2015. +   }
  2016. +   dir->i_count++;
  2017. +   error = dir->i_op->mkdir(dir, basename, namelen, mode);
  2018. +   if (error)
  2019. +      quota_remove(&new_inode, 1, 1);
  2020. +   putinoquota(&new_inode);
  2021. +   iput(dir);
  2022. +
  2023. +   return error;
  2024. +}
  2025. +
  2026. +int vfs_rmdir(struct inode *dir, const char *basename, int namelen)
  2027. +{
  2028. +   int error;
  2029. +   struct inode *old_inode;
  2030. +
  2031. +   /*
  2032. +    * Need inode entry of directory for quota operations
  2033. +    */
  2034. +   dir->i_count++;
  2035. +   if ((error = lookup(dir, basename, namelen, &old_inode))) {
  2036. +      iput(dir);
  2037. +      return error;
  2038. +   }
  2039. +   getinoquota(old_inode, -1);
  2040. +   if (!(error = dir->i_op->rmdir(dir, basename, namelen)))
  2041. +      quota_remove(old_inode, 1, 1);
  2042. +   putinoquota(old_inode);
  2043. +   iput(old_inode);
  2044. +
  2045. +   return error;
  2046. +}
  2047. +
  2048. +int vfs_unlink(struct inode *dir, const char *basename, int namelen)
  2049. +{
  2050. +   int error;
  2051. +   struct inode *old_inode;
  2052. +
  2053. +   /*
  2054. +    * Need inode info of to remove file for quota operations.
  2055. +    */
  2056. +   dir->i_count++;
  2057. +   if ((error = lookup(dir, basename, namelen, &old_inode))) {
  2058. +      iput(dir);
  2059. +      return error;
  2060. +   }
  2061. +   getinoquota(old_inode, -1);
  2062. +   error = dir->i_op->unlink(dir, basename, namelen);
  2063. +   /*
  2064. +    * Remove blocks and inode. Only if link-count is 0 !
  2065. +    */
  2066. +   if (!error && old_inode->i_nlink == 0)
  2067. +      quota_remove(old_inode, 1,
  2068. +                   isize_to_blocks(old_inode->i_size, old_inode->i_blksize));
  2069. +   putinoquota(old_inode);
  2070. +   iput(old_inode);
  2071. +
  2072. +   return error;
  2073. +}
  2074. +
  2075. +int vfs_symlink(struct inode *dir, const char *basename,
  2076. +                int namelen, const char *oldname)
  2077. +{
  2078. +   int error;
  2079. +   struct inode new_inode;
  2080. +
  2081. +   memset(&new_inode, 0, sizeof(struct inode));
  2082. +   new_inode.i_dev = dir->i_dev;
  2083. +   new_inode.i_uid = current->fsuid;
  2084. +   new_inode.i_gid = current->fsgid;
  2085. +   getinoquota(&new_inode, -1);
  2086. +
  2087. +   if (quota_alloc(&new_inode, 1, 1, (u_long *)0) == NO_QUOTA) {
  2088. +      putinoquota(&new_inode);
  2089. +      iput(dir);
  2090. +      return -EDQUOT;
  2091. +   }
  2092. +   dir->i_count++;
  2093. +   if (!(error = dir->i_op->symlink(dir, basename, namelen, oldname)))
  2094. +      quota_remove(&new_inode, 1, 1);
  2095. +   putinoquota(&new_inode);
  2096. +   iput(dir);
  2097. +
  2098. +   return error;
  2099. +}
  2100. +
  2101. +int vfs_chown(struct inode *ino, uid_t uid, gid_t gid)
  2102. +{
  2103. +   int error;
  2104. +   uid_t olduid, oldgid;
  2105. +   int notify_flag = 0;
  2106. +
  2107. +   olduid = ino->i_uid;
  2108. +   oldgid = ino->i_gid;
  2109. +   getinoquota(ino, -1);
  2110. +   if (quota_transfer(ino, uid, gid, 1,
  2111. +                      isize_to_blocks(ino->i_size,
  2112. +                      ino->i_blksize)) == NO_QUOTA) {
  2113. +      putinoquota(ino);
  2114. +      return -EDQUOT;
  2115. +   }
  2116. +   /*
  2117. +    * If the owner has been changed, remove the setuid bit
  2118. +    */
  2119. +   if (ino->i_uid != uid && ino->i_mode & S_ISUID) {
  2120. +      ino->i_mode &= ~S_ISUID;
  2121. +      notify_flag = NOTIFY_MODE;
  2122. +   }
  2123. +   /*
  2124. +    * If the group has been changed, remove the setgid bit
  2125. +    */
  2126. +   if (ino->i_gid != gid && ino->i_mode & S_ISGID) {
  2127. +      ino->i_mode &= ~S_ISGID;
  2128. +      notify_flag = NOTIFY_MODE;
  2129. +   }
  2130. +   ino->i_uid = uid;
  2131. +   ino->i_gid = gid;
  2132. +   notify_flag |= NOTIFY_UIDGID;
  2133. +   ino->i_ctime = CURRENT_TIME;
  2134. +   ino->i_dirt = 1;
  2135. +   if ((error = notify_change(notify_flag, ino)))
  2136. +      quota_transfer(ino, olduid, oldgid, 1,
  2137. +                     isize_to_blocks(ino->i_size, ino->i_blksize));
  2138. +   putinoquota(ino);
  2139. +   return error;
  2140. +}
  2141. +
  2142. +int vfs_rename(struct inode *old_dir, const char *old_base, int old_len,
  2143. +               struct inode *new_dir, const char *new_base, int new_len)
  2144. +{
  2145. +   int error;
  2146. +   struct inode *old_inode, *new_inode;
  2147. +
  2148. +   /*
  2149. +    * Check if target file already exists, drop quota of file if
  2150. +    * it already exists and is overwritten. Extra check needed for
  2151. +    * renames of file to the same file.
  2152. +    */
  2153. +   old_dir->i_count++;
  2154. +   if ((error = lookup(old_dir, old_base, old_len, &old_inode))) {
  2155. +      iput(old_dir);
  2156. +      iput(new_dir);
  2157. +      return error;
  2158. +   }
  2159. +   new_dir->i_count++;
  2160. +   if (!lookup(new_dir, new_base, new_len, &new_inode)) {
  2161. +      if (old_dir != new_dir && old_inode != new_inode) {
  2162. +         iput(old_inode);
  2163. +         error = old_dir->i_op->rename(old_dir, old_base, old_len, 
  2164. +                                       new_dir, new_base, new_len);
  2165. +         if (!error) {
  2166. +            getinoquota(new_inode, -1);
  2167. +            quota_remove(new_inode, 1,
  2168. +                         isize_to_blocks(new_inode->i_size, new_inode->i_blksize));
  2169. +            putinoquota(new_inode);
  2170. +            iput(new_inode);
  2171. +         }
  2172. +         return error;
  2173. +      }
  2174. +      iput(new_inode);
  2175. +   }
  2176. +   iput(old_inode);
  2177. +   return old_dir->i_op->rename(old_dir, old_base, old_len, 
  2178. +                                new_dir, new_base, new_len);
  2179. +}
  2180. +
  2181. +void vfs_open(struct file *filp)
  2182. +{
  2183. +   if (filp->f_inode && S_ISREG(filp->f_inode->i_mode) && (filp->f_mode & 2)) {
  2184. +      filp->f_inode->i_writecount++;
  2185. +      getinoquota(filp->f_inode, -1); 
  2186. +   }
  2187. +}
  2188. +
  2189. +void vfs_close(struct file *filp)
  2190. +{
  2191. +   if (filp->f_inode && S_ISREG(filp->f_inode->i_mode) && (filp->f_mode & 2)) {
  2192. +      filp->f_inode->i_writecount--;
  2193. +      putinoquota(filp->f_inode); 
  2194. +   }
  2195. +}
  2196. +
  2197. +#else /* CONFIG_QUOTA */
  2198. +
  2199. +int vfs_truncate(struct inode *ino, size_t lenght)
  2200. +{
  2201. +   int error;
  2202. +
  2203. +   ino->i_size = lenght;
  2204. +   if (ino->i_op && ino->i_op->truncate)
  2205. +      ino->i_op->truncate(ino);
  2206. +   if ((error = notify_change(NOTIFY_SIZE, ino))) {
  2207. +      return error;
  2208. +   }
  2209. +   ino->i_dirt = 1;
  2210. +
  2211. +   return error;
  2212. +}
  2213. +
  2214. +int vfs_chown(struct inode *ino, uid_t uid, gid_t gid)
  2215. +{
  2216. +   int notify_flag = 0;
  2217. +
  2218. +   /*
  2219. +    * If the owner has been changed, remove the setuid bit
  2220. +    */
  2221. +   if (ino->i_uid != uid && ino->i_mode & S_ISUID) {
  2222. +      ino->i_mode &= ~S_ISUID;
  2223. +      notify_flag = NOTIFY_MODE;
  2224. +   }
  2225. +   /*
  2226. +    * If the group has been changed, remove the setgid bit
  2227. +    */
  2228. +   if (ino->i_gid != gid && ino->i_mode & S_ISGID) {
  2229. +      ino->i_mode &= ~S_ISGID;
  2230. +      notify_flag = NOTIFY_MODE;
  2231. +   }
  2232. +   ino->i_uid = uid;
  2233. +   ino->i_gid = gid;
  2234. +   notify_flag |= NOTIFY_UIDGID;
  2235. +   ino->i_ctime = CURRENT_TIME;
  2236. +   ino->i_dirt = 1;
  2237. +   return(notify_change(notify_flag, ino));
  2238. +}
  2239. +
  2240. +void vfs_open(struct file *filp)
  2241. +{
  2242. +   if (filp->f_inode && S_ISREG(filp->f_inode->i_mode) && (filp->f_mode & 2))
  2243. +      filp->f_inode->i_writecount++;
  2244. +}
  2245. +
  2246. +void vfs_close(struct file *filp)
  2247. +{
  2248. +   if (filp->f_inode && S_ISREG(filp->f_inode->i_mode) && (filp->f_mode & 2))
  2249. +      filp->f_inode->i_writecount--;
  2250. +}
  2251. +
  2252. +#endif /* CONFIG_QUOTA */
  2253. +
  2254. diff -u --recursive --new-file linux-1.1.55/fs/inode.c linux/fs/inode.c
  2255. --- linux-1.1.55/fs/inode.c    Sat Sep 17 21:50:27 1994
  2256. +++ linux/fs/inode.c    Thu Oct 20 17:01:17 1994
  2257. @@ -427,6 +427,7 @@
  2258.      struct inode_hash_entry * h;
  2259.      struct inode * inode;
  2260.      struct inode * empty = NULL;
  2261. +    short cnt;
  2262.  
  2263.      if (!sb)
  2264.          panic("VFS: iget with sb==NULL");
  2265. @@ -455,8 +456,11 @@
  2266.      goto return_it;
  2267.  
  2268.  found_it:
  2269. -    if (!inode->i_count)
  2270. +    if (!inode->i_count) {
  2271.          nr_free_inodes--;
  2272. +        for (cnt = 0; cnt < MAXQUOTAS; cnt++)
  2273. +            inode->i_dquot[cnt] = NODQUOT;
  2274. +    }
  2275.      inode->i_count++;
  2276.      wait_on_inode(inode);
  2277.      if (inode->i_dev != sb->s_dev || inode->i_ino != nr) {
  2278. diff -u --recursive --new-file linux-1.1.55/fs/isofs/inode.c linux/fs/isofs/inode.c
  2279. --- linux-1.1.55/fs/isofs/inode.c    Sat Sep 17 21:48:44 1994
  2280. +++ linux/fs/isofs/inode.c    Thu Oct 20 17:01:17 1994
  2281. @@ -124,7 +124,7 @@
  2282.              break;
  2283.            }
  2284.          }
  2285. -        else return 0;
  2286. +        else return 1;
  2287.      }
  2288.      return 1;
  2289.  }
  2290. diff -u --recursive --new-file linux-1.1.55/fs/msdos/inode.c linux/fs/msdos/inode.c
  2291. --- linux-1.1.55/fs/msdos/inode.c    Sat Sep 17 21:41:19 1994
  2292. +++ linux/fs/msdos/inode.c    Thu Oct 20 17:01:17 1994
  2293. @@ -133,7 +133,7 @@
  2294.              if (value) return 0;
  2295.              *quiet = 1;
  2296.          }
  2297. -        else return 0;
  2298. +        else return 1;
  2299.      }
  2300.      return 1;
  2301.  }
  2302. diff -u --recursive --new-file linux-1.1.55/fs/namei.c linux/fs/namei.c
  2303. --- linux-1.1.55/fs/namei.c    Sat Sep 17 21:49:58 1994
  2304. +++ linux/fs/namei.c    Thu Oct 20 17:01:17 1994
  2305. @@ -16,6 +16,7 @@
  2306.  #include <linux/string.h>
  2307.  #include <linux/fcntl.h>
  2308.  #include <linux/stat.h>
  2309. +#include <linux/fileio.h>
  2310.  
  2311.  #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE])
  2312.  
  2313. @@ -345,7 +346,7 @@
  2314.              error = -EROFS;
  2315.          else {
  2316.              dir->i_count++;        /* create eats the dir */
  2317. -            error = dir->i_op->create(dir,basename,namelen,mode,res_inode);
  2318. +            error = vfs_create(dir,basename,namelen,mode,res_inode);
  2319.              up(&dir->i_sem);
  2320.              iput(dir);
  2321.              return error;
  2322. @@ -396,6 +397,7 @@
  2323.              }
  2324.           }
  2325.       }
  2326. +
  2327.      /*
  2328.       * An append-only file must be opened in append mode for writing
  2329.       */
  2330. @@ -403,16 +405,8 @@
  2331.          iput(inode);
  2332.          return -EPERM;
  2333.      }
  2334. -    if (flag & O_TRUNC) {
  2335. -          inode->i_size = 0;
  2336. -          if (inode->i_op && inode->i_op->truncate)
  2337. -               inode->i_op->truncate(inode);
  2338. -          if ((error = notify_change(NOTIFY_SIZE, inode))) {
  2339. -           iput(inode);
  2340. -           return error;
  2341. -          }
  2342. -          inode->i_dirt = 1;
  2343. -    }
  2344. +    if (flag & O_TRUNC)
  2345. +        vfs_truncate(inode, 0);
  2346.      *res_inode = inode;
  2347.      return 0;
  2348.  }
  2349. @@ -445,7 +439,7 @@
  2350.      }
  2351.      dir->i_count++;
  2352.      down(&dir->i_sem);
  2353. -    error = dir->i_op->mknod(dir,basename,namelen,mode,dev);
  2354. +    error = vfs_mknod(dir,basename,namelen,mode,dev);
  2355.      up(&dir->i_sem);
  2356.      iput(dir);
  2357.      return error;
  2358. @@ -502,7 +496,7 @@
  2359.      }
  2360.      dir->i_count++;
  2361.      down(&dir->i_sem);
  2362. -    error = dir->i_op->mkdir(dir,basename,namelen,mode);
  2363. +    error = vfs_mkdir(dir,basename,namelen,mode);
  2364.      up(&dir->i_sem);
  2365.      iput(dir);
  2366.      return error;
  2367. @@ -553,7 +547,7 @@
  2368.          iput(dir);
  2369.          return -EPERM;
  2370.      }
  2371. -    return dir->i_op->rmdir(dir,basename,namelen);
  2372. +    return vfs_rmdir(dir,basename,namelen);
  2373.  }
  2374.  
  2375.  asmlinkage int sys_rmdir(const char * pathname)
  2376. @@ -601,7 +595,7 @@
  2377.          iput(dir);
  2378.          return -EPERM;
  2379.      }
  2380. -    return dir->i_op->unlink(dir,basename,namelen);
  2381. +    return vfs_unlink(dir,basename,namelen);
  2382.  }
  2383.  
  2384.  asmlinkage int sys_unlink(const char * pathname)
  2385. @@ -644,7 +638,7 @@
  2386.      }
  2387.      dir->i_count++;
  2388.      down(&dir->i_sem);
  2389. -    error = dir->i_op->symlink(dir,basename,namelen,oldname);
  2390. +    error = vfs_symlink(dir,basename,namelen,oldname);
  2391.      up(&dir->i_sem);
  2392.      iput(dir);
  2393.      return error;
  2394. @@ -799,7 +793,7 @@
  2395.      }
  2396.      new_dir->i_count++;
  2397.      down(&new_dir->i_sem);
  2398. -    error = old_dir->i_op->rename(old_dir, old_base, old_len, 
  2399. +    error = vfs_rename(old_dir, old_base, old_len, 
  2400.          new_dir, new_base, new_len);
  2401.      up(&new_dir->i_sem);
  2402.      iput(new_dir);
  2403. diff -u --recursive --new-file linux-1.1.55/fs/open.c linux/fs/open.c
  2404. --- linux-1.1.55/fs/open.c    Sat Sep 17 21:49:58 1994
  2405. +++ linux/fs/open.c    Thu Oct 20 17:01:17 1994
  2406. @@ -16,6 +16,7 @@
  2407.  #include <linux/signal.h>
  2408.  #include <linux/tty.h>
  2409.  #include <linux/time.h>
  2410. +#include <linux/fileio.h>
  2411.  
  2412.  #include <asm/segment.h>
  2413.  
  2414. @@ -85,12 +86,7 @@
  2415.          iput(inode);
  2416.          return -EPERM;
  2417.      }
  2418. -    inode->i_size = length;
  2419. -    if (inode->i_op && inode->i_op->truncate)
  2420. -        inode->i_op->truncate(inode);
  2421. -    inode->i_ctime = inode->i_mtime = CURRENT_TIME;
  2422. -    inode->i_dirt = 1;
  2423. -    error = notify_change(NOTIFY_SIZE, inode);
  2424. +    error = vfs_truncate(inode, length);
  2425.      iput(inode);
  2426.      return error;
  2427.  }
  2428. @@ -108,12 +104,7 @@
  2429.          return -EACCES;
  2430.      if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
  2431.          return -EPERM;
  2432. -    inode->i_size = length;
  2433. -    if (inode->i_op && inode->i_op->truncate)
  2434. -        inode->i_op->truncate(inode);
  2435. -    inode->i_ctime = inode->i_mtime = CURRENT_TIME;
  2436. -    inode->i_dirt = 1;
  2437. -    return notify_change(NOTIFY_SIZE, inode);
  2438. +    return vfs_truncate(inode, length);
  2439.  }
  2440.  
  2441.  /* If times==NULL, set access and modification to current time,
  2442. @@ -319,25 +310,7 @@
  2443.      if ((current->fsuid == inode->i_uid && user == inode->i_uid &&
  2444.           (in_group_p(group) || group == inode->i_gid)) ||
  2445.          fsuser()) {
  2446. -        inode->i_uid = user;
  2447. -        inode->i_gid = group;
  2448. -        /*
  2449. -         * If the owner has been changed, remove the setuid bit
  2450. -         */
  2451. -        if (old_user != inode->i_uid && inode->i_mode & S_ISUID) {
  2452. -            inode->i_mode &= ~S_ISUID;
  2453. -            notify_flag = NOTIFY_MODE;
  2454. -        }
  2455. -        /*
  2456. -         * If the group has been changed, remove the setgid bit
  2457. -         */
  2458. -        if (old_group != inode->i_gid && inode->i_mode & S_ISGID) {
  2459. -            inode->i_mode &= ~S_ISGID;
  2460. -            notify_flag = NOTIFY_MODE;
  2461. -        }
  2462. -        inode->i_ctime = CURRENT_TIME;
  2463. -        inode->i_dirt = 1;
  2464. -        return notify_change(notify_flag | NOTIFY_UIDGID, inode);
  2465. +        return vfs_chown(inode, user, group);
  2466.      }
  2467.      return -EPERM;
  2468.  }
  2469. @@ -366,25 +339,7 @@
  2470.      if ((current->fsuid == inode->i_uid && user == inode->i_uid &&
  2471.           (in_group_p(group) || group == inode->i_gid)) ||
  2472.          fsuser()) {
  2473. -        inode->i_uid = user;
  2474. -        inode->i_gid = group;
  2475. -        /*
  2476. -         * If the owner has been changed, remove the setuid bit
  2477. -         */
  2478. -        if (old_user != inode->i_uid && inode->i_mode & S_ISUID) {
  2479. -            inode->i_mode &= ~S_ISUID;
  2480. -            notify_flag = NOTIFY_MODE;
  2481. -        }
  2482. -        /*
  2483. -         * If the group has been changed, remove the setgid bit
  2484. -         */
  2485. -        if (old_group != inode->i_gid && inode->i_mode & S_ISGID) {
  2486. -            inode->i_mode &= ~S_ISGID;
  2487. -            notify_flag = NOTIFY_MODE;
  2488. -        }
  2489. -        inode->i_ctime = CURRENT_TIME;
  2490. -        inode->i_dirt = 1;
  2491. -        error = notify_change(notify_flag | NOTIFY_UIDGID, inode);
  2492. +        error = vfs_chown(inode, user, group);
  2493.          iput(inode);
  2494.          return error;
  2495.      }
  2496. @@ -450,6 +405,7 @@
  2497.              return error;
  2498.          }
  2499.      }
  2500. +    vfs_open(f);
  2501.      f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
  2502.      return (fd);
  2503.  }
  2504. @@ -483,6 +439,7 @@
  2505.      inode = filp->f_inode;
  2506.      if (inode)
  2507.          fcntl_remove_locks(current, filp, fd);
  2508. +    vfs_close(filp);
  2509.      if (filp->f_count > 1) {
  2510.          filp->f_count--;
  2511.          return 0;
  2512. diff -u --recursive --new-file linux-1.1.55/fs/read_write.c linux/fs/read_write.c
  2513. --- linux-1.1.55/fs/read_write.c    Thu Oct 20 15:14:28 1994
  2514. +++ linux/fs/read_write.c    Thu Oct 20 17:01:17 1994
  2515. @@ -9,6 +9,7 @@
  2516.  #include <linux/stat.h>
  2517.  #include <linux/kernel.h>
  2518.  #include <linux/sched.h>
  2519. +#include <linux/fileio.h>
  2520.  
  2521.  #include <asm/segment.h>
  2522.  
  2523. @@ -130,6 +131,7 @@
  2524.      error = verify_area(VERIFY_WRITE,buf,count);
  2525.      if (error)
  2526.          return error;
  2527. +    current->io_usage += count;
  2528.      return file->f_op->read(inode,file,buf,count);
  2529.  }
  2530.  
  2531. diff -u --recursive --new-file linux-1.1.55/fs/super.c linux/fs/super.c
  2532. --- linux-1.1.55/fs/super.c    Thu Oct 13 21:31:08 1994
  2533. +++ linux/fs/super.c    Thu Oct 20 17:01:18 1994
  2534. @@ -2,16 +2,20 @@
  2535.   *  linux/fs/super.c
  2536.   *
  2537.   *  Copyright (C) 1991, 1992  Linus Torvalds
  2538. + *
  2539. + *  super.c contains code to handle: - mount structures
  2540. + *                                   - super-block tables.
  2541. + *                                   - mount systemcall
  2542. + *                                   - umount systemcall
  2543.   */
  2544.  
  2545. -/*
  2546. - * super.c contains code to handle the super-block tables.
  2547. - */
  2548.  #include <stdarg.h>
  2549.  
  2550.  #include <linux/config.h>
  2551.  #include <linux/sched.h>
  2552.  #include <linux/kernel.h>
  2553. +#include <linux/mount.h>
  2554. +#include <linux/malloc.h>
  2555.  #include <linux/major.h>
  2556.  #include <linux/stat.h>
  2557.  #include <linux/errno.h>
  2558. @@ -21,23 +25,112 @@
  2559.  #include <asm/system.h>
  2560.  #include <asm/segment.h>
  2561.  #include <asm/bitops.h>
  2562. +
  2563.  extern struct file_operations * get_blkfops(unsigned int);
  2564. -extern struct file_operations * get_chrfops(unsigned int);
  2565.  
  2566.  extern void wait_for_keypress(void);
  2567.  extern void fcntl_init_locks(void);
  2568.  
  2569.  extern int root_mountflags;
  2570.  
  2571. -struct super_block super_blocks[NR_SUPER];
  2572. -
  2573.  static int do_remount_sb(struct super_block *sb, int flags, char * data);
  2574.  
  2575. -/* this is initialized in init/main.c */
  2576. +/*
  2577. + * This is initialized in init/main.c
  2578. + */
  2579.  dev_t ROOT_DEV = 0;
  2580.  
  2581. -static struct file_system_type * file_systems = NULL;
  2582. +struct super_block super_blocks[NR_SUPER];
  2583. +static struct file_system_type *file_systems = (struct file_system_type *) NULL;
  2584. +static struct vfsmount *vfsmntlist = (struct vfsmount *) NULL,
  2585. +                       *vfsmnttail = (struct vfsmount *) NULL,
  2586. +                       *mru_vfsmnt = (struct vfsmount *) NULL;
  2587. +
  2588. +/* 
  2589. + * This part handles the management of the list of mounted filesystems.
  2590. + * Superblock retrieval is also done with this list.
  2591. + */
  2592. +struct vfsmount *lookup_vfsmnt(dev_t dev)
  2593. +{
  2594. +    register struct vfsmount *lptr;
  2595. +
  2596. +    if (vfsmntlist == (struct vfsmount *) 0)
  2597. +        return ((struct vfsmount *) 0);
  2598. +
  2599. +    if (mru_vfsmnt != (struct vfsmount *) 0 && mru_vfsmnt->mnt_dev == dev)
  2600. +        return (mru_vfsmnt);
  2601. +
  2602. +    for (lptr = vfsmntlist; lptr != (struct vfsmount *)0; lptr = lptr->mnt_next)
  2603. +        if (lptr->mnt_dev == dev)
  2604. +            return (lptr);
  2605. +
  2606. +    return ((struct vfsmount *) 0);
  2607. +    /* NOTREACHED */
  2608. +}
  2609. +
  2610. +static struct vfsmount *add_vfsmnt(dev_t dev, const char *dev_name,
  2611. +                   const char *dir_name)
  2612. +{
  2613. +    register struct vfsmount *lptr;
  2614. +    char *tmp;
  2615. +
  2616. +    if ((lptr = (struct vfsmount *)
  2617. +         kmalloc(sizeof(struct vfsmount), GFP_KERNEL)) == (struct vfsmount *) 0)
  2618. +        panic("VFS: Unable to allocate memory for vfsmount devicelist");
  2619. +
  2620. +    memset(lptr, 0, sizeof(struct vfsmount));
  2621. +    lptr->mnt_dev = dev;
  2622. +    if (dev_name) {
  2623. +        if (!getname(dev_name, &tmp)) {
  2624. +            if ((lptr->mnt_devname =
  2625. +                (char *) kmalloc(strlen(tmp), GFP_KERNEL)) != (char *)0)
  2626. +                strcpy(lptr->mnt_devname, tmp);
  2627. +            putname(tmp);
  2628. +        }
  2629. +    }
  2630. +    if (dir_name) {
  2631. +        if (!getname(dir_name, &tmp)) {
  2632. +            if ((lptr->mnt_dirname =
  2633. +                (char *) kmalloc(strlen(tmp), GFP_KERNEL)) != (char *)0)
  2634. +            strcpy(lptr->mnt_dirname, tmp);
  2635. +            putname(tmp);
  2636. +        }
  2637. +    }
  2638. +
  2639. +    if (vfsmntlist == (struct vfsmount *)0)
  2640. +        vfsmntlist = vfsmnttail = lptr;
  2641. +    else {
  2642. +        vfsmnttail->mnt_next = lptr;
  2643. +        vfsmnttail = lptr;
  2644. +    }
  2645. +    return (lptr);
  2646. +}
  2647. +
  2648. +static void remove_vfsmnt(dev_t dev)
  2649. +{
  2650. +    register struct vfsmount *lptr, *tofree;
  2651. +
  2652. +    if (vfsmntlist == (struct vfsmount *) 0)
  2653. +        return;
  2654. +    lptr = vfsmntlist;
  2655. +    if (lptr->mnt_dev == dev) {
  2656. +        tofree = lptr;
  2657. +        vfsmntlist = lptr->mnt_next;
  2658. +    } else {
  2659. +        while (lptr->mnt_next != (struct vfsmount *) 0) {
  2660. +            if (lptr->mnt_next->mnt_dev == dev)
  2661. +                break;
  2662. +            lptr = lptr->mnt_next;
  2663. +        }
  2664. +        tofree = lptr->mnt_next;
  2665. +        if (vfsmnttail->mnt_dev == dev)
  2666. +            vfsmnttail = lptr;
  2667. +        lptr->mnt_next = lptr->mnt_next->mnt_next;
  2668. +    }
  2669. +    kfree(tofree->mnt_devname);
  2670. +    kfree(tofree->mnt_dirname);
  2671. +    kfree_s(tofree, sizeof(struct vfsmount));
  2672. +}
  2673.  
  2674.  int register_filesystem(struct file_system_type * fs)
  2675.  {
  2676. @@ -319,17 +412,30 @@
  2677.              MAJOR(dev), MINOR(dev));
  2678.  }
  2679.  
  2680. +extern void acct_auto_close(dev_t dev);
  2681. +
  2682.  static int do_umount(dev_t dev)
  2683.  {
  2684.      struct super_block * sb;
  2685.      int retval;
  2686.      
  2687.      if (dev==ROOT_DEV) {
  2688. -        /* Special case for "unmounting" root.  We just try to remount
  2689. -           it readonly, and sync() the device. */
  2690. +        /*
  2691. +         * Special case for "unmounting" root. We just try to remount
  2692. +         * it readonly, and sync() the device.
  2693. +         */
  2694.          if (!(sb=get_super(dev)))
  2695.              return -ENOENT;
  2696.          if (!(sb->s_flags & MS_RDONLY)) {
  2697. +#ifdef CONFIG_QUOTA
  2698. +            /*
  2699. +             * Make sure all quotas are turned off on this device we need to mount
  2700. +             * it readonly so no more writes by the quotasystem.
  2701. +             * If later on the remount fails to bad there are no quotas running
  2702. +             * anymore. Turn them on again by hand.
  2703. +             */
  2704. +            (void) quota_off(dev, -1);
  2705. +#endif
  2706.              fsync_dev(dev);
  2707.              retval = do_remount_sb(sb, MS_RDONLY, 0);
  2708.              if (retval)
  2709. @@ -342,6 +448,18 @@
  2710.      if (!sb->s_covered->i_mount)
  2711.          printk("VFS: umount(%d/%d): mounted inode has i_mount=NULL\n",
  2712.                              MAJOR(dev), MINOR(dev));
  2713. +#ifdef CONFIG_QUOTA
  2714. +    /*
  2715. +     * Before checking if the filesystem is still busy make sure the kernel
  2716. +     * doesn't hold any quotafiles open on that device. If the umount fails
  2717. +     * to bad there are no quotas running anymore. Turn them on again by hand.
  2718. +     */
  2719. +    (void) quota_off(dev, -1);
  2720. +#endif
  2721. +    /*
  2722. +     * The same as for quota is also true for the accounting file.
  2723. +     */
  2724. +    acct_auto_close(dev);
  2725.      if (!fs_may_umount(dev, sb->s_mounted))
  2726.          return -EBUSY;
  2727.      sb->s_covered->i_mount = NULL;
  2728. @@ -352,6 +470,7 @@
  2729.      if (sb->s_op && sb->s_op->write_super && sb->s_dirt)
  2730.          sb->s_op->write_super(sb);
  2731.      put_super(dev);
  2732. +    remove_vfsmnt(dev);
  2733.      return 0;
  2734.  }
  2735.  
  2736. @@ -427,13 +546,15 @@
  2737.   * We also have to flush all inode-data for this device, as the new mount
  2738.   * might need new info.
  2739.   */
  2740. -static int do_mount(dev_t dev, const char * dir, char * type, int flags, void * data)
  2741. +static int do_mount(dev_t dev, const char * dev_name, const char * dir_name,
  2742. +            char * type, int flags, void * data)
  2743.  {
  2744.      struct inode * dir_i;
  2745.      struct super_block * sb;
  2746. +    struct vfsmount *vfsmnt;
  2747.      int error;
  2748.  
  2749. -    error = namei(dir,&dir_i);
  2750. +    error = namei(dir_name,&dir_i);
  2751.      if (error)
  2752.          return error;
  2753.      if (dir_i->i_count != 1 || dir_i->i_mount) {
  2754. @@ -453,6 +574,9 @@
  2755.          iput(dir_i);
  2756.          return -EBUSY;
  2757.      }
  2758. +    vfsmnt = add_vfsmnt(dev, dev_name, dir_name);
  2759. +    vfsmnt->mnt_sb = sb;
  2760. +    vfsmnt->mnt_sem.count = 1;
  2761.      sb->s_covered = dir_i;
  2762.      dir_i->i_mount = sb->s_mounted;
  2763.      return 0;        /* we don't iput(dir_i) - see umount */
  2764. @@ -623,7 +747,7 @@
  2765.              return retval;
  2766.          }
  2767.      }
  2768. -    retval = do_mount(dev,dir_name,t,flags,(void *) page);
  2769. +    retval = do_mount(dev,dev_name,dir_name,t,flags,(void *) page);
  2770.      free_page(page);
  2771.      if (retval && fops && fops->release)
  2772.          fops->release(inode, NULL);
  2773. @@ -635,10 +759,11 @@
  2774.  {
  2775.      struct file_system_type * fs_type;
  2776.      struct super_block * sb;
  2777. +    struct vfsmount *vfsmnt;
  2778.      struct inode * inode, d_inode;
  2779.      struct file filp;
  2780.      int retval;
  2781. -
  2782. +  
  2783.      memset(super_blocks, 0, sizeof(super_blocks));
  2784.      fcntl_init_locks();
  2785.      if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
  2786. @@ -664,9 +789,9 @@
  2787.      for (fs_type = file_systems ; fs_type ; fs_type = fs_type->next) {
  2788.          if(retval)
  2789.              break;
  2790. -        if (!fs_type->requires_dev)
  2791. -            continue;
  2792. -        sb = read_super(ROOT_DEV,fs_type->name,root_mountflags,NULL,1);
  2793. +          if (!fs_type->requires_dev)
  2794. +              continue;
  2795. +          sb = read_super(ROOT_DEV,fs_type->name,root_mountflags,NULL,1);
  2796.          if (sb) {
  2797.              inode = sb->s_mounted;
  2798.              inode->i_count += 3 ;    /* NOTE! it is logically used 4 times, not 1 */
  2799. @@ -677,6 +802,9 @@
  2800.              printk ("VFS: Mounted root (%s filesystem)%s.\n",
  2801.                  fs_type->name,
  2802.                  (sb->s_flags & MS_RDONLY) ? " readonly" : "");
  2803. +            vfsmnt = add_vfsmnt(ROOT_DEV, "rootfs", "/");
  2804. +            vfsmnt->mnt_sb = sb;
  2805. +            vfsmnt->mnt_sem.count = 1;
  2806.              return;
  2807.          }
  2808.      }
  2809. diff -u --recursive --new-file linux-1.1.55/ibcs/binfmt_coff.c linux/ibcs/binfmt_coff.c
  2810. --- linux-1.1.55/ibcs/binfmt_coff.c    Sat Sep 17 21:48:00 1994
  2811. +++ linux/ibcs/binfmt_coff.c    Thu Oct 20 17:01:18 1994
  2812. @@ -455,6 +455,8 @@
  2813.  /*
  2814.   *  Do the end processing once the stack has been constructed
  2815.   */
  2816. +            current->flags          &= ~PF_FORKNOEXEC; /* accounting flags */
  2817. +            current->io_usage        = 0;
  2818.          current->mm->start_code  = text_vaddr & PAGE_MASK;
  2819.          current->mm->end_code    = text_vaddr + text_size;
  2820.          current->mm->end_data    = data_vaddr + data_size;
  2821. diff -u --recursive --new-file linux-1.1.55/include/linux/acct.h linux/include/linux/acct.h
  2822. --- linux-1.1.55/include/linux/acct.h    Wed Dec 31 18:00:00 1969
  2823. +++ linux/include/linux/acct.h    Thu Oct 20 17:01:18 1994
  2824. @@ -0,0 +1,28 @@
  2825. +#ifndef __LINUX_ACCT_H
  2826. +#define __LINUX_ACCT_H
  2827. +
  2828. +#define ACCT_COMM 16
  2829. +
  2830. +struct acct
  2831. +{
  2832. +   char          ac_comm[ACCT_COMM];    /* Accounting command name */
  2833. +   time_t        ac_utime;        /* Accounting user time */
  2834. +   time_t        ac_stime;        /* Accounting system time */
  2835. +   time_t        ac_etime;        /* Accounting elapsed time */
  2836. +   time_t        ac_btime;        /* Beginning time */
  2837. +   uid_t         ac_uid;        /* Accounting user ID */
  2838. +   gid_t         ac_gid;        /* Accounting group ID */
  2839. +   dev_t         ac_tty;        /* controlling tty */
  2840. +   char          ac_flag;        /* Accounting flag */
  2841. +   unsigned long ac_mem;        /* Pages of memory used */
  2842. +   unsigned long ac_io;            /* Number of bytes read/written */
  2843. +};
  2844. +
  2845. +#define AFORK    0001    /* has executed fork, but no exec */
  2846. +#define ASU    0002    /* used super-user privileges */
  2847. +#define ACORE    0004    /* dumped core */
  2848. +#define AXSIG    0010    /* killed by a signal */
  2849. +
  2850. +#define AHZ     100
  2851. +
  2852. +#endif
  2853. diff -u --recursive --new-file linux-1.1.55/include/linux/autoconf.h linux/include/linux/autoconf.h
  2854. --- linux-1.1.55/include/linux/autoconf.h    Wed Dec 31 18:00:00 1969
  2855. +++ linux/include/linux/autoconf.h    Thu Oct 20 17:09:32 1994
  2856. @@ -0,0 +1,147 @@
  2857. +/*
  2858. + * Automatically generated C config: don't edit
  2859. + */
  2860. +
  2861. +/*
  2862. + * General setup
  2863. + */
  2864. +#define CONFIG_MATH_EMULATION 1
  2865. +#define CONFIG_BLK_DEV_HD 1
  2866. +#undef  CONFIG_BLK_DEV_XD
  2867. +#define CONFIG_NET 1
  2868. +#undef  CONFIG_QUOTA
  2869. +#undef  CONFIG_MAX_16M
  2870. +#define CONFIG_SYSVIPC 1
  2871. +#define CONFIG_BINFMT_ELF 1
  2872. +#define CONFIG_M486 1
  2873. +
  2874. +/*
  2875. + * Networking options
  2876. + */
  2877. +#define CONFIG_INET 1
  2878. +#undef  CONFIG_IP_FORWARD
  2879. +
  2880. +/*
  2881. + * (it is safe to leave these untouched)
  2882. + */
  2883. +#undef  CONFIG_INET_PCTCP
  2884. +#undef  CONFIG_INET_RARP
  2885. +#define CONFIG_INET_SNARL 1
  2886. +#undef  CONFIG_TCP_NAGLE_OFF
  2887. +#undef  CONFIG_IPX
  2888. +
  2889. +/*
  2890. + * SCSI support
  2891. + */
  2892. +#define CONFIG_SCSI 1
  2893. +
  2894. +/*
  2895. + * SCSI support type (disk, tape, CDrom)
  2896. + */
  2897. +#define CONFIG_BLK_DEV_SD 1
  2898. +#define CONFIG_CHR_DEV_ST 1
  2899. +#define CONFIG_BLK_DEV_SR 1
  2900. +#undef  CONFIG_CHR_DEV_SG
  2901. +
  2902. +/*
  2903. + * SCSI low-level drivers
  2904. + */
  2905. +#define CONFIG_SCSI_AHA152X 1
  2906. +#define CONFIG_SCSI_AHA1542 1
  2907. +#define CONFIG_SCSI_AHA1740 1
  2908. +#define CONFIG_SCSI_BUSLOGIC 1
  2909. +#define CONFIG_SCSI_FUTURE_DOMAIN 1
  2910. +#define CONFIG_SCSI_GENERIC_NCR5380 1
  2911. +#define CONFIG_SCSI_NCR53C7xx 1
  2912. +#define CONFIG_SCSI_PAS16 1
  2913. +#define CONFIG_SCSI_SEAGATE 1
  2914. +#define CONFIG_SCSI_T128 1
  2915. +#define CONFIG_SCSI_ULTRASTOR 1
  2916. +#define CONFIG_SCSI_7000FASST 1
  2917. +
  2918. +/*
  2919. + * Network device support
  2920. + */
  2921. +#define CONFIG_NETDEVICES 1
  2922. +#undef  CONFIG_DUMMY
  2923. +#define CONFIG_SLIP 1
  2924. +#define SL_COMPRESSED 1
  2925. +#define CONFIG_PPP 1
  2926. +#undef  CONFIG_PLIP
  2927. +#undef  CONFIG_SLAVE_BALANCING
  2928. +#define CONFIG_NET_ALPHA 1
  2929. +#define CONFIG_NET_VENDOR_SMC 1
  2930. +#define CONFIG_WD80x3 1
  2931. +#define CONFIG_ULTRA 1
  2932. +#define CONFIG_NET_VENDOR_3COM 1
  2933. +#define CONFIG_EL1 1
  2934. +#define CONFIG_EL2 1
  2935. +#define CONFIG_ELPLUS 1
  2936. +#define CONFIG_EL16 1
  2937. +#define CONFIG_EL3 1
  2938. +#define CONFIG_NET_ISA 1
  2939. +#define CONFIG_LANCE 1
  2940. +#define CONFIG_E2100 1
  2941. +#define CONFIG_DEPCA 1
  2942. +#define CONFIG_EEXPRESS 1
  2943. +#define CONFIG_AT1700 1
  2944. +#define CONFIG_NI52 1
  2945. +#define CONFIG_NI65 1
  2946. +#define CONFIG_HPLAN 1
  2947. +#define CONFIG_NE2000 1
  2948. +#define CONFIG_SK_G16 1
  2949. +#define CONFIG_NET_EISA 1
  2950. +#define CONFIG_AC3200 1
  2951. +#define CONFIG_APRICOT 1
  2952. +#define CONFIG_NET_POCKET 1
  2953. +#define CONFIG_DE600 1
  2954. +#define CONFIG_DE620 1
  2955. +#define CONFIG_ATP 1
  2956. +#define CONFIG_ZNET 1
  2957. +
  2958. +/*
  2959. + * CD-ROM drivers
  2960. + */
  2961. +#undef  CONFIG_CDU31A
  2962. +#undef  CONFIG_MCD
  2963. +#undef  CONFIG_SBPCD
  2964. +
  2965. +/*
  2966. + * Filesystems
  2967. + */
  2968. +#define CONFIG_MINIX_FS 1
  2969. +#undef  CONFIG_EXT_FS
  2970. +#define CONFIG_EXT2_FS 1
  2971. +#define CONFIG_XIA_FS 1
  2972. +#define CONFIG_MSDOS_FS 1
  2973. +#define CONFIG_UMSDOS_FS 1
  2974. +#define CONFIG_PROC_FS 1
  2975. +#define CONFIG_NFS_FS 1
  2976. +#define CONFIG_ISO9660_FS 1
  2977. +#define CONFIG_HPFS_FS 1
  2978. +#undef  CONFIG_SYSV_FS
  2979. +
  2980. +/*
  2981. + * character devices
  2982. + */
  2983. +#define CONFIG_PRINTER 1
  2984. +#undef  CONFIG_BUSMOUSE
  2985. +#define CONFIG_PSMOUSE 1
  2986. +#define CONFIG_82C710_MOUSE 1
  2987. +#undef  CONFIG_MS_BUSMOUSE
  2988. +#undef  CONFIG_ATIXL_BUSMOUSE
  2989. +#define CONFIG_SELECTION 1
  2990. +#undef  CONFIG_QIC02_TAPE
  2991. +#define CONFIG_FTAPE 1
  2992. +#define NR_FTAPE_BUFFERS (3)
  2993. +
  2994. +/*
  2995. + * Sound
  2996. + */
  2997. +#undef  CONFIG_SOUND
  2998. +
  2999. +/*
  3000. + * Kernel hacking
  3001. + */
  3002. +#undef  CONFIG_PROFILE
  3003. +#undef  CONFIG_SCSI_CONSTANTS
  3004. diff -u --recursive --new-file linux-1.1.55/include/linux/fileio.h linux/include/linux/fileio.h
  3005. --- linux-1.1.55/include/linux/fileio.h    Wed Dec 31 18:00:00 1969
  3006. +++ linux/include/linux/fileio.h    Thu Oct 20 17:01:18 1994
  3007. @@ -0,0 +1,70 @@
  3008. +/*
  3009. + *
  3010. + * Simple VFS definitions for fileio.
  3011. + *
  3012. + * Authors: Marco van Wieringen <v892273@si.hhs.nl> <mvw@mcs.ow.org>
  3013. + *          Edvard Tuinder <v892231@si.hhs.nl> <ed@delirium.ow.org>
  3014. + *
  3015. + * Version: $Id: fileio.h,v 1.5 1994/05/30 18:39:42 mvw Exp mvw $
  3016. + *
  3017. + */
  3018. +#ifndef _LINUX_FILEIO_H
  3019. +#define _LINUX_FILEIO_H
  3020. +
  3021. +#include <linux/config.h>
  3022. +#include <linux/stat.h>
  3023. +
  3024. +#ifdef CONFIG_QUOTA
  3025. +
  3026. +int vfs_write(struct inode *ino, struct file *file, char *addr, size_t bytes);
  3027. +int vfs_create(struct inode *dir, const char *basename,
  3028. +               int namelen, int mode, struct inode **res_ino);
  3029. +int vfs_truncate(struct inode *ino, size_t lenght);
  3030. +int vfs_mknod(struct inode *dir, const char *basename,
  3031. +              int namelen, int mode, dev_t dev);
  3032. +int vfs_mkdir(struct inode *dir, const char *basename, int namelen, int mode);
  3033. +int vfs_rmdir(struct inode *dir, const char *basename, int namelen);
  3034. +int vfs_unlink(struct inode *dir, const char *basename, int namelen);
  3035. +int vfs_symlink(struct inode *dir, const char *basename,
  3036. +                int namelen, const char *oldname);
  3037. +int vfs_chown(struct inode *ino, uid_t uid, gid_t gid);
  3038. +int vfs_rename(struct inode *old_dir, const char *old_base, int old_len,
  3039. +               struct inode *new_dir, const char *mew_base, int new_len);
  3040. +void vfs_open(struct file *filp);
  3041. +void vfs_close(struct file *filp);
  3042. +
  3043. +#else /* CONFIG_QUOTA */
  3044. +
  3045. +#define vfs_write(ino, file, addr, bytes) \
  3046. +(file)->f_op->write((ino),(file),(addr),(bytes))
  3047. +
  3048. +#define vfs_create(dir, basename, namelen, mode, res_ino) \
  3049. +(dir)->i_op->create((dir),(basename),(namelen),(mode),(res_ino))
  3050. +
  3051. +int vfs_truncate(struct inode *ino, size_t lenght);
  3052. +
  3053. +#define vfs_mknod(dir, basename, namelen, mode, dev) \
  3054. +(dir)->i_op->mknod((dir),(basename),(namelen),(mode),(dev))
  3055. +
  3056. +#define vfs_mkdir(dir, basename, namelen, mode) \
  3057. +(dir)->i_op->mkdir((dir),(basename),(namelen),(mode))
  3058. +
  3059. +#define vfs_rmdir(dir, basename, namelen) \
  3060. +(dir)->i_op->rmdir((dir),(basename),(namelen))
  3061. +
  3062. +#define vfs_unlink(dir, basename, namelen) \
  3063. +(dir)->i_op->unlink((dir),(basename),(namelen))
  3064. +
  3065. +#define vfs_symlink(dir, basename, namelen, oldname) \
  3066. +(dir)->i_op->symlink((dir),(basename),(namelen),(oldname))
  3067. +
  3068. +int vfs_chown(struct inode *ino, uid_t uid, gid_t gid);
  3069. +
  3070. +#define vfs_rename(old_dir, old_base, old_len, new_dir, new_base, new_len) \
  3071. +(old_dir)->i_op->rename((old_dir),(old_base),(old_len),(new_dir),(new_base),(new_len))
  3072. +
  3073. +void vfs_open(struct file *filp);
  3074. +void vfs_close(struct file *filp);
  3075. +
  3076. +#endif /* CONFIG_QUOTA */
  3077. +#endif /* _LINUX_FILEIO_H */
  3078. diff -u --recursive --new-file linux-1.1.55/include/linux/fs.h linux/include/linux/fs.h
  3079. --- linux-1.1.55/include/linux/fs.h    Sat Sep 17 21:50:00 1994
  3080. +++ linux/include/linux/fs.h    Thu Oct 20 17:01:18 1994
  3081. @@ -171,6 +171,7 @@
  3082.  #include <linux/nfs_fs_i.h>
  3083.  #include <linux/xia_fs_i.h>
  3084.  #include <linux/sysv_fs_i.h>
  3085. +#include <linux/quota.h>
  3086.  
  3087.  #ifdef __KERNEL__
  3088.  
  3089. @@ -200,7 +201,9 @@
  3090.      struct inode * i_bound_to, * i_bound_by;
  3091.      struct inode * i_mount;
  3092.      struct socket * i_socket;
  3093. +    struct dquot * i_dquot[MAXQUOTAS];
  3094.      unsigned short i_count;
  3095. +    unsigned short i_writecount;
  3096.      unsigned short i_flags;
  3097.      unsigned char i_lock;
  3098.      unsigned char i_dirt;
  3099. diff -u --recursive --new-file linux-1.1.55/include/linux/kernel.h linux/include/linux/kernel.h
  3100. --- linux-1.1.55/include/linux/kernel.h    Sat Sep 17 21:49:17 1994
  3101. +++ linux/include/linux/kernel.h    Thu Oct 20 17:01:18 1994
  3102. @@ -54,19 +54,6 @@
  3103.  asmlinkage int printk(const char * fmt, ...)
  3104.      __attribute__ ((format (printf, 1, 2)));
  3105.  
  3106. -/*
  3107. - * This is defined as a macro, but at some point this might become a
  3108. - * real subroutine that sets a flag if it returns true (to do
  3109. - * BSD-style accounting where the process is flagged if it uses root
  3110. - * privs).  The implication of this is that you should do normal
  3111. - * permissions checks first, and check suser() last.
  3112. - *
  3113. - * "suser()" checks against the effective user id, while "fsuser()"
  3114. - * is used for file permission checking and checks against the fsuid..
  3115. - */
  3116. -#define suser() (current->euid == 0)
  3117. -#define fsuser() (current->fsuid == 0)
  3118. -
  3119.  extern int splx (int new_ipl);
  3120.  #endif /* __KERNEL__ */
  3121.  
  3122. diff -u --recursive --new-file linux-1.1.55/include/linux/mount.h linux/include/linux/mount.h
  3123. --- linux-1.1.55/include/linux/mount.h    Wed Dec 31 18:00:00 1969
  3124. +++ linux/include/linux/mount.h    Thu Oct 20 17:01:18 1994
  3125. @@ -0,0 +1,34 @@
  3126. +/*
  3127. + *
  3128. + * Definitions for mount interface. This describes the in the kernel build 
  3129. + * linkedlist with mounted filesystems.
  3130. + *
  3131. + * Authors: Marco van Wieringen <v892273@si.hhs.nl> <mvw@mcs.ow.org>
  3132. + *          Edvard Tuinder <v892231@si.hhs.nl> <ed@delirium.ow.org>
  3133. + *
  3134. + * Version: $Id: mount.h,v 1.3 1994/07/20 22:01:00 mvw Exp mvw $
  3135. + *
  3136. + */
  3137. +#ifndef _LINUX_MOUNT_H
  3138. +#define _LINUX_MOUNT_H
  3139. +
  3140. +#define QF_OPENING  0x01        /* Quotafile is in progress of being opened */
  3141. +#define QF_CLOSING  0x02        /* Quotafile is in progress of being closed */
  3142. +
  3143. +struct vfsmount
  3144. +{
  3145. +   dev_t mnt_dev;                      /* Device this applies to */
  3146. +   char *mnt_devname;                  /* Name of device e.g. /dev/dsk/hda1 */
  3147. +   char *mnt_dirname;                  /* Name of directory mounted on */
  3148. +   unsigned int mnt_flags;             /* Flags of this device see above */
  3149. +   struct semaphore mnt_sem;           /* lock device while I/O in progress */
  3150. +   struct super_block *mnt_sb;         /* pointer to superblock */
  3151. +   struct file *mnt_quotas[MAXQUOTAS]; /* fp's to quotafiles */
  3152. +   time_t mnt_iexp[MAXQUOTAS];         /* expiretime for inodes */
  3153. +   time_t mnt_bexp[MAXQUOTAS];         /* expiretime for blocks */
  3154. +   struct vfsmount *mnt_next;          /* pointer to next in linkedlist */
  3155. +};
  3156. +
  3157. +struct vfsmount *lookup_vfsmnt(dev_t dev);
  3158. +
  3159. +#endif /* _LINUX_MOUNT_H */
  3160. diff -u --recursive --new-file linux-1.1.55/include/linux/quota.h linux/include/linux/quota.h
  3161. --- linux-1.1.55/include/linux/quota.h    Wed Dec 31 18:00:00 1969
  3162. +++ linux/include/linux/quota.h    Thu Oct 20 17:01:18 1994
  3163. @@ -0,0 +1,208 @@
  3164. +/*
  3165. + * Copyright (c) 1982, 1986 Regents of the University of California.
  3166. + * All rights reserved.
  3167. + *
  3168. + * This code is derived from software contributed to Berkeley by
  3169. + * Robert Elz at The University of Melbourne.
  3170. + *
  3171. + * Redistribution and use in source and binary forms, with or without
  3172. + * modification, are permitted provided that the following conditions
  3173. + * are met:
  3174. + * 1. Redistributions of source code must retain the above copyright
  3175. + *    notice, this list of conditions and the following disclaimer.
  3176. + * 2. Redistributions in binary form must reproduce the above copyright
  3177. + *    notice, this list of conditions and the following disclaimer in the
  3178. + *    documentation and/or other materials provided with the distribution.
  3179. + * 3. All advertising materials mentioning features or use of this software
  3180. + *    must display the following acknowledgement:
  3181. + *   This product includes software developed by the University of
  3182. + *   California, Berkeley and its contributors.
  3183. + * 4. Neither the name of the University nor the names of its contributors
  3184. + *    may be used to endorse or promote products derived from this software
  3185. + *    without specific prior written permission.
  3186. + *
  3187. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  3188. + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  3189. + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  3190. + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  3191. + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  3192. + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  3193. + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  3194. + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  3195. + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  3196. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  3197. + * SUCH DAMAGE.
  3198. + *
  3199. + * Version: $Id: quota.h,v 1.5 1994/01/06 20:45:20 mvw Exp mvw $
  3200. + */
  3201. +
  3202. +#ifndef _LINUX_QUOTA_
  3203. +#define _LINUX_QUOTA_
  3204. +
  3205. +#include <linux/errno.h>
  3206. +
  3207. +/*
  3208. + * Convert diskblocks to blocks and the other way around.
  3209. + * currently only to fool the BSD source. :-)
  3210. + */
  3211. +#define dbtob(num) (num << 10)
  3212. +#define btodb(num) (num >> 10)
  3213. +
  3214. +/*
  3215. + * Definitions for disk quotas imposed on the average user
  3216. + * (big brother finally hits Linux).
  3217. + *
  3218. + * The following constants define the amount of time given a user
  3219. + * before the soft limits are treated as hard limits (usually resulting
  3220. + * in an allocation failure). The timer is started when the user crosses
  3221. + * their soft limit, it is reset when they go below their soft limit.
  3222. + */
  3223. +#define MAX_IQ_TIME  604800    /* (7*24*60*60) 1 week */
  3224. +#define MAX_DQ_TIME  604800    /* (7*24*60*60) 1 week */
  3225. +
  3226. +#define MAXQUOTAS 2
  3227. +#define USRQUOTA  0        /* element used for user quotas */
  3228. +#define GRPQUOTA  1        /* element used for group quotas */
  3229. +
  3230. +/*
  3231. + * Definitions for the default names of the quotas files.
  3232. + */
  3233. +#define INITQFNAMES { \
  3234. +   "user",      /* USRQUOTA */ \
  3235. +   "group",   /* GRPQUOTA */ \
  3236. +   "undefined", \
  3237. +};
  3238. +
  3239. +#define QUOTAFILENAME "quota"
  3240. +#define QUOTAGROUP "staff"
  3241. +
  3242. +#define NR_DQHASH 43            /* Just an arbitrary number any suggestions ? */
  3243. +#define NR_DQUOTS 256           /* Number of quotas active at one time */
  3244. +
  3245. +/*
  3246. + * Command definitions for the 'quotactl' system call.
  3247. + * The commands are broken into a main command defined below
  3248. + * and a subcommand that is used to convey the type of
  3249. + * quota that is being manipulated (see above).
  3250. + */
  3251. +#define SUBCMDMASK  0x00ff
  3252. +#define SUBCMDSHIFT 8
  3253. +#define QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
  3254. +
  3255. +#define Q_QUOTAON  0x0100    /* enable quotas */
  3256. +#define Q_QUOTAOFF 0x0200    /* disable quotas */
  3257. +#define Q_GETQUOTA 0x0300    /* get limits and usage */
  3258. +#define Q_SETQUOTA 0x0400    /* set limits and usage */
  3259. +#define Q_SETUSE   0x0500    /* set usage */
  3260. +#define Q_SYNC     0x0600    /* sync disk copy of a filesystems quotas */
  3261. +#define Q_SETQLIM  0x0700    /* set limits */
  3262. +
  3263. +/*
  3264. + * The following structure defines the format of the disk quota file
  3265. + * (as it appears on disk) - the file is an array of these structures
  3266. + * indexed by user or group number.
  3267. + */
  3268. +struct dqblk
  3269. +  {
  3270. +    u_long dqb_bhardlimit;    /* absolute limit on disk blks alloc */
  3271. +    u_long dqb_bsoftlimit;    /* preferred limit on disk blks */
  3272. +    u_long dqb_curblocks;    /* current block count */
  3273. +    u_long dqb_ihardlimit;    /* maximum # allocated inodes */
  3274. +    u_long dqb_isoftlimit;    /* preferred inode limit */
  3275. +    u_long dqb_curinodes;    /* current # allocated inodes */
  3276. +    time_t dqb_btime;        /* time limit for excessive disk use */
  3277. +    time_t dqb_itime;        /* time limit for excessive files */
  3278. +  };
  3279. +
  3280. +/*
  3281. + * Shorthand notation.
  3282. + */
  3283. +#define    dq_bhardlimit    dq_dqb.dqb_bhardlimit
  3284. +#define    dq_bsoftlimit    dq_dqb.dqb_bsoftlimit
  3285. +#define    dq_curblocks    dq_dqb.dqb_curblocks
  3286. +#define    dq_ihardlimit    dq_dqb.dqb_ihardlimit
  3287. +#define    dq_isoftlimit    dq_dqb.dqb_isoftlimit
  3288. +#define    dq_curinodes    dq_dqb.dqb_curinodes
  3289. +#define    dq_btime    dq_dqb.dqb_btime
  3290. +#define    dq_itime    dq_dqb.dqb_itime
  3291. +
  3292. +#define dqoff(UID)      ((off_t)((UID) * sizeof (struct dqblk)))
  3293. +
  3294. +#ifdef __KERNEL__
  3295. +
  3296. +/*
  3297. + * Maximum lenght of a message generated in the quota system,
  3298. + * that needs to be kicked onto the tty.
  3299. + */
  3300. +#define MAX_QUOTA_MESSAGE 75
  3301. +
  3302. +#define DQ_LOCKED     0x01    /* locked for update */
  3303. +#define DQ_WANT       0x02    /* wanted for update */
  3304. +#define DQ_MOD        0x04    /* dquot modified since read */
  3305. +#define DQ_BLKS       0x10    /* uid/gid has been warned about blk limit */
  3306. +#define DQ_INODES     0x20    /* uid/gid has been warned about inode limit */
  3307. +#define DQ_FAKE       0x40    /* no limits only usage */
  3308. +
  3309. +struct dquot
  3310. +{
  3311. +   unsigned int dq_id;        /* id this applies to (uid, gid) */
  3312. +   short dq_type;        /* type of quota */
  3313. +   dev_t dq_dev;                /* Device this applies to */
  3314. +   short dq_flags;        /* see DQ_* */
  3315. +   short dq_count;        /* reference count */
  3316. +   struct vfsmount *dq_mnt;     /* vfsmountpoint this applies to */
  3317. +   struct dqblk dq_dqb;         /* diskquota usage */
  3318. +   struct wait_queue *dq_wait;    /* pointer to waitqueue */
  3319. +   struct dquot *dq_prev;    /* pointer to prev dquot */
  3320. +   struct dquot *dq_next;    /* pointer to next dquot */
  3321. +   struct dquot *dq_hash_prev;    /* pointer to prev dquot */
  3322. +   struct dquot *dq_hash_next;    /* pointer to next dquot */
  3323. +};
  3324. +
  3325. +#define NODQUOT (struct dquot *)NULL
  3326. +
  3327. +/*
  3328. + * Flags used for set_dqblk.
  3329. + */
  3330. +#define QUOTA_SYSCALL     0x01
  3331. +#define SET_QUOTA         0x02
  3332. +#define SET_USE           0x04
  3333. +#define SET_QLIMIT        0x08
  3334. +
  3335. +/*
  3336. + * Return values when requesting quota.
  3337. + */
  3338. +#define NO_QUOTA 0        /* no more quota available */
  3339. +#define QUOTA_OK 1        /* can allocate the space */
  3340. +
  3341. +/*
  3342. + * declaration of quota_function calls in kernel.
  3343. + */
  3344. +struct dquot *dqget (dev_t dev, unsigned int id, short type);
  3345. +void dqput (struct dquot *dquot);
  3346. +
  3347. +int quota_off (dev_t dev, short type);
  3348. +int sync_dquots (dev_t dev, short type);
  3349. +
  3350. +u_long isize_to_blocks (size_t isize, size_t blksize);
  3351. +size_t blocks_to_isize (u_long blocks, size_t blksize);
  3352. +
  3353. +void quota_remove (struct inode *inode, u_long inodes, u_long blocks);
  3354. +int quota_alloc (struct inode *inode, u_long wantedinodes,
  3355. +                 u_long wantedblocks, u_long * availblocks);
  3356. +int quota_transfer (struct inode *inode, uid_t newuid,
  3357. +                    gid_t newgid, u_long inodes, u_long blocks);
  3358. +
  3359. +void getinoquota (struct inode *inode, short type);
  3360. +void putinoquota (struct inode *inode);
  3361. +
  3362. +#else
  3363. +
  3364. +#include <sys/cdefs.h>
  3365. +
  3366. +__BEGIN_DECLS
  3367. +int quotactl __P ((int, const char *, int, caddr_t));
  3368. +__END_DECLS
  3369. +
  3370. +#endif /* __KERNEL__ */
  3371. +#endif /* _QUOTA_ */
  3372. diff -u --recursive --new-file linux-1.1.55/include/linux/sched.h linux/include/linux/sched.h
  3373. --- linux-1.1.55/include/linux/sched.h    Sat Sep 17 21:50:01 1994
  3374. +++ linux/include/linux/sched.h    Thu Oct 20 17:01:18 1994
  3375. @@ -280,6 +280,7 @@
  3376.      long utime, stime, cutime, cstime, start_time;
  3377.      struct rlimit rlim[RLIM_NLIMITS]; 
  3378.      unsigned short used_math;
  3379. +    unsigned long io_usage; /* number of bytes read/written */
  3380.      char comm[16];
  3381.  /* virtual 86 mode stuff */
  3382.      struct vm86_struct * vm86_info;
  3383. @@ -310,6 +311,10 @@
  3384.                      /* Not implemented yet, only for 486*/
  3385.  #define PF_PTRACED    0x00000010    /* set if ptrace (0) has been called. */
  3386.  #define PF_TRACESYS    0x00000020    /* tracing system calls */
  3387. +#define PF_FORKNOEXEC    0x00000040    /* forked but didn't exec */
  3388. +#define PF_SUPERPREV    0x00000100    /* used super-user privileges */
  3389. +#define PF_DUMPCORE    0x00000200    /* dumped core */
  3390. +#define PF_SIGNALED    0x00000400    /* killed by a signal */
  3391.  
  3392.  /*
  3393.   * cloning flags:
  3394. @@ -340,6 +345,7 @@
  3395.            {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX},  \
  3396.            {       0, LONG_MAX}, {LONG_MAX, LONG_MAX}}, \
  3397.  /* math */    0, \
  3398. +/* io_usage */  0, \
  3399.  /* comm */    "swapper", \
  3400.  /* vm86_info */    NULL, 0, 0, 0, 0, \
  3401.  /* fs info */    0,NULL, \
  3402. @@ -449,6 +455,29 @@
  3403.  
  3404.  #define set_base(ldt,base) _set_base( ((char *)&(ldt)) , base )
  3405.  #define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 )
  3406. +
  3407. +/*
  3408. + * This has now become a routine instead of a macro, it sets a flag if
  3409. + * it returns true (to do BSD-style accounting where the process is flagged
  3410. + * if it uses root privs). The implication of this is that you should do
  3411. + * normal permissions checks first, and check suser() last.
  3412. + *
  3413. + * "suser()" checks against the effective user id, while "fsuser()"
  3414. + * is used for file permission checking and checks against the fsuid..
  3415. + */
  3416. +extern inline int suser(void)
  3417. +{
  3418. +    if (current->euid == 0)
  3419. +        current->flags |= PF_SUPERPREV;
  3420. +    return (current->euid == 0);
  3421. +}
  3422. +
  3423. +extern inline int fsuser(void)
  3424. +{
  3425. +    if (current->fsuid == 0)
  3426. +        current->flags |= PF_SUPERPREV;
  3427. +    return (current->fsuid == 0);
  3428. +}
  3429.  
  3430.  /*
  3431.   * The wait-queues are circular lists, and you have to be *very* sure
  3432. diff -u --recursive --new-file linux-1.1.55/include/linux/sys.h linux/include/linux/sys.h
  3433. --- linux-1.1.55/include/linux/sys.h    Sat Sep 17 21:40:01 1994
  3434. +++ linux/include/linux/sys.h    Thu Oct 20 17:01:18 1994
  3435. @@ -32,6 +32,5 @@
  3436.   * These are system calls that haven't been implemented yet
  3437.   * but have an entry in the table for future expansion..
  3438.   */
  3439. -#define _sys_quotactl    _sys_ni_syscall
  3440.  
  3441.  #endif
  3442. diff -u --recursive --new-file linux-1.1.55/include/linux/tty.h linux/include/linux/tty.h
  3443. --- linux-1.1.55/include/linux/tty.h    Thu Oct 20 15:14:28 1994
  3444. +++ linux/include/linux/tty.h    Thu Oct 20 17:01:18 1994
  3445. @@ -292,6 +292,7 @@
  3446.  extern int tty_unregister_driver(struct tty_driver *driver);
  3447.  extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
  3448.                   int buflen);
  3449. +extern void tty_write_message(struct tty_struct *tty, char *msg);
  3450.  
  3451.  extern int is_orphaned_pgrp(int pgrp);
  3452.  extern int is_ignored(int sig);
  3453. diff -u --recursive --new-file linux-1.1.55/init/main.c linux/init/main.c
  3454. --- linux-1.1.55/init/main.c    Sat Sep 17 21:50:25 1994
  3455. +++ linux/init/main.c    Thu Oct 20 17:01:18 1994
  3456. @@ -103,6 +103,9 @@
  3457.  #ifdef CONFIG_SYSVIPC
  3458.  extern void ipc_init(void);
  3459.  #endif
  3460. +#ifdef CONFIG_QUOTA
  3461. +extern void quota_init(void);
  3462. +#endif
  3463.  #ifdef CONFIG_SCSI
  3464.  extern unsigned long scsi_dev_init(unsigned long, unsigned long);
  3465.  #endif
  3466. @@ -457,6 +460,9 @@
  3467.      sock_init();
  3468.  #ifdef CONFIG_SYSVIPC
  3469.      ipc_init();
  3470. +#endif
  3471. +#ifdef CONFIG_QUOTA
  3472. +    quota_init();
  3473.  #endif
  3474.      sti();
  3475.      
  3476. diff -u --recursive --new-file linux-1.1.55/kernel/exit.c linux/kernel/exit.c
  3477. --- linux-1.1.55/kernel/exit.c    Sat Sep 17 21:48:05 1994
  3478. +++ linux/kernel/exit.c    Thu Oct 20 17:01:18 1994
  3479. @@ -19,6 +19,7 @@
  3480.  #include <asm/segment.h>
  3481.  extern void shm_exit (void);
  3482.  extern void sem_exit (void);
  3483. +extern void acct_process (void);
  3484.  
  3485.  int getrusage(struct task_struct *, int, struct rusage *);
  3486.  
  3487. @@ -411,6 +412,7 @@
  3488.          intr_count = 0;
  3489.      }
  3490.  fake_volatile:
  3491. +    acct_process();
  3492.      if (current->semun)
  3493.          sem_exit();
  3494.      if (current->shm)
  3495. diff -u --recursive --new-file linux-1.1.55/kernel/fork.c linux/kernel/fork.c
  3496. --- linux-1.1.55/kernel/fork.c    Sat Sep 17 21:46:36 1994
  3497. +++ linux/kernel/fork.c    Thu Oct 20 17:01:18 1994
  3498. @@ -2,9 +2,7 @@
  3499.   *  linux/kernel/fork.c
  3500.   *
  3501.   *  Copyright (C) 1991, 1992  Linus Torvalds
  3502. - */
  3503. -
  3504. -/*
  3505. + *
  3506.   *  'fork.c' contains the help-routines for the 'fork' system call
  3507.   * (see also system_call.s).
  3508.   * Fork is rather simple, once you get the hang of it, but the memory
  3509. @@ -21,6 +19,7 @@
  3510.  #include <linux/ptrace.h>
  3511.  #include <linux/malloc.h>
  3512.  #include <linux/ldt.h>
  3513. +#include <linux/fileio.h>
  3514.  
  3515.  #include <asm/segment.h>
  3516.  #include <asm/system.h>
  3517. @@ -84,6 +83,7 @@
  3518.                  new_file->f_count = 0;
  3519.                  new_file = NULL;
  3520.              }
  3521. +            vfs_open(new_file);
  3522.          }
  3523.      }
  3524.      return new_file;
  3525. @@ -124,8 +124,10 @@
  3526.                  p->files->fd[i] = copy_fd(f);
  3527.      } else {
  3528.          for (i=0; i<NR_OPEN;i++)
  3529. -            if ((f = p->files->fd[i]) != NULL)
  3530. +            if ((f = p->files->fd[i]) != NULL) {
  3531.                  f->f_count++;
  3532. +                vfs_open(f);
  3533. +            }
  3534.      }
  3535.  }
  3536.  
  3537. @@ -188,7 +190,9 @@
  3538.      p->did_exec = 0;
  3539.      p->kernel_stack_page = 0;
  3540.      p->state = TASK_UNINTERRUPTIBLE;
  3541. -    p->flags &= ~(PF_PTRACED|PF_TRACESYS);
  3542. +    p->flags &= ~(PF_PTRACED|PF_TRACESYS|PF_SUPERPREV);
  3543. +    p->flags |= PF_FORKNOEXEC;
  3544. +    p->io_usage = 0; /* Child doesn't inherit parent's I/O usage */
  3545.      p->pid = last_pid;
  3546.      p->p_pptr = p->p_opptr = current;
  3547.      p->p_cptr = NULL;
  3548. diff -u --recursive --new-file linux-1.1.55/kernel/printk.c linux/kernel/printk.c
  3549. --- linux-1.1.55/kernel/printk.c    Sat Sep 17 21:47:42 1994
  3550. +++ linux/kernel/printk.c    Thu Oct 20 17:01:18 1994
  3551. @@ -19,6 +19,8 @@
  3552.  #include <linux/errno.h>
  3553.  #include <linux/sched.h>
  3554.  #include <linux/kernel.h>
  3555. +#include <linux/tty.h>
  3556. +#include <linux/tty_driver.h>
  3557.  
  3558.  #define LOG_BUF_LEN    4096
  3559.  
  3560. @@ -226,4 +228,17 @@
  3561.              msg_level = -1;
  3562.          j = 0;
  3563.      }
  3564. +}
  3565. +
  3566. +/*
  3567. + * Write a message to a certain tty, not just the console. This is used for
  3568. + * messages that need to be redirected to a specific tty.
  3569. + * We don't put it into the syslog queue right now maybe in the future if
  3570. + * really needed.
  3571. + */
  3572. +void tty_write_message(struct tty_struct *tty, char *msg)
  3573. +{
  3574. +    if (tty && tty->driver.write)
  3575. +        tty->driver.write(tty, 0, msg, strlen(msg));
  3576. +    return;
  3577.  }
  3578. diff -u --recursive --new-file linux-1.1.55/kernel/sys.c linux/kernel/sys.c
  3579. --- linux-1.1.55/kernel/sys.c    Thu Oct 13 21:31:09 1994
  3580. +++ linux/kernel/sys.c    Thu Oct 20 17:01:18 1994
  3581. @@ -17,6 +17,10 @@
  3582.  #include <linux/ptrace.h>
  3583.  #include <linux/stat.h>
  3584.  #include <linux/mman.h>
  3585. +#include <linux/tty.h>
  3586. +#include <linux/fcntl.h>
  3587. +#include <linux/acct.h>
  3588. +#include <linux/fileio.h>
  3589.  
  3590.  #include <asm/segment.h>
  3591.  #include <asm/io.h>
  3592. @@ -251,9 +255,128 @@
  3593.      return 0;
  3594.  }
  3595.  
  3596. -asmlinkage int sys_acct(void)
  3597. +static char acct_active = 0;
  3598. +static struct file *acct_file;
  3599. +#define    KSTK_ESP(stack)    (((unsigned long *) stack)[1022])
  3600. +
  3601. +int acct_process(void)
  3602. +{
  3603. +    struct acct ac;
  3604. +    unsigned short fs;
  3605. +    unsigned long vsize, esp;
  3606. +
  3607. +    if (acct_active) {
  3608. +        memset(&ac, 0, sizeof(struct acct));
  3609. +        strncpy(ac.ac_comm, current->comm, ACCT_COMM);
  3610. +        ac.ac_comm[ACCT_COMM] = '\0';
  3611. +        ac.ac_utime = current->utime;
  3612. +        ac.ac_stime = current->stime;
  3613. +        ac.ac_btime = CT_TO_SECS(current->start_time) + (xtime.tv_sec - (jiffies / HZ));
  3614. +        ac.ac_etime = CURRENT_TIME - ac.ac_btime;
  3615. +        ac.ac_uid   = current->uid;
  3616. +        ac.ac_gid   = current->gid;
  3617. +        ac.ac_tty   = (current->tty) ? MKDEV(4, current->tty->device) : MKDEV(4, -1);
  3618. +        ac.ac_flag  = 0;
  3619. +        if (current->flags & PF_FORKNOEXEC)
  3620. +            ac.ac_flag |= AFORK;
  3621. +        if (current->flags & PF_SUPERPREV)
  3622. +            ac.ac_flag |= ASU;
  3623. +        if (current->flags & PF_DUMPCORE)
  3624. +            ac.ac_flag |= ACORE;
  3625. +        if (current->flags & PF_SIGNALED)
  3626. +            ac.ac_flag |= AXSIG;
  3627. +        ac.ac_io    = current->io_usage;
  3628. +
  3629. +        /* Figure out the vsize of the current process and divide by the
  3630. +         * page size to calculate AC_MEM.  This is the approved method
  3631. +         * from the proc filesystem.
  3632. +         */
  3633. +        vsize = current->kernel_stack_page;
  3634. +        if (vsize) {
  3635. +            esp = KSTK_ESP(vsize);
  3636. +            vsize = current->mm->brk - current->mm->start_code + (PAGE_SIZE - 1);
  3637. +            if (esp)
  3638. +                vsize += TASK_SIZE - esp;
  3639. +        }
  3640. +        /* now vsize contains the number of bytes used -- we want to
  3641. +         * find out the number of pages, so divide it by the page size
  3642. +         * and round up.
  3643. +         */
  3644. +        ac.ac_mem = (vsize / PAGE_SIZE) + ((vsize % PAGE_SIZE) != 0);
  3645. +
  3646. +        /* Kernel segment override */
  3647. +        fs = get_fs();
  3648. +        set_fs(KERNEL_DS);
  3649. +
  3650. +        acct_file->f_op->write(acct_file->f_inode, acct_file,
  3651. +                      (char *)&ac, sizeof(struct acct));
  3652. +
  3653. +        set_fs(fs);
  3654. +    }
  3655. +    return 0;
  3656. +}
  3657. +
  3658. +extern void close_fp(struct file *, int);
  3659. +
  3660. +asmlinkage int sys_acct(const char *name)
  3661.  {
  3662. -    return -ENOSYS;
  3663. +    struct inode *inode = (struct inode *)0;
  3664. +    char *tmp;
  3665. +    int error;
  3666. +
  3667. +    if (!suser())
  3668. +        return -EPERM;
  3669. +
  3670. +    if (name == (char *)0) {
  3671. +        if (acct_active) {
  3672. +            acct_process(); 
  3673. +            acct_active = 0;
  3674. +            close_fp(acct_file, 0);
  3675. +        }
  3676. +        return 0;
  3677. +    } else {
  3678. +        if (!acct_active) {
  3679. +            if ((error = getname(name, &tmp)) != 0)
  3680. +                return (error);
  3681. +            error = open_namei(tmp, O_RDWR, 0600, &inode, 0);
  3682. +            putname(tmp);
  3683. +            if (error)
  3684. +                return (error);
  3685. +            if (!S_ISREG(inode->i_mode)) {
  3686. +                iput(inode);
  3687. +                return -EACCES;
  3688. +            }
  3689. +            if (!inode->i_op || !inode->i_op->default_file_ops || 
  3690. +                !inode->i_op->default_file_ops->write) {
  3691. +                iput(inode);
  3692. +                return -EIO;
  3693. +            }
  3694. +            if ((acct_file = get_empty_filp()) == (struct file *)0)
  3695. +                return -EUSERS;
  3696. +            acct_file->f_mode = (O_WRONLY + 1) & O_ACCMODE;
  3697. +            acct_file->f_flags = O_WRONLY;
  3698. +            acct_file->f_inode = inode;
  3699. +            acct_file->f_pos = inode->i_size;
  3700. +            acct_file->f_reada = 0;
  3701. +            acct_file->f_op = inode->i_op->default_file_ops;
  3702. +            if (acct_file->f_op->open)
  3703. +                if (acct_file->f_op->open(acct_file->f_inode, acct_file)) {
  3704. +                    iput(inode);
  3705. +                    return -EIO;
  3706. +                }
  3707. +
  3708. +            vfs_open(acct_file);
  3709. +            acct_active = 1;
  3710. +            return 0;
  3711. +        } else
  3712. +            return -EBUSY;
  3713. +    }
  3714. +}
  3715. +
  3716. +void acct_auto_close(dev_t dev)
  3717. +{
  3718. +    if (acct_active && acct_file && acct_file->f_inode->i_dev == dev)
  3719. +        sys_acct((char *)0);
  3720.  }
  3721.  
  3722.  asmlinkage int sys_phys(void)
  3723.