Annotation of dmsdos/patches/cvf.diff-2.0.33, revision 1.1.1.1

1.1       root        1: diff -u -r -N linux-2.0.33-cyrix-patched/Documentation/filesystems/fat_cvf.txt linux-2.0.33-cyrix-patched-test/Documentation/filesystems/fat_cvf.txt
                      2: --- linux-2.0.33-cyrix-patched/Documentation/filesystems/fat_cvf.txt   Thu Jan  1 01:00:00 1970
                      3: +++ linux-2.0.33-cyrix-patched-test/Documentation/filesystems/fat_cvf.txt      Wed Nov 18 20:40:50 1998
                      4: @@ -0,0 +1,210 @@
                      5: +This is the main documentation for the CVF-FAT filesystem extension.  18Nov1998
                      6: +
                      7: +
                      8: +Table of Contents:
                      9: +
                     10: +1. The idea of CVF-FAT
                     11: +2. Restrictions
                     12: +3. Mount options
                     13: +4. Description of the CVF-FAT interface
                     14: +5. CVF Modules
                     15: +
                     16: +------------------------------------------------------------------------------
                     17: +
                     18: +
                     19: +1. The idea of CVF-FAT
                     20: +------------------------------------------------------------------------------
                     21: +
                     22: +CVF-FAT is a FAT filesystem extension that provides a generic interface for
                     23: +Compressed Volume Files in FAT partitions. Popular CVF software, for
                     24: +example, are Microsoft's Doublespace/Drivespace and Stac's Stacker.
                     25: +Using the CVF-FAT interface, it is possible to load a module that handles
                     26: +all the low-level disk access that has to do with on-the-fly compression
                     27: +and decompression. Any other part of FAT filesystem access is still handled
                     28: +by the FAT, MSDOS or VFAT or even UMSDOS driver.
                     29: +
                     30: +CVF access works by redirecting certain low-level routines from the FAT
                     31: +driver to a loadable, CVF-format specific module. This module must fake
                     32: +a normal FAT filesystem to the FAT driver while doing all the extra stuff
                     33: +like compression and decompression silently.
                     34: +
                     35: +
                     36: +2. Restrictions
                     37: +------------------------------------------------------------------------------
                     38: +
                     39: +- BMAP problems
                     40: +
                     41: +  CVF filesystems cannot do bmap. It's impossible in principle. Thus
                     42: +  all actions that require bmap do not work (swapping, writable mmapping).
                     43: +  Read-only mmapping works because the FAT driver has a hack for this
                     44: +  situation :) Well, writable mmapping should now work using the readpage
                     45: +  interface function which has been hacked into the FAT driver just for 
                     46: +  CVF-FAT :)
                     47: +  
                     48: +- attention, DOSEmu users 
                     49: +
                     50: +  You may have to unmount all CVF partitions before running DOSEmu depending 
                     51: +  on your configuration. If DOSEmu is configured to use wholedisk or 
                     52: +  partition access (this is often the case to let DOSEmu access 
                     53: +  compressed partitions) there's a risk of destroying your compressed 
                     54: +  partitions or crashing your system because of confused drivers.
                     55: +  
                     56: +  Note that it is always safe to redirect the compressed partitions with 
                     57: +  lredir or emufs.sys. Refer to the DOSEmu documentation for details.
                     58: +
                     59: +
                     60: +3. Mount options
                     61: +------------------------------------------------------------------------------
                     62: +
                     63: +The CVF-FAT extension currently adds the following options to the FAT
                     64: +driver's standard options:
                     65: +
                     66: +  cvf_format=xxx
                     67: +    Forces the driver to use the CVF module "xxx" instead of auto-detection.
                     68: +    Without this option, the CVF-FAT interface asks all currently loaded
                     69: +    CVF modules whether they recognize the CVF. Therefore, this option is
                     70: +    only necessary if the CVF format is not recognized correctly
                     71: +    because of bugs or incompatibilities in the CVF modules. (It skips
                     72: +    the detect_cvf call.) "xxx" may be the text "none" (without the quotes)
                     73: +    to inhibit using any of the loaded CVF modules, just in case a CVF
                     74: +    module insists on mounting plain FAT filesystems by misunderstanding.
                     75: +    "xxx" may also be the text "autoload", which has a special meaning for
                     76: +    kerneld, but does not skip auto-detection.
                     77: +
                     78: +    If the kernel supports kerneld, the cvf_format=xxx option also controls
                     79: +    on-demand CVF module loading. Without this option, nothing is loaded
                     80: +    on demand. With cvf_format=xxx, a module "xxx" is requested automatically
                     81: +    before mounting the compressed filesystem (unless "xxx" is "none"). In 
                     82: +    case there is a difference between the CVF format name and the module 
                     83: +    name, setup aliases in your kerneld configuration. If the string "xxx" 
                     84: +    is "autoload", a non-existent module "cvf_autoload" is requested which 
                     85: +    can be used together with a special kerneld configuration (alias and 
                     86: +    pre-install statements) in order to load more than one CVF module, let 
                     87: +    them detect automatically which kind of CVF is to be mounted, and only 
                     88: +    keep the "right" module in memory. For examples please refer to the 
                     89: +    dmsdos documentation (ftp and http addresses see below).
                     90: +
                     91: +  cvf_options=yyy
                     92: +    Option string passed to the CVF module. I.e. only the "yyy" is passed
                     93: +    (without the quotes). The documentation for each CVF module should 
                     94: +    explain it since it is interpreted only by the CVF module. Note that 
                     95: +    the string must not contain a comma (",") - this would lead to 
                     96: +    misinterpretation by the FAT driver, which would recognize the text 
                     97: +    after a comma as a FAT driver option and might get confused or print 
                     98: +    strange error messages. The documentation for the CVF module should 
                     99: +    offer a different separation symbol, for example the dot "." or the
                    100: +    plus sign "+", which is only valid inside the string "yyy".
                    101: +
                    102: +
                    103: +4. Description of the CVF-FAT interface
                    104: +------------------------------------------------------------------------------
                    105: +
                    106: +Assuming you want to write your own CVF module, you need to write a lot of
                    107: +interface functions. Most of them are covered in the kernel documentation
                    108: +you can find on the net, and thus won't be described here. They have been
                    109: +marked with "[...]" :-) Take a look at include/linux/fat_cvf.h.
                    110: +
                    111: +struct cvf_format
                    112: +{ int cvf_version;
                    113: +  char* cvf_version_text;
                    114: +  unsigned long int flags;
                    115: +  int (*detect_cvf) (struct super_block*sb);
                    116: +  int (*mount_cvf) (struct super_block*sb,char*options);
                    117: +  int (*unmount_cvf) (struct super_block*sb);
                    118: +  [...]
                    119: +  void (*cvf_zero_cluster) (struct inode*inode,int clusternr);
                    120: +}
                    121: +
                    122: +This structure defines the capabilities of a CVF module. It must be filled
                    123: +out completely by a CVF module. Consider it as a kind of form that is used
                    124: +to introduce the module to the FAT/CVF-FAT driver.
                    125: +
                    126: +It contains...
                    127: +  - cvf_version:
                    128: +      A version id which must be unique. Choose one.
                    129: +  - cvf_version_text:
                    130: +      A human readable version string that should be one short word 
                    131: +      describing the CVF format the module implements. This text is used
                    132: +      for the cvf_format option. This name must also be unique.
                    133: +  - flags:
                    134: +      Bit coded flags, currently only used for a readpage/mmap hack that 
                    135: +      provides both mmap and readpage functionality. If CVF_USE_READPAGE
                    136: +      is set, mmap is set to generic_file_mmap and readpage is caught
                    137: +      and redirected to the cvf_readpage function. If it is not set,
                    138: +      readpage is set to generic_readpage and mmap is caught and redirected
                    139: +      to cvf_mmap. (If you want writable mmap use the readpage interface.)
                    140: +  - detect_cvf:
                    141: +      A function that is called to decide whether the filesystem is a CVF of
                    142: +      the type the module supports. The detect_cvf function must return 0
                    143: +      for "NO, I DON'T KNOW THIS GARBAGE" or anything >0 for "YES, THIS IS
                    144: +      THE KIND OF CVF I SUPPORT". The function must maintain the module
                    145: +      usage counters for safety, i.e. do MOD_INC_USE_COUNT at the beginning
                    146: +      and MOD_DEC_USE_COUNT at the end. The function *must not* assume that
                    147: +      successful recongition would lead to a call of the mount_cvf function
                    148: +      later. 
                    149: +  - mount_cvf:
                    150: +      A function that sets up some values or initializes something additional
                    151: +      to what has to be done when a CVF is mounted. This is called at the
                    152: +      end of fat_read_super and must return 0 on success. Definitely, this
                    153: +      function must increment the module usage counter by MOD_INC_USE_COUNT.
                    154: +      This mount_cvf function is also responsible for interpreting a CVF
                    155: +      module specific option string (the "yyy" from the FAT mount option
                    156: +      "cvf_options=yyy") which cannot contain a comma (use for example the
                    157: +      dot "." as option separator symbol).
                    158: +  - unmount_cvf:
                    159: +      A function that is called when the filesystem is unmounted. Most likely
                    160: +      it only frees up some memory and calls MOD_DEC_USE_COUNT. The return
                    161: +      value might be ignored (it currently is ignored).
                    162: +  - [...]:
                    163: +      All other interface functions are "caught" FAT driver functions, i.e.
                    164: +      are executed by the FAT driver *instead* of the original FAT driver
                    165: +      functions. NULL means use the original FAT driver functions instead.
                    166: +      If you really want "no action", write a function that does nothing and 
                    167: +      hang it in instead.
                    168: +  - cvf_zero_cluster:
                    169: +      The cvf_zero_cluster function is called when the fat driver wants to
                    170: +      zero out a (new) cluster. This is important for directories (mkdir).
                    171: +      If it is NULL, the FAT driver defaults to overwriting the whole
                    172: +      cluster with zeros. Note that clusternr is absolute, not relative
                    173: +      to the provided inode.
                    174: +
                    175: +Notes:
                    176: +  1. The cvf_bmap function should be ignored. It really should never
                    177: +     get called from somewhere. I recommend redirecting it to a panic
                    178: +     or fatal error message so bugs show up immediately.
                    179: +  2. The cvf_writepage function is ignored. This is because the fat
                    180: +     driver doesn't support it. This might change in future. I recommend
                    181: +     setting it to NULL (i.e use default).
                    182: +
                    183: +int register_cvf_format(struct cvf_format*cvf_format);
                    184: +  If you have just set up a variable containing the above structure,
                    185: +  call this function to introduce your CVF format to the FAT/CVF-FAT
                    186: +  driver. This is usually done in init_module. Be sure to check the
                    187: +  return value. Zero means success, everything else causes a kernel
                    188: +  message printed in the syslog describing the error that occurred.
                    189: +  Typical errors are:
                    190: +    - a module with the same version id is already registered or 
                    191: +    - too many CVF formats. Hack fs/fat/cvf.c if you need more.
                    192: +
                    193: +int unregister_cvf_format(struct cvf_format*cvf_format);
                    194: +  This is usually called in cleanup_module. Return value =0 means
                    195: +  success. An error only occurs if you try to unregister a CVF format
                    196: +  that has not been previously registered. The code uses the version id
                    197: +  to distinguish the modules, so be sure to keep it unique.
                    198: +
                    199: +5. CVF Modules
                    200: +------------------------------------------------------------------------------
                    201: +
                    202: +Refer to the dmsdos module (the successor of the dmsdos filesystem) for a
                    203: +sample implementation.  It can currently be found at
                    204: +
                    205: +  ftp://fb9nt.uni-duisburg.de/pub/linux/dmsdos/dmsdos-x.y.z.tgz
                    206: +  ftp://sunsite.unc.edu/pub/Linux/system/Filesystems/dosfs/dmsdos-x.y.z.tgz
                    207: +  ftp://ftp.uni-stuttgart.de/pub/systems/linux/local/system/dmsdos-x.y.z.tgz
                    208: +
                    209: +(where x.y.z is to be replaced with the actual version number). Full
                    210: +documentation about dmsdos is included in the dmsdos package, but can also
                    211: +be found at
                    212: +
                    213: +  http://fb9nt.uni-duisburg.de/mitarbeiter/gockel/software/dmsdos/index.html
                    214: +  http://www.yk.rim.or.jp/~takafumi/dmsdos/index.html (in Japanese).
                    215: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/Makefile linux-2.0.33-cyrix-patched-test/fs/fat/Makefile
                    216: --- linux-2.0.33-cyrix-patched/fs/fat/Makefile Wed Feb  7 08:39:27 1996
                    217: +++ linux-2.0.33-cyrix-patched-test/fs/fat/Makefile    Sat Dec 27 21:34:20 1997
                    218: @@ -8,7 +8,7 @@
                    219:  # Note 2! The CFLAGS definitions are now in the main makefile...
                    220:  
                    221:  O_TARGET := fat.o
                    222: -O_OBJS   := buffer.o cache.o dir.o file.o inode.o misc.o mmap.o tables.o
                    223: +O_OBJS   := buffer.o cache.o dir.o file.o inode.o misc.o mmap.o tables.o cvf.o
                    224:  OX_OBJS  := fatfs_syms.o
                    225:  M_OBJS   := $(O_TARGET)
                    226:  
                    227: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/buffer.c linux-2.0.33-cyrix-patched-test/fs/fat/buffer.c
                    228: --- linux-2.0.33-cyrix-patched/fs/fat/buffer.c Fri May 10 06:54:52 1996
                    229: +++ linux-2.0.33-cyrix-patched-test/fs/fat/buffer.c    Sat Dec 27 21:46:10 1997
                    230: @@ -9,6 +9,7 @@
                    231:  #include <linux/string.h>
                    232:  #include <linux/fs.h>
                    233:  #include <linux/msdos_fs.h>
                    234: +#include <linux/fat_cvf.h>
                    235:  
                    236:  struct buffer_head *fat_bread (
                    237:        struct super_block *sb,
                    238: @@ -16,6 +17,10 @@
                    239:  {
                    240:        struct buffer_head *ret = NULL;
                    241:  
                    242: +        if(MSDOS_SB(sb)->cvf_format)
                    243: +          if(MSDOS_SB(sb)->cvf_format->cvf_bread)
                    244: +            return MSDOS_SB(sb)->cvf_format->cvf_bread(sb,block);
                    245: +
                    246:        /* Note that the blocksize is 512 or 1024, but the first read
                    247:           is always of size 1024. Doing readahead may be counterproductive
                    248:           or just plain wrong. */
                    249: @@ -73,6 +78,11 @@
                    250:        int block)
                    251:  {
                    252:        struct buffer_head *ret = NULL;
                    253: +
                    254: +        if(MSDOS_SB(sb)->cvf_format)
                    255: +          if(MSDOS_SB(sb)->cvf_format->cvf_getblk)
                    256: +            return MSDOS_SB(sb)->cvf_format->cvf_getblk(sb,block);
                    257: + 
                    258:        if (sb->s_blocksize == 512){
                    259:                ret = getblk (sb->s_dev,block,512);
                    260:        }else{
                    261: @@ -92,6 +102,10 @@
                    262:        struct buffer_head *bh)
                    263:  {
                    264:        if (bh != NULL){
                    265: +              if(MSDOS_SB(sb)->cvf_format)
                    266: +                if(MSDOS_SB(sb)->cvf_format->cvf_brelse)
                    267: +                  return MSDOS_SB(sb)->cvf_format->cvf_brelse(sb,bh);
                    268: +
                    269:                if (sb->s_blocksize == 512){
                    270:                        brelse (bh);
                    271:                }else{
                    272: @@ -109,6 +123,12 @@
                    273:        struct buffer_head *bh,
                    274:        int dirty_val)
                    275:  {
                    276: +      if(MSDOS_SB(sb)->cvf_format)
                    277: +          if(MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty)
                    278: +          { MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty(sb,bh,dirty_val);
                    279: +            return;
                    280: +          }
                    281: + 
                    282:        if (sb->s_blocksize != 512){
                    283:                bh = bh->b_next;
                    284:        }
                    285: @@ -120,6 +140,12 @@
                    286:        struct buffer_head *bh,
                    287:        int val)
                    288:  {
                    289: +      if(MSDOS_SB(sb)->cvf_format)
                    290: +          if(MSDOS_SB(sb)->cvf_format->cvf_set_uptodate)
                    291: +          { MSDOS_SB(sb)->cvf_format->cvf_set_uptodate(sb,bh,val);
                    292: +            return;
                    293: +          }
                    294: + 
                    295:        if (sb->s_blocksize != 512){
                    296:                bh = bh->b_next;
                    297:        }
                    298: @@ -129,6 +155,10 @@
                    299:        struct super_block *sb,
                    300:        struct buffer_head *bh)
                    301:  {
                    302: +      if(MSDOS_SB(sb)->cvf_format)
                    303: +          if(MSDOS_SB(sb)->cvf_format->cvf_is_uptodate)
                    304: +            return MSDOS_SB(sb)->cvf_format->cvf_is_uptodate(sb,bh);
                    305: + 
                    306:        if (sb->s_blocksize != 512){
                    307:                bh = bh->b_next;
                    308:        }
                    309: @@ -141,6 +171,12 @@
                    310:        int nbreq,
                    311:        struct buffer_head *bh[32])
                    312:  {
                    313: +        if(MSDOS_SB(sb)->cvf_format)
                    314: +          if(MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block)
                    315: +          { MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block(sb,opr,nbreq,bh);
                    316: +            return;
                    317: +          }
                    318: + 
                    319:        if (sb->s_blocksize == 512){
                    320:                ll_rw_block(opr,nbreq,bh);
                    321:        }else{
                    322: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/cache.c linux-2.0.33-cyrix-patched-test/fs/fat/cache.c
                    323: --- linux-2.0.33-cyrix-patched/fs/fat/cache.c  Fri May 10 06:54:52 1996
                    324: +++ linux-2.0.33-cyrix-patched-test/fs/fat/cache.c     Sun Dec 28 12:16:08 1997
                    325: @@ -9,6 +9,7 @@
                    326:  #include <linux/errno.h>
                    327:  #include <linux/string.h>
                    328:  #include <linux/stat.h>
                    329: +#include <linux/fat_cvf.h>
                    330:  
                    331:  #include "msbuffer.h"
                    332:  
                    333: @@ -24,6 +25,10 @@
                    334:        unsigned char *p_first,*p_last;
                    335:        int first,last,next,copy,b;
                    336:  
                    337: +      if(MSDOS_SB(sb)->cvf_format)
                    338: +        if(MSDOS_SB(sb)->cvf_format->fat_access)
                    339: +          return MSDOS_SB(sb)->cvf_format->fat_access(sb,nr,new_value);
                    340: +
                    341:        if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters)
                    342:                return 0;
                    343:        if (MSDOS_SB(sb)->fat_bits == 16) {
                    344: @@ -246,6 +251,10 @@
                    345:        int cluster,offset;
                    346:  
                    347:        sb = MSDOS_SB(inode->i_sb);
                    348: +      if(sb->cvf_format)
                    349: +        if(sb->cvf_format->cvf_smap)
                    350: +          return sb->cvf_format->cvf_smap(inode,sector);
                    351: +          
                    352:        if (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) &&
                    353:            !MSDOS_I(inode)->i_start)) {
                    354:                if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) return 0;
                    355: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/cvf.c linux-2.0.33-cyrix-patched-test/fs/fat/cvf.c
                    356: --- linux-2.0.33-cyrix-patched/fs/fat/cvf.c    Thu Jan  1 01:00:00 1970
                    357: +++ linux-2.0.33-cyrix-patched-test/fs/fat/cvf.c       Tue Nov 17 20:10:41 1998
                    358: @@ -0,0 +1,147 @@
                    359: +/* 
                    360: + * CVF extensions for fat-based filesystems
                    361: + *
                    362: + * written 1997,1998 by Frank Gockel <[email protected]>
                    363: + *
                    364: + * please do not remove the next line, dmsdos needs it for verifying patches
                    365: + * CVF-FAT-VERSION-ID: 1.1.0
                    366: + *
                    367: + */
                    368: + 
                    369: +#include<linux/sched.h>
                    370: +#include<linux/fs.h>
                    371: +#include<linux/msdos_fs.h>
                    372: +#include<linux/msdos_fs_sb.h>
                    373: +#include<linux/string.h>
                    374: +#include<linux/fat_cvf.h>
                    375: +#include<linux/config.h>
                    376: +#ifdef CONFIG_KERNELD
                    377: +#include<linux/kerneld.h>
                    378: +#endif
                    379: +
                    380: +#define MAX_CVF_FORMATS 3
                    381: +
                    382: +struct cvf_format *cvf_formats[MAX_CVF_FORMATS]={NULL,NULL,NULL};
                    383: +int cvf_format_use_count[MAX_CVF_FORMATS]={0,0,0};
                    384: +
                    385: +int register_cvf_format(struct cvf_format*cvf_format)
                    386: +{ int i,j;
                    387: +
                    388: +  for(i=0;i<MAX_CVF_FORMATS;++i)
                    389: +  { if(cvf_formats[i]==NULL)
                    390: +    { /* free slot found, now check version */
                    391: +      for(j=0;j<MAX_CVF_FORMATS;++j)
                    392: +      { if(cvf_formats[j])
                    393: +        { if(cvf_formats[j]->cvf_version==cvf_format->cvf_version)
                    394: +          { printk("register_cvf_format: version %d already registered\n",
                    395: +                   cvf_format->cvf_version);
                    396: +            return -1;
                    397: +          }
                    398: +        }
                    399: +      }
                    400: +      cvf_formats[i]=cvf_format;
                    401: +      cvf_format_use_count[i]=0;
                    402: +      printk("CVF format %s (version id %d) successfully registered.\n",
                    403: +             cvf_format->cvf_version_text,cvf_format->cvf_version);
                    404: +      return 0;
                    405: +    }
                    406: +  }
                    407: +  
                    408: +  printk("register_cvf_format: too many formats\n");
                    409: +  return -1;
                    410: +}
                    411: +
                    412: +int unregister_cvf_format(struct cvf_format*cvf_format)
                    413: +{ int i;
                    414: +
                    415: +  for(i=0;i<MAX_CVF_FORMATS;++i)
                    416: +  { if(cvf_formats[i])
                    417: +    { if(cvf_formats[i]->cvf_version==cvf_format->cvf_version)
                    418: +      { if(cvf_format_use_count[i])
                    419: +        { printk("unregister_cvf_format: format %d in use, cannot remove!\n",
                    420: +          cvf_formats[i]->cvf_version);
                    421: +          return -1;
                    422: +        }
                    423: +      
                    424: +        printk("CVF format %s (version id %d) successfully unregistered.\n",
                    425: +        cvf_formats[i]->cvf_version_text,cvf_formats[i]->cvf_version);
                    426: +        cvf_formats[i]=NULL;
                    427: +        return 0;
                    428: +      }
                    429: +    }
                    430: +  }
                    431: +  
                    432: +  printk("unregister_cvf_format: format %d is not registered\n",
                    433: +         cvf_format->cvf_version);
                    434: +  return -1;
                    435: +}
                    436: +
                    437: +void dec_cvf_format_use_count_by_version(int version)
                    438: +{ int i;
                    439: +
                    440: +  for(i=0;i<MAX_CVF_FORMATS;++i)
                    441: +  { if(cvf_formats[i])
                    442: +    { if(cvf_formats[i]->cvf_version==version)
                    443: +      { --cvf_format_use_count[i];
                    444: +        if(cvf_format_use_count[i]<0)
                    445: +        { cvf_format_use_count[i]=0;
                    446: +          printk(KERN_EMERG "FAT FS/CVF: This is a bug in cvf_version_use_count\n");
                    447: +        }
                    448: +        return;
                    449: +      }
                    450: +    }
                    451: +  }
                    452: +  
                    453: +  printk("dec_cvf_format_use_count_by_version: version %d not found ???\n",
                    454: +         version);
                    455: +}
                    456: +
                    457: +int detect_cvf(struct super_block*sb,char*force)
                    458: +{ int i;
                    459: +  int found=0;
                    460: +  int found_i=-1;
                    461: +
                    462: +  if(force)
                    463: +    if(strcmp(force,"autoload")==0)
                    464: +    {
                    465: +#ifdef CONFIG_KERNELD
                    466: +      request_module("cvf_autoload");
                    467: +      force=NULL;
                    468: +#else
                    469: +      printk("cannot autoload CVF modules: kerneld support is not compiled into kernel\n");
                    470: +      return -1;
                    471: +#endif
                    472: +    }
                    473: +    
                    474: +#ifdef CONFIG_KERNELD
                    475: +  if(force)
                    476: +    if(*force)
                    477: +      request_module(force);
                    478: +#endif
                    479: +
                    480: +  if(force)
                    481: +  { if(*force)
                    482: +    { for(i=0;i<MAX_CVF_FORMATS;++i)
                    483: +      { if(cvf_formats[i])
                    484: +        { if(!strcmp(cvf_formats[i]->cvf_version_text,force))
                    485: +            return i;
                    486: +        }
                    487: +      }
                    488: +      printk("CVF format %s unknown (module not loaded?)\n",force);
                    489: +      return -1;
                    490: +    }
                    491: +  }
                    492: +
                    493: +  for(i=0;i<MAX_CVF_FORMATS;++i)
                    494: +  { if(cvf_formats[i])
                    495: +    { if(cvf_formats[i]->detect_cvf(sb))
                    496: +      { ++found;
                    497: +        found_i=i;
                    498: +      }
                    499: +    }
                    500: +  }
                    501: +  
                    502: +  if(found==1)return found_i;
                    503: +  if(found>1)printk("CVF detection ambiguous, please use cvf_format=xxx option\n"); 
                    504: +  return -1;
                    505: +}
                    506: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/dir.c linux-2.0.33-cyrix-patched-test/fs/fat/dir.c
                    507: --- linux-2.0.33-cyrix-patched/fs/fat/dir.c    Fri May 10 06:54:52 1996
                    508: +++ linux-2.0.33-cyrix-patched-test/fs/fat/dir.c       Sat Jan  3 12:41:00 1998
                    509: @@ -382,6 +382,7 @@
                    510:                  unsigned int cmd, unsigned long arg)
                    511:  {
                    512:        int err;
                    513: +      
                    514:        /*
                    515:         * We want to provide an interface for Samba to be able
                    516:         * to get the short filename for a given long filename.
                    517: @@ -408,6 +409,11 @@
                    518:                                    vfat_ioctl_fill, NULL, 1, 0, 1);
                    519:        }
                    520:        default:
                    521: +              /* forward ioctl to CVF extension */
                    522: +              if(MSDOS_SB(inode->i_sb)->cvf_format
                    523: +                 &&MSDOS_SB(inode->i_sb)->cvf_format->cvf_dir_ioctl)
                    524: +                   return MSDOS_SB(inode->i_sb)->cvf_format->
                    525: +                                     cvf_dir_ioctl(inode,filp,cmd,arg);
                    526:                return -EINVAL;
                    527:        }
                    528:  
                    529: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/fatfs_syms.c linux-2.0.33-cyrix-patched-test/fs/fat/fatfs_syms.c
                    530: --- linux-2.0.33-cyrix-patched/fs/fat/fatfs_syms.c     Tue Mar  5 12:03:26 1996
                    531: +++ linux-2.0.33-cyrix-patched-test/fs/fat/fatfs_syms.c        Sat Jan  3 10:41:33 1998
                    532: @@ -8,6 +8,7 @@
                    533:  
                    534:  #include <linux/mm.h>
                    535:  #include <linux/msdos_fs.h>
                    536: +#include <linux/fat_cvf.h>
                    537:  
                    538:  #include "msbuffer.h"
                    539:  #include "tables.h"
                    540: @@ -48,6 +49,13 @@
                    541:        X(fat_uni2code),
                    542:        X(fat_unlock_creation),
                    543:        X(fat_write_inode),
                    544: +      X(register_cvf_format),
                    545: +      X(unregister_cvf_format),
                    546: +      X(get_cluster),
                    547: +      X(lock_fat),
                    548: +      X(unlock_fat),
                    549: +      X(fat_readpage),
                    550: +      X(fat_dir_ioctl),
                    551:  #include <linux/symtab_end.h>
                    552:  };                                           
                    553:  
                    554: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/file.c linux-2.0.33-cyrix-patched-test/fs/fat/file.c
                    555: --- linux-2.0.33-cyrix-patched/fs/fat/file.c   Fri May 10 06:54:52 1996
                    556: +++ linux-2.0.33-cyrix-patched-test/fs/fat/file.c      Fri Jan  2 20:24:15 1998
                    557: @@ -15,6 +15,7 @@
                    558:  #include <linux/stat.h>
                    559:  #include <linux/string.h>
                    560:  #include <linux/pagemap.h>
                    561: +#include <linux/fat_cvf.h>
                    562:  
                    563:  #include <asm/segment.h>
                    564:  #include <asm/system.h>
                    565: @@ -109,6 +110,40 @@
                    566:        NULL                    /* smap */
                    567:  };
                    568:  
                    569: +static struct file_operations fat_file_operations_readpage = {
                    570: +      NULL,                   /* lseek - default */
                    571: +      fat_file_read,          /* read */
                    572: +      fat_file_write,         /* write */
                    573: +      NULL,                   /* readdir - bad */
                    574: +      NULL,                   /* select - default */
                    575: +      NULL,                   /* ioctl - default */
                    576: +      generic_file_mmap,      /* mmap */
                    577: +      NULL,                   /* no special open is needed */
                    578: +      NULL,                   /* release */
                    579: +      file_fsync              /* fsync */
                    580: +};
                    581: +
                    582: +struct inode_operations fat_file_inode_operations_readpage = {
                    583: +      &fat_file_operations_readpage,  /* default file operations */
                    584: +      NULL,                   /* create */
                    585: +      NULL,                   /* lookup */
                    586: +      NULL,                   /* link */
                    587: +      NULL,                   /* unlink */
                    588: +      NULL,                   /* symlink */
                    589: +      NULL,                   /* mkdir */
                    590: +      NULL,                   /* rmdir */
                    591: +      NULL,                   /* mknod */
                    592: +      NULL,                   /* rename */
                    593: +      NULL,                   /* readlink */
                    594: +      NULL,                   /* follow_link */
                    595: +      fat_readpage,           /* readpage */
                    596: +      NULL,                   /* writepage */
                    597: +      NULL,                   /* bmap */
                    598: +      fat_truncate,           /* truncate */
                    599: +      NULL,                   /* permission */
                    600: +      NULL                    /* smap */
                    601: +};
                    602: +
                    603:  #define MSDOS_PREFETCH        32
                    604:  struct fat_pre {
                    605:        int file_sector;/* Next sector to read in the prefetch table */
                    606: @@ -170,6 +205,10 @@
                    607:                printk("fat_file_read: inode = NULL\n");
                    608:                return -EINVAL;
                    609:        }
                    610: +        if(MSDOS_SB(sb)->cvf_format)
                    611: +          if(MSDOS_SB(sb)->cvf_format->cvf_file_read)
                    612: +            return MSDOS_SB(sb)->cvf_format->cvf_file_read(inode,filp,buf,count);
                    613: + 
                    614:        /* S_ISLNK allows for UMSDOS. Should never happen for normal MSDOS */
                    615:        if (!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode)) {
                    616:                printk("fat_file_read: mode = %07o\n",inode->i_mode);
                    617: @@ -287,6 +326,10 @@
                    618:                printk("fat_file_write: inode = NULL\n");
                    619:                return -EINVAL;
                    620:        }
                    621: +        if(MSDOS_SB(sb)->cvf_format)
                    622: +          if(MSDOS_SB(sb)->cvf_format->cvf_file_write)
                    623: +            return MSDOS_SB(sb)->cvf_format->cvf_file_write(inode,filp,buf,count);
                    624: +
                    625:        /* S_ISLNK allows for UMSDOS. Should never happen for normal MSDOS */
                    626:        if (!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode)) {
                    627:                printk("fat_file_write: mode = %07o\n",inode->i_mode);
                    628: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/inode.c linux-2.0.33-cyrix-patched-test/fs/fat/inode.c
                    629: --- linux-2.0.33-cyrix-patched/fs/fat/inode.c  Sat Nov 30 11:27:38 1996
                    630: +++ linux-2.0.33-cyrix-patched-test/fs/fat/inode.c     Sat Jan  3 10:46:27 1998
                    631: @@ -18,6 +18,8 @@
                    632:  #include <linux/fs.h>
                    633:  #include <linux/stat.h>
                    634:  #include <linux/locks.h>
                    635: +#include <linux/fat_cvf.h>
                    636: +#include <linux/malloc.h>
                    637:  
                    638:  #include "msbuffer.h"
                    639:  #include "tables.h"
                    640: @@ -75,6 +77,10 @@
                    641:  
                    642:  void fat_put_super(struct super_block *sb)
                    643:  {
                    644: +      if(MSDOS_SB(sb)->cvf_format)
                    645: +      { dec_cvf_format_use_count_by_version(MSDOS_SB(sb)->cvf_format->cvf_version);
                    646: +        MSDOS_SB(sb)->cvf_format->unmount_cvf(sb);
                    647: +      }
                    648:        fat_cache_inval_dev(sb->s_dev);
                    649:        set_blocksize (sb->s_dev,BLOCK_SIZE);
                    650:        lock_super(sb);
                    651: @@ -86,7 +92,8 @@
                    652:  
                    653:  
                    654:  static int parse_options(char *options,int *fat, int *blksize, int *debug,
                    655: -                       struct fat_mount_options *opts)
                    656: +                       struct fat_mount_options *opts,
                    657: +                       char* cvf_format, char*cvf_options)
                    658:  {
                    659:        char *this_char,*value;
                    660:  
                    661: @@ -181,6 +188,17 @@
                    662:                                return 0;
                    663:                        opts->sys_immutable = 1;
                    664:                }
                    665: +                else if (!strcmp(this_char,"cvf_format")) {
                    666: +                        if (!value)
                    667: +                                return 0;
                    668: +                        strncpy(cvf_format,value,20);
                    669: +                }
                    670: +                else if (!strcmp(this_char,"cvf_options")) {
                    671: +                        if (!value)
                    672: +                                return 0;
                    673: +                        strncpy(cvf_options,value,100);
                    674: +                }
                    675: +
                    676:        }
                    677:        return 1;
                    678:  }
                    679: @@ -196,6 +214,14 @@
                    680:        int debug,error,fat;
                    681:        int blksize = 512;
                    682:        struct fat_mount_options opts;
                    683: +      int i;
                    684: +      char cvf_format[21];
                    685: +      char cvf_options[101];
                    686: +      
                    687: +      cvf_format[0]='\0';
                    688: +      cvf_options[0]='\0';
                    689: +      MSDOS_SB(sb)->cvf_format=NULL;
                    690: +      MSDOS_SB(sb)->private_data=NULL;
                    691:  
                    692:        MOD_INC_USE_COUNT;
                    693:        if (hardsect_size[MAJOR(sb->s_dev)] != NULL){
                    694: @@ -204,7 +230,7 @@
                    695:                        printk ("MSDOS: Hardware sector size is %d\n",blksize);
                    696:                }
                    697:        }
                    698: -      if (!parse_options((char *) data, &fat, &blksize, &debug, &opts)
                    699: +      if (!parse_options((char *) data, &fat, &blksize, &debug, &opts, cvf_format, cvf_options)
                    700:                || (blksize != 512 && blksize != 1024)) {
                    701:                sb->s_dev = 0;
                    702:                MOD_DEC_USE_COUNT;
                    703: @@ -286,6 +312,9 @@
                    704:                                /* because clusters (DOS) are often aligned */
                    705:                                /* on odd sectors. */
                    706:        sb->s_blocksize_bits = blksize == 512 ? 9 : 10;
                    707: +      if(!strcmp(cvf_format,"none"))i=-1;
                    708: +      else i=detect_cvf(sb,cvf_format);
                    709: +      if(i>=0)error=cvf_formats[i]->mount_cvf(sb,cvf_options);
                    710:        if (error || debug) {
                    711:                /* The MSDOS_CAN_BMAP is obsolete, but left just to remember */
                    712:                printk("[MS-DOS FS Rel. 12,FAT %d,check=%c,conv=%c,"
                    713: @@ -302,13 +331,15 @@
                    714:                       (unsigned long)b->total_sect,logical_sector_size);
                    715:                printk ("Transaction block size = %d\n",blksize);
                    716:        }
                    717: -      if (MSDOS_SB(sb)->clusters+2 > fat_clusters)
                    718: +      if(i<0) if (MSDOS_SB(sb)->clusters+2 > fat_clusters)
                    719:                MSDOS_SB(sb)->clusters = fat_clusters-2;
                    720:        if (error) {
                    721:                if (!silent)
                    722:                        printk("VFS: Can't find a valid MSDOS filesystem on dev "
                    723:                               "%s.\n", kdevname(sb->s_dev));
                    724:                sb->s_dev = 0;
                    725: +              if(MSDOS_SB(sb)->private_data)kfree(MSDOS_SB(sb)->private_data);
                    726: +              MSDOS_SB(sb)->private_data=NULL;
                    727:                MOD_DEC_USE_COUNT;
                    728:                return NULL;
                    729:        }
                    730: @@ -321,10 +352,16 @@
                    731:        memcpy(&(MSDOS_SB(sb)->options), &opts, sizeof(struct fat_mount_options));
                    732:        if (!(sb->s_mounted = iget(sb,MSDOS_ROOT_INO))) {
                    733:                sb->s_dev = 0;
                    734: +              if(MSDOS_SB(sb)->private_data)kfree(MSDOS_SB(sb)->private_data);
                    735: +              MSDOS_SB(sb)->private_data=NULL;
                    736:                printk("get root inode failed\n");
                    737:                MOD_DEC_USE_COUNT;
                    738:                return NULL;
                    739:        }
                    740: +      if(i>=0)
                    741: +      { MSDOS_SB(sb)->cvf_format=cvf_formats[i];
                    742: +        ++cvf_format_use_count[i];
                    743: +      }
                    744:        return sb;
                    745:  }
                    746:  
                    747: @@ -333,7 +370,13 @@
                    748:  {
                    749:        int free,nr;
                    750:        struct statfs tmp;
                    751: -
                    752: +       
                    753: +        if(MSDOS_SB(sb)->cvf_format)
                    754: +          if(MSDOS_SB(sb)->cvf_format->cvf_statfs)
                    755: +          { MSDOS_SB(sb)->cvf_format->cvf_statfs(sb,buf,bufsiz);
                    756: +            return;
                    757: +          }
                    758: +          
                    759:        lock_fat(sb);
                    760:        if (MSDOS_SB(sb)->free_clusters != -1)
                    761:                free = MSDOS_SB(sb)->free_clusters;
                    762: @@ -362,6 +405,10 @@
                    763:        int cluster,offset;
                    764:  
                    765:        sb = MSDOS_SB(inode->i_sb);
                    766: +        if(sb->cvf_format)
                    767: +          if(sb->cvf_format->cvf_bmap)
                    768: +            return sb->cvf_format->cvf_bmap(inode,block);
                    769: +
                    770:        if (inode->i_ino == MSDOS_ROOT_INO) {
                    771:                return sb->dir_start + block;
                    772:        }
                    773: @@ -451,7 +498,12 @@
                    774:                       !is_exec(raw_entry->ext)))
                    775:                        ? S_IRUGO|S_IWUGO : S_IRWXUGO)
                    776:                    & ~MSDOS_SB(sb)->options.fs_umask) | S_IFREG;
                    777: -              inode->i_op = (sb->s_blocksize == 1024)
                    778: +              if(MSDOS_SB(sb)->cvf_format)
                    779: +                inode->i_op = (MSDOS_SB(sb)->cvf_format->flags&CVF_USE_READPAGE)
                    780: +                      ? &fat_file_inode_operations_readpage
                    781: +                      : &fat_file_inode_operations_1024;
                    782: +              else
                    783: +                inode->i_op = (sb->s_blocksize == 1024)
                    784:                        ? &fat_file_inode_operations_1024
                    785:                        : &fat_file_inode_operations;
                    786:                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
                    787: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/misc.c linux-2.0.33-cyrix-patched-test/fs/fat/misc.c
                    788: --- linux-2.0.33-cyrix-patched/fs/fat/misc.c   Fri May 10 06:54:52 1996
                    789: +++ linux-2.0.33-cyrix-patched-test/fs/fat/misc.c      Fri Jan  2 22:35:54 1998
                    790: @@ -186,6 +186,10 @@
                    791:  #endif
                    792:        sector = MSDOS_SB(sb)->data_start+(nr-2)*cluster_size;
                    793:        last_sector = sector + cluster_size;
                    794: +      if(MSDOS_SB(sb)->cvf_format&&
                    795: +        MSDOS_SB(sb)->cvf_format->zero_out_cluster)
                    796: +          MSDOS_SB(sb)->cvf_format->zero_out_cluster(inode,nr);
                    797: +      else
                    798:        for ( ; sector < last_sector; sector++) {
                    799:                #ifdef DEBUG
                    800:                        printk("zeroing sector %d\n",sector);
                    801: diff -u -r -N linux-2.0.33-cyrix-patched/fs/fat/mmap.c linux-2.0.33-cyrix-patched-test/fs/fat/mmap.c
                    802: --- linux-2.0.33-cyrix-patched/fs/fat/mmap.c   Fri Feb  9 06:47:16 1996
                    803: +++ linux-2.0.33-cyrix-patched-test/fs/fat/mmap.c      Fri Jan  2 20:15:29 1998
                    804: @@ -93,6 +93,9 @@
                    805:   */
                    806:  int fat_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
                    807:  {
                    808: +      if(MSDOS_SB(inode->i_sb)->cvf_format)
                    809: +        if(MSDOS_SB(inode->i_sb)->cvf_format->cvf_mmap)
                    810: +          return MSDOS_SB(inode->i_sb)->cvf_format->cvf_mmap(inode,file,vma);
                    811:        if (vma->vm_flags & VM_SHARED)  /* only PAGE_COW or read-only supported now */
                    812:                return -EINVAL;
                    813:        if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
                    814: @@ -110,4 +113,12 @@
                    815:        return 0;
                    816:  }
                    817:  
                    818: +int fat_readpage(struct inode * inode, struct page * page)
                    819: +{
                    820: +      if(MSDOS_SB(inode->i_sb)->cvf_format)
                    821: +        if(MSDOS_SB(inode->i_sb)->cvf_format->cvf_readpage)
                    822: +          return MSDOS_SB(inode->i_sb)->cvf_format->cvf_readpage(inode,page);
                    823:  
                    824: +      printk("fat_readpage called with no handler (shouldn't happen)\n");
                    825: +      return -1;
                    826: +}
                    827: diff -u -r -N linux-2.0.33-cyrix-patched/fs/umsdos/emd.c linux-2.0.33-cyrix-patched-test/fs/umsdos/emd.c
                    828: --- linux-2.0.33-cyrix-patched/fs/umsdos/emd.c Wed Feb  7 08:39:29 1996
                    829: +++ linux-2.0.33-cyrix-patched-test/fs/umsdos/emd.c    Sat Jan  3 19:13:43 1998
                    830: @@ -32,6 +32,7 @@
                    831:        int ret;
                    832:        int old_fs = get_fs();  
                    833:        set_fs (KERNEL_DS);
                    834: +      MSDOS_I(inode)->i_binary=2;
                    835:        ret = fat_file_read(inode,filp,buf,count);
                    836:        set_fs (old_fs);
                    837:        return ret;
                    838: @@ -48,6 +49,7 @@
                    839:        int ret;
                    840:        int old_fs = get_fs();
                    841:        set_fs (KERNEL_DS);
                    842: +      MSDOS_I(inode)->i_binary=2;
                    843:        ret = fat_file_write(inode,filp,buf,count);
                    844:        set_fs (old_fs);
                    845:        return ret;
                    846: diff -u -r -N linux-2.0.33-cyrix-patched/fs/umsdos/file.c linux-2.0.33-cyrix-patched-test/fs/umsdos/file.c
                    847: --- linux-2.0.33-cyrix-patched/fs/umsdos/file.c        Tue Feb 20 09:28:13 1996
                    848: +++ linux-2.0.33-cyrix-patched-test/fs/umsdos/file.c   Fri Jan  2 23:50:57 1998
                    849: @@ -129,3 +129,38 @@
                    850:        NULL,                   /* smap */
                    851:  };
                    852:  
                    853: +/* For other with larger and unaligned file system with readpage */
                    854: +struct file_operations umsdos_file_operations_readpage = {
                    855: +      NULL,                           /* lseek - default */
                    856: +      UMSDOS_file_read,       /* read */
                    857: +      UMSDOS_file_write,      /* write */
                    858: +      NULL,                           /* readdir - bad */
                    859: +      NULL,                           /* select - default */
                    860: +      NULL,                           /* ioctl - default */
                    861: +      generic_file_mmap,              /* mmap */
                    862: +      NULL,                           /* no special open is needed */
                    863: +      NULL,                           /* release */
                    864: +      file_fsync                      /* fsync */
                    865: +};
                    866: +
                    867: +struct inode_operations umsdos_file_inode_operations_readpage = {
                    868: +      &umsdos_file_operations_readpage,       /* default file operations */
                    869: +      NULL,                   /* create */
                    870: +      NULL,                   /* lookup */
                    871: +      NULL,                   /* link */
                    872: +      NULL,                   /* unlink */
                    873: +      NULL,                   /* symlink */
                    874: +      NULL,                   /* mkdir */
                    875: +      NULL,                   /* rmdir */
                    876: +      NULL,                   /* mknod */
                    877: +      NULL,                   /* rename */
                    878: +      NULL,                   /* readlink */
                    879: +      NULL,                   /* follow_link */
                    880: +      fat_readpage,           /* readpage */
                    881: +      NULL,                   /* writepage */
                    882: +      NULL,                   /* bmap */
                    883: +      UMSDOS_truncate,/* truncate */
                    884: +      NULL,                   /* permission */
                    885: +      NULL,                   /* smap */
                    886: +};
                    887: +
                    888: diff -u -r -N linux-2.0.33-cyrix-patched/fs/umsdos/inode.c linux-2.0.33-cyrix-patched-test/fs/umsdos/inode.c
                    889: --- linux-2.0.33-cyrix-patched/fs/umsdos/inode.c       Sat Nov 30 11:21:22 1996
                    890: +++ linux-2.0.33-cyrix-patched-test/fs/umsdos/inode.c  Fri Jan  2 23:55:34 1998
                    891: @@ -149,11 +149,20 @@
                    892:        if (!umsdos_isinit(inode)){
                    893:                inode->u.umsdos_i.i_emd_dir = 0;
                    894:                if (S_ISREG(inode->i_mode)){
                    895: +                  if (MSDOS_SB(inode->i_sb)->cvf_format){
                    896: +                      if (MSDOS_SB(inode->i_sb)->cvf_format->flags
                    897: +                          &CVF_USE_READPAGE){
                    898: +                              inode->i_op = &umsdos_file_inode_operations_readpage;
                    899: +                      }else{
                    900: +                              inode->i_op = &umsdos_file_inode_operations_no_bmap;
                    901: +                      }
                    902: +                  } else {
                    903:                        if (inode->i_op->bmap != NULL){
                    904:                                inode->i_op = &umsdos_file_inode_operations;
                    905:                        }else{
                    906:                                inode->i_op = &umsdos_file_inode_operations_no_bmap;
                    907:                        }
                    908: +                  }
                    909:                }else if (S_ISDIR(inode->i_mode)){
                    910:                        if (dir != NULL){
                    911:                                umsdos_setup_dir_inode(inode);
                    912: diff -u -r -N linux-2.0.33-cyrix-patched/fs/umsdos/ioctl.c linux-2.0.33-cyrix-patched-test/fs/umsdos/ioctl.c
                    913: --- linux-2.0.33-cyrix-patched/fs/umsdos/ioctl.c       Wed Jul  3 15:39:48 1996
                    914: +++ linux-2.0.33-cyrix-patched-test/fs/umsdos/ioctl.c  Sat Jan  3 13:01:52 1998
                    915: @@ -60,6 +60,21 @@
                    916:  {
                    917:        int ret = -EPERM;
                    918:        int err;
                    919: +      
                    920: +      /* forward non-umsdos ioctls - this hopefully doesn't cause conflicts */
                    921: +      if(cmd!=UMSDOS_GETVERSION
                    922: +         &&cmd!=UMSDOS_READDIR_DOS
                    923: +         &&cmd!=UMSDOS_READDIR_EMD
                    924: +         &&cmd!=UMSDOS_INIT_EMD
                    925: +         &&cmd!=UMSDOS_CREAT_EMD
                    926: +         &&cmd!=UMSDOS_RENAME_DOS
                    927: +         &&cmd!=UMSDOS_UNLINK_EMD
                    928: +         &&cmd!=UMSDOS_UNLINK_DOS
                    929: +         &&cmd!=UMSDOS_RMDIR_DOS
                    930: +         &&cmd!=UMSDOS_STAT_DOS
                    931: +         &&cmd!=UMSDOS_DOS_SETUP)
                    932: +              return fat_dir_ioctl(dir,filp,cmd,data);
                    933: +              
                    934:        /* #Specification: ioctl / acces
                    935:                Only root (effective id) is allowed to do IOCTL on directory
                    936:                in UMSDOS. EPERM is returned for other user.
                    937: diff -u -r -N linux-2.0.33-cyrix-patched/include/linux/fat_cvf.h linux-2.0.33-cyrix-patched-test/include/linux/fat_cvf.h
                    938: --- linux-2.0.33-cyrix-patched/include/linux/fat_cvf.h Thu Jan  1 01:00:00 1970
                    939: +++ linux-2.0.33-cyrix-patched-test/include/linux/fat_cvf.h    Sat Jan  3 12:42:28 1998
                    940: @@ -0,0 +1,55 @@
                    941: +#ifndef _FAT_CVF
                    942: +#define _FAT_CVF
                    943: +
                    944: +#define CVF_USE_READPAGE  0x0001
                    945: +
                    946: +struct cvf_format
                    947: +{ int cvf_version;
                    948: +  char* cvf_version_text;
                    949: +  unsigned long flags;
                    950: +  int (*detect_cvf) (struct super_block*sb);
                    951: +  int (*mount_cvf) (struct super_block*sb,char*options);
                    952: +  int (*unmount_cvf) (struct super_block*sb);
                    953: +  struct buffer_head* (*cvf_bread) (struct super_block*sb,int block);
                    954: +  struct buffer_head* (*cvf_getblk) (struct super_block*sb,int block);
                    955: +  void (*cvf_brelse) (struct super_block *sb,struct buffer_head *bh);
                    956: +  void (*cvf_mark_buffer_dirty) (struct super_block *sb,
                    957: +                              struct buffer_head *bh,
                    958: +                              int dirty_val);
                    959: +  void (*cvf_set_uptodate) (struct super_block *sb,
                    960: +                         struct buffer_head *bh,
                    961: +                         int val);
                    962: +  int (*cvf_is_uptodate) (struct super_block *sb,struct buffer_head *bh);
                    963: +  void (*cvf_ll_rw_block) (struct super_block *sb,
                    964: +                        int opr,
                    965: +                        int nbreq,
                    966: +                        struct buffer_head *bh[32]);
                    967: +  int (*fat_access) (struct super_block *sb,int nr,int new_value);
                    968: +  void (*cvf_statfs) (struct super_block *sb,struct statfs *buf, int bufsiz);
                    969: +  int (*cvf_bmap) (struct inode *inode,int block);
                    970: +  int (*cvf_smap) (struct inode *inode,int sector);
                    971: +  int (*cvf_file_read) ( struct inode *inode,
                    972: +                     struct file *filp,
                    973: +                     char *buf,
                    974: +                     int count);
                    975: +  int (*cvf_file_write) ( struct inode *inode,
                    976: +                      struct file *filp,
                    977: +                      const char *buf,
                    978: +                      int count);
                    979: +  int (*cvf_mmap) (struct inode*, struct file *, struct vm_area_struct *);
                    980: +  int (*cvf_readpage) (struct inode *, struct page *);
                    981: +  int (*cvf_writepage) (struct inode *, struct page *);
                    982: +  int (*cvf_dir_ioctl) (struct inode * inode, struct file * filp,
                    983: +                        unsigned int cmd, unsigned long arg);
                    984: +  void (*zero_out_cluster) (struct inode*, int clusternr);
                    985: +};
                    986: +
                    987: +int register_cvf_format(struct cvf_format*cvf_format);
                    988: +int unregister_cvf_format(struct cvf_format*cvf_format);
                    989: +void dec_cvf_format_use_count_by_version(int version);
                    990: +int detect_cvf(struct super_block*sb,char*force);
                    991: +
                    992: +extern struct cvf_format *cvf_formats[];
                    993: +extern int cvf_format_use_count[];
                    994: +
                    995: +#endif
                    996: diff -u -r -N linux-2.0.33-cyrix-patched/include/linux/msdos_fs.h linux-2.0.33-cyrix-patched-test/include/linux/msdos_fs.h
                    997: --- linux-2.0.33-cyrix-patched/include/linux/msdos_fs.h        Tue Dec 23 22:50:14 1997
                    998: +++ linux-2.0.33-cyrix-patched-test/include/linux/msdos_fs.h   Sat Jan  3 13:03:16 1998
                    999: @@ -221,12 +221,14 @@
                   1000:  /* file.c */
                   1001:  extern struct inode_operations fat_file_inode_operations;
                   1002:  extern struct inode_operations fat_file_inode_operations_1024;
                   1003: +extern struct inode_operations fat_file_inode_operations_readpage;
                   1004:  extern int fat_file_read(struct inode *, struct file *, char *, int);
                   1005:  extern int fat_file_write(struct inode *, struct file *, const char *, int);
                   1006:  extern void fat_truncate(struct inode *inode);
                   1007:  
                   1008:  /* mmap.c */
                   1009:  extern int fat_mmap(struct inode *, struct file *, struct vm_area_struct *);
                   1010: +extern int fat_readpage(struct inode *, struct page *);
                   1011:  
                   1012:  
                   1013:  /* vfat.c */
                   1014: diff -u -r -N linux-2.0.33-cyrix-patched/include/linux/msdos_fs_sb.h linux-2.0.33-cyrix-patched-test/include/linux/msdos_fs_sb.h
                   1015: --- linux-2.0.33-cyrix-patched/include/linux/msdos_fs_sb.h     Mon Mar 11 10:25:58 1996
                   1016: +++ linux-2.0.33-cyrix-patched-test/include/linux/msdos_fs_sb.h        Sat Jan  3 13:02:03 1998
                   1017: @@ -1,5 +1,6 @@
                   1018:  #ifndef _MSDOS_FS_SB
                   1019:  #define _MSDOS_FS_SB
                   1020: +#include<linux/fat_cvf.h>
                   1021:  
                   1022:  /*
                   1023:   * MS-DOS file system in-core superblock data
                   1024: @@ -34,6 +35,8 @@
                   1025:        int prev_free;               /* previously returned free cluster number */
                   1026:        int free_clusters;           /* -1 if undefined */
                   1027:        struct fat_mount_options options;
                   1028: +      struct cvf_format* cvf_format;
                   1029: +      void* private_data;
                   1030:  };
                   1031:  
                   1032:  #endif
                   1033: diff -u -r -N linux-2.0.33-cyrix-patched/include/linux/umsdos_fs.h linux-2.0.33-cyrix-patched-test/include/linux/umsdos_fs.h
                   1034: --- linux-2.0.33-cyrix-patched/include/linux/umsdos_fs.h       Tue Dec 23 22:50:14 1997
                   1035: +++ linux-2.0.33-cyrix-patched-test/include/linux/umsdos_fs.h  Sat Jan  3 13:04:02 1998
                   1036: @@ -135,6 +135,7 @@
                   1037:  extern struct file_operations  umsdos_file_operations;
                   1038:  extern struct inode_operations umsdos_file_inode_operations;
                   1039:  extern struct inode_operations umsdos_file_inode_operations_no_bmap;
                   1040: +extern struct inode_operations umsdos_file_inode_operations_readpage;
                   1041:  extern struct inode_operations umsdos_symlink_inode_operations;
                   1042:  extern int init_umsdos_fs(void);
                   1043:  
                   1044: diff -u -r -N linux-2.0.33-cyrix-patched/kernel/ksyms.c linux-2.0.33-cyrix-patched-test/kernel/ksyms.c
                   1045: --- linux-2.0.33-cyrix-patched/kernel/ksyms.c  Sat Nov 22 18:26:32 1997
                   1046: +++ linux-2.0.33-cyrix-patched-test/kernel/ksyms.c     Sat Jan  3 14:03:39 1998
                   1047: @@ -123,6 +123,9 @@
                   1048:        X(do_mmap),
                   1049:        X(do_munmap),
                   1050:        X(exit_mm),
                   1051: +      X(exit_sighand),
                   1052: +      X(exit_fs),
                   1053: +      X(exit_files),
                   1054:  
                   1055:        /* internal kernel memory management */
                   1056:        X(__get_free_pages),

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.