Annotation of dmsdos/patches/cvf.diff-2.0.34, revision 1.1

1.1     ! root        1: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/Documentation/filesystems/fat_cvf.txt linux-2.0.33-cyrix-patched-fat32-test/Documentation/filesystems/fat_cvf.txt
        !             2: --- linux-2.0.33-cyrix-patched-fat32/Documentation/filesystems/fat_cvf.txt     Thu Jan  1 01:00:00 1970
        !             3: +++ linux-2.0.33-cyrix-patched-fat32-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-fat32/fs/fat/Makefile linux-2.0.33-cyrix-patched-fat32-test/fs/fat/Makefile
        !           216: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/Makefile   Wed Feb  7 08:39:27 1996
        !           217: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/Makefile      Sun Jan  4 11:59:56 1998
        !           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-fat32/fs/fat/buffer.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/buffer.c
        !           228: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/buffer.c   Sun Jan  4 11:55:32 1998
        !           229: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/buffer.c      Sun Jan  4 12:07:19 1998
        !           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:  #if 0
        !           237:  #  define PRINTK(x) printk x
        !           238: @@ -26,6 +27,11 @@
        !           239:        /* Note that the blocksize is 512 or 1024, but the first read
        !           240:           is always of size 1024. Doing readahead may be counterproductive
        !           241:           or just plain wrong. */
        !           242: +         
        !           243: +      if(MSDOS_SB(sb)->cvf_format)
        !           244: +        if(MSDOS_SB(sb)->cvf_format->cvf_bread)
        !           245: +         return MSDOS_SB(sb)->cvf_format->cvf_bread(sb,block);
        !           246: +      
        !           247:        if (sb->s_blocksize == 512) {
        !           248:                ret = bread (sb->s_dev,block,512);
        !           249:        } else {
        !           250: @@ -81,6 +87,11 @@
        !           251:  {
        !           252:        struct buffer_head *ret = NULL;
        !           253:        PRINTK(("fat_getblk: block=0x%x\n", block));
        !           254: +      
        !           255: +      if(MSDOS_SB(sb)->cvf_format)
        !           256: +        if(MSDOS_SB(sb)->cvf_format->cvf_getblk)
        !           257: +          return MSDOS_SB(sb)->cvf_format->cvf_getblk(sb,block);
        !           258: +      
        !           259:        if (sb->s_blocksize == 512){
        !           260:                ret = getblk (sb->s_dev,block,512);
        !           261:        }else{
        !           262: @@ -100,6 +111,10 @@
        !           263:        struct buffer_head *bh)
        !           264:  {
        !           265:        if (bh != NULL){
        !           266: +              if(MSDOS_SB(sb)->cvf_format)
        !           267: +                if(MSDOS_SB(sb)->cvf_format->cvf_brelse)
        !           268: +                  return MSDOS_SB(sb)->cvf_format->cvf_brelse(sb,bh);
        !           269: +
        !           270:                if (sb->s_blocksize == 512){
        !           271:                        brelse (bh);
        !           272:                }else{
        !           273: @@ -117,6 +132,12 @@
        !           274:        struct buffer_head *bh,
        !           275:        int dirty_val)
        !           276:  {
        !           277: +      if(MSDOS_SB(sb)->cvf_format)
        !           278: +          if(MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty)
        !           279: +          { MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty(sb,bh,dirty_val);
        !           280: +            return;
        !           281: +          }
        !           282: + 
        !           283:        if (sb->s_blocksize != 512){
        !           284:                bh = bh->b_next;
        !           285:        }
        !           286: @@ -128,6 +149,12 @@
        !           287:        struct buffer_head *bh,
        !           288:        int val)
        !           289:  {
        !           290: +      if(MSDOS_SB(sb)->cvf_format)
        !           291: +          if(MSDOS_SB(sb)->cvf_format->cvf_set_uptodate)
        !           292: +          { MSDOS_SB(sb)->cvf_format->cvf_set_uptodate(sb,bh,val);
        !           293: +            return;
        !           294: +          }
        !           295: + 
        !           296:        if (sb->s_blocksize != 512){
        !           297:                bh = bh->b_next;
        !           298:        }
        !           299: @@ -137,6 +164,10 @@
        !           300:        struct super_block *sb,
        !           301:        struct buffer_head *bh)
        !           302:  {
        !           303: +      if(MSDOS_SB(sb)->cvf_format)
        !           304: +          if(MSDOS_SB(sb)->cvf_format->cvf_is_uptodate)
        !           305: +            return MSDOS_SB(sb)->cvf_format->cvf_is_uptodate(sb,bh);
        !           306: + 
        !           307:        if (sb->s_blocksize != 512){
        !           308:                bh = bh->b_next;
        !           309:        }
        !           310: @@ -149,6 +180,12 @@
        !           311:        int nbreq,
        !           312:        struct buffer_head *bh[32])
        !           313:  {
        !           314: +        if(MSDOS_SB(sb)->cvf_format)
        !           315: +          if(MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block)
        !           316: +          { MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block(sb,opr,nbreq,bh);
        !           317: +            return;
        !           318: +          }
        !           319: + 
        !           320:        if (sb->s_blocksize == 512){
        !           321:                ll_rw_block(opr,nbreq,bh);
        !           322:        }else{
        !           323: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/cache.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/cache.c
        !           324: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/cache.c    Sun Jan  4 11:55:32 1998
        !           325: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/cache.c       Sun Jan  4 12:08:48 1998
        !           326: @@ -9,6 +9,7 @@
        !           327:  #include <linux/errno.h>
        !           328:  #include <linux/string.h>
        !           329:  #include <linux/stat.h>
        !           330: +#include <linux/fat_cvf.h>
        !           331:  
        !           332:  #include "msbuffer.h"
        !           333:  
        !           334: @@ -29,6 +30,10 @@
        !           335:        unsigned char *p_first,*p_last;
        !           336:        int copy,first,last,next,b;
        !           337:  
        !           338: +      if(MSDOS_SB(sb)->cvf_format)
        !           339: +        if(MSDOS_SB(sb)->cvf_format->fat_access)
        !           340: +          return MSDOS_SB(sb)->cvf_format->fat_access(sb,nr,new_value);
        !           341: +
        !           342:        if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters)
        !           343:                return 0;
        !           344:        if (MSDOS_SB(sb)->fat_bits == 32) {
        !           345: @@ -261,6 +266,10 @@
        !           346:        int cluster,offset;
        !           347:  
        !           348:        sb = MSDOS_SB(inode->i_sb);
        !           349: +      if(sb->cvf_format)
        !           350: +        if(sb->cvf_format->cvf_smap)
        !           351: +          return sb->cvf_format->cvf_smap(inode,sector);
        !           352: +      
        !           353:        if ((sb->fat_bits != 32) &&
        !           354:            (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) &&
        !           355:             !MSDOS_I(inode)->i_start))) {
        !           356: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/cvf.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/cvf.c
        !           357: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/cvf.c      Thu Jan  1 01:00:00 1970
        !           358: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/cvf.c Tue Nov 17 20:10:41 1998
        !           359: @@ -0,0 +1,147 @@
        !           360: +/* 
        !           361: + * CVF extensions for fat-based filesystems
        !           362: + *
        !           363: + * written 1997,1998 by Frank Gockel <[email protected]>
        !           364: + *
        !           365: + * please do not remove the next line, dmsdos needs it for verifying patches
        !           366: + * CVF-FAT-VERSION-ID: 1.1.0
        !           367: + *
        !           368: + */
        !           369: + 
        !           370: +#include<linux/sched.h>
        !           371: +#include<linux/fs.h>
        !           372: +#include<linux/msdos_fs.h>
        !           373: +#include<linux/msdos_fs_sb.h>
        !           374: +#include<linux/string.h>
        !           375: +#include<linux/fat_cvf.h>
        !           376: +#include<linux/config.h>
        !           377: +#ifdef CONFIG_KERNELD
        !           378: +#include<linux/kerneld.h>
        !           379: +#endif
        !           380: +
        !           381: +#define MAX_CVF_FORMATS 3
        !           382: +
        !           383: +struct cvf_format *cvf_formats[MAX_CVF_FORMATS]={NULL,NULL,NULL};
        !           384: +int cvf_format_use_count[MAX_CVF_FORMATS]={0,0,0};
        !           385: +
        !           386: +int register_cvf_format(struct cvf_format*cvf_format)
        !           387: +{ int i,j;
        !           388: +
        !           389: +  for(i=0;i<MAX_CVF_FORMATS;++i)
        !           390: +  { if(cvf_formats[i]==NULL)
        !           391: +    { /* free slot found, now check version */
        !           392: +      for(j=0;j<MAX_CVF_FORMATS;++j)
        !           393: +      { if(cvf_formats[j])
        !           394: +        { if(cvf_formats[j]->cvf_version==cvf_format->cvf_version)
        !           395: +          { printk("register_cvf_format: version %d already registered\n",
        !           396: +                   cvf_format->cvf_version);
        !           397: +            return -1;
        !           398: +          }
        !           399: +        }
        !           400: +      }
        !           401: +      cvf_formats[i]=cvf_format;
        !           402: +      cvf_format_use_count[i]=0;
        !           403: +      printk("CVF format %s (version id %d) successfully registered.\n",
        !           404: +             cvf_format->cvf_version_text,cvf_format->cvf_version);
        !           405: +      return 0;
        !           406: +    }
        !           407: +  }
        !           408: +  
        !           409: +  printk("register_cvf_format: too many formats\n");
        !           410: +  return -1;
        !           411: +}
        !           412: +
        !           413: +int unregister_cvf_format(struct cvf_format*cvf_format)
        !           414: +{ int i;
        !           415: +
        !           416: +  for(i=0;i<MAX_CVF_FORMATS;++i)
        !           417: +  { if(cvf_formats[i])
        !           418: +    { if(cvf_formats[i]->cvf_version==cvf_format->cvf_version)
        !           419: +      { if(cvf_format_use_count[i])
        !           420: +        { printk("unregister_cvf_format: format %d in use, cannot remove!\n",
        !           421: +          cvf_formats[i]->cvf_version);
        !           422: +          return -1;
        !           423: +        }
        !           424: +      
        !           425: +        printk("CVF format %s (version id %d) successfully unregistered.\n",
        !           426: +        cvf_formats[i]->cvf_version_text,cvf_formats[i]->cvf_version);
        !           427: +        cvf_formats[i]=NULL;
        !           428: +        return 0;
        !           429: +      }
        !           430: +    }
        !           431: +  }
        !           432: +  
        !           433: +  printk("unregister_cvf_format: format %d is not registered\n",
        !           434: +         cvf_format->cvf_version);
        !           435: +  return -1;
        !           436: +}
        !           437: +
        !           438: +void dec_cvf_format_use_count_by_version(int version)
        !           439: +{ int i;
        !           440: +
        !           441: +  for(i=0;i<MAX_CVF_FORMATS;++i)
        !           442: +  { if(cvf_formats[i])
        !           443: +    { if(cvf_formats[i]->cvf_version==version)
        !           444: +      { --cvf_format_use_count[i];
        !           445: +        if(cvf_format_use_count[i]<0)
        !           446: +        { cvf_format_use_count[i]=0;
        !           447: +          printk(KERN_EMERG "FAT FS/CVF: This is a bug in cvf_version_use_count\n");
        !           448: +        }
        !           449: +        return;
        !           450: +      }
        !           451: +    }
        !           452: +  }
        !           453: +  
        !           454: +  printk("dec_cvf_format_use_count_by_version: version %d not found ???\n",
        !           455: +         version);
        !           456: +}
        !           457: +
        !           458: +int detect_cvf(struct super_block*sb,char*force)
        !           459: +{ int i;
        !           460: +  int found=0;
        !           461: +  int found_i=-1;
        !           462: +
        !           463: +  if(force)
        !           464: +    if(strcmp(force,"autoload")==0)
        !           465: +    {
        !           466: +#ifdef CONFIG_KERNELD
        !           467: +      request_module("cvf_autoload");
        !           468: +      force=NULL;
        !           469: +#else
        !           470: +      printk("cannot autoload CVF modules: kerneld support is not compiled into kernel\n");
        !           471: +      return -1;
        !           472: +#endif
        !           473: +    }
        !           474: +    
        !           475: +#ifdef CONFIG_KERNELD
        !           476: +  if(force)
        !           477: +    if(*force)
        !           478: +      request_module(force);
        !           479: +#endif
        !           480: +
        !           481: +  if(force)
        !           482: +  { if(*force)
        !           483: +    { for(i=0;i<MAX_CVF_FORMATS;++i)
        !           484: +      { if(cvf_formats[i])
        !           485: +        { if(!strcmp(cvf_formats[i]->cvf_version_text,force))
        !           486: +            return i;
        !           487: +        }
        !           488: +      }
        !           489: +      printk("CVF format %s unknown (module not loaded?)\n",force);
        !           490: +      return -1;
        !           491: +    }
        !           492: +  }
        !           493: +
        !           494: +  for(i=0;i<MAX_CVF_FORMATS;++i)
        !           495: +  { if(cvf_formats[i])
        !           496: +    { if(cvf_formats[i]->detect_cvf(sb))
        !           497: +      { ++found;
        !           498: +        found_i=i;
        !           499: +      }
        !           500: +    }
        !           501: +  }
        !           502: +  
        !           503: +  if(found==1)return found_i;
        !           504: +  if(found>1)printk("CVF detection ambiguous, please use cvf_format=xxx option\n"); 
        !           505: +  return -1;
        !           506: +}
        !           507: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/dir.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/dir.c
        !           508: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/dir.c      Sun Jan  4 11:55:32 1998
        !           509: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/dir.c Sun Jan  4 11:59:56 1998
        !           510: @@ -425,6 +425,7 @@
        !           511:                  unsigned int cmd, unsigned long arg)
        !           512:  {
        !           513:        int err;
        !           514: +      
        !           515:        /*
        !           516:         * We want to provide an interface for Samba to be able
        !           517:         * to get the short filename for a given long filename.
        !           518: @@ -451,6 +452,11 @@
        !           519:                                    vfat_ioctl_fill, NULL, 1, 0, 1);
        !           520:        }
        !           521:        default:
        !           522: +              /* forward ioctl to CVF extension */
        !           523: +              if(MSDOS_SB(inode->i_sb)->cvf_format
        !           524: +                 &&MSDOS_SB(inode->i_sb)->cvf_format->cvf_dir_ioctl)
        !           525: +                   return MSDOS_SB(inode->i_sb)->cvf_format->
        !           526: +                                     cvf_dir_ioctl(inode,filp,cmd,arg);
        !           527:                return -EINVAL;
        !           528:        }
        !           529:  
        !           530: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/fatfs_syms.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/fatfs_syms.c
        !           531: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/fatfs_syms.c       Sun Jan  4 11:55:32 1998
        !           532: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/fatfs_syms.c  Sun Jan  4 12:11:10 1998
        !           533: @@ -11,6 +11,7 @@
        !           534:  
        !           535:  #include <linux/mm.h>
        !           536:  #include <linux/msdos_fs.h>
        !           537: +#include <linux/fat_cvf.h>
        !           538:  
        !           539:  #include "msbuffer.h"
        !           540:  
        !           541: @@ -53,6 +54,13 @@
        !           542:  X(fat_uni2esc) X_PUNCT
        !           543:  X(fat_unlock_creation) X_PUNCT
        !           544:  X(fat_write_inode) X_PUNCT
        !           545: +X(register_cvf_format) X_PUNCT
        !           546: +X(unregister_cvf_format) X_PUNCT
        !           547: +X(get_cluster) X_PUNCT
        !           548: +X(lock_fat) X_PUNCT
        !           549: +X(unlock_fat) X_PUNCT
        !           550: +X(fat_readpage) X_PUNCT
        !           551: +X(fat_dir_ioctl) X_PUNCT
        !           552:  #if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0)
        !           553:  #include <linux/symtab_end.h>
        !           554:  };                                           
        !           555: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/file.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/file.c
        !           556: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/file.c     Sun Jan  4 11:55:32 1998
        !           557: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/file.c        Sun Jan  4 11:59:56 1998
        !           558: @@ -17,6 +17,7 @@
        !           559:  #include <linux/stat.h>
        !           560:  #include <linux/string.h>
        !           561:  #include <linux/pagemap.h>
        !           562: +#include <linux/fat_cvf.h>
        !           563:  
        !           564:  #if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
        !           565:  #include <asm/uaccess.h>
        !           566: @@ -121,6 +122,40 @@
        !           567:        NULL                    /* smap */
        !           568:  };
        !           569:  
        !           570: +static struct file_operations fat_file_operations_readpage = {
        !           571: +      NULL,                   /* lseek - default */
        !           572: +      fat_file_read,          /* read */
        !           573: +      fat_file_write,         /* write */
        !           574: +      NULL,                   /* readdir - bad */
        !           575: +      NULL,                   /* select - default */
        !           576: +      NULL,                   /* ioctl - default */
        !           577: +      generic_file_mmap,      /* mmap */
        !           578: +      NULL,                   /* no special open is needed */
        !           579: +      NULL,                   /* release */
        !           580: +      file_fsync              /* fsync */
        !           581: +};
        !           582: +
        !           583: +struct inode_operations fat_file_inode_operations_readpage = {
        !           584: +      &fat_file_operations_readpage,  /* default file operations */
        !           585: +      NULL,                   /* create */
        !           586: +      NULL,                   /* lookup */
        !           587: +      NULL,                   /* link */
        !           588: +      NULL,                   /* unlink */
        !           589: +      NULL,                   /* symlink */
        !           590: +      NULL,                   /* mkdir */
        !           591: +      NULL,                   /* rmdir */
        !           592: +      NULL,                   /* mknod */
        !           593: +      NULL,                   /* rename */
        !           594: +      NULL,                   /* readlink */
        !           595: +      NULL,                   /* follow_link */
        !           596: +      fat_readpage,           /* readpage */
        !           597: +      NULL,                   /* writepage */
        !           598: +      NULL,                   /* bmap */
        !           599: +      fat_truncate,           /* truncate */
        !           600: +      NULL,                   /* permission */
        !           601: +      NULL                    /* smap */
        !           602: +};
        !           603: +
        !           604:  #define MSDOS_PREFETCH        32
        !           605:  struct fat_pre {
        !           606:        int file_sector;/* Next sector to read in the prefetch table */
        !           607: @@ -183,6 +218,10 @@
        !           608:                printk("fat_file_read: inode = NULL\n");
        !           609:                return -EINVAL;
        !           610:        }
        !           611: +        if(MSDOS_SB(sb)->cvf_format)
        !           612: +          if(MSDOS_SB(sb)->cvf_format->cvf_file_read)
        !           613: +            return MSDOS_SB(sb)->cvf_format->cvf_file_read(inode,filp,buf,count);
        !           614: + 
        !           615:        /* S_ISLNK allows for UMSDOS. Should never happen for normal MSDOS */
        !           616:        if (!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode)) {
        !           617:                printk("fat_file_read: mode = %07o\n",inode->i_mode);
        !           618: @@ -305,6 +344,10 @@
        !           619:                printk("fat_file_write: inode = NULL\n");
        !           620:                return -EINVAL;
        !           621:        }
        !           622: +        if(MSDOS_SB(sb)->cvf_format)
        !           623: +          if(MSDOS_SB(sb)->cvf_format->cvf_file_write)
        !           624: +            return MSDOS_SB(sb)->cvf_format->cvf_file_write(inode,filp,buf,count);
        !           625: +
        !           626:        /* S_ISLNK allows for UMSDOS. Should never happen for normal MSDOS */
        !           627:        if (!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode)) {
        !           628:                printk("fat_file_write: mode = %07o\n",inode->i_mode);
        !           629: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/inode.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/inode.c
        !           630: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/inode.c    Sun Jan  4 11:55:32 1998
        !           631: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/inode.c       Sun Jan  4 12:31:18 1998
        !           632: @@ -22,6 +22,7 @@
        !           633:  #include <linux/stat.h>
        !           634:  #include <linux/locks.h>
        !           635:  #include <linux/malloc.h>
        !           636: +#include <linux/fat_cvf.h>
        !           637:  
        !           638:  #include "msbuffer.h"
        !           639:  
        !           640: @@ -88,6 +89,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:        if (MSDOS_SB(sb)->fat_bits == 32) {
        !           649:                fat_clusters_flush(sb);
        !           650:        }
        !           651: @@ -113,7 +118,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,save,*savep;
        !           660:        char *p;
        !           661: @@ -239,6 +245,16 @@
        !           662:                                ret = 0;
        !           663:                        }
        !           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:                if (this_char != options) *(this_char-1) = ',';
        !           677:                if (value) *savep = save;
        !           678: @@ -261,6 +277,14 @@
        !           679:        struct fat_mount_options opts;
        !           680:        char buf[50];
        !           681:        char *p;
        !           682: +      int i;
        !           683: +      char cvf_format[21];
        !           684: +      char cvf_options[101];
        !           685: +
        !           686: +      cvf_format[0]='\0';
        !           687: +      cvf_options[0]='\0';
        !           688: +      MSDOS_SB(sb)->cvf_format=NULL;
        !           689: +      MSDOS_SB(sb)->private_data=NULL;
        !           690:  
        !           691:        MOD_INC_USE_COUNT;
        !           692:        if (hardsect_size[MAJOR(sb->s_dev)] != NULL){
        !           693: @@ -270,7 +294,8 @@
        !           694:                }
        !           695:        }
        !           696:        opts.isvfat = MSDOS_SB(sb)->options.isvfat;
        !           697: -      if (!parse_options((char *) data, &fat, &blksize, &debug, &opts)
        !           698: +      if (!parse_options((char *) data, &fat, &blksize, &debug, &opts,
        !           699: +          cvf_format, cvf_options)
        !           700:                || (blksize != 512 && blksize != 1024)) {
        !           701:                sb->s_dev = 0;
        !           702:                MOD_DEC_USE_COUNT;
        !           703: @@ -375,6 +400,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: @@ -392,13 +420,15 @@
        !           714:                       MSDOS_SB(sb)->root_cluster,MSDOS_SB(sb)->free_clusters);
        !           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: @@ -419,6 +449,8 @@
        !           731:                        MSDOS_SB(sb)->nls_disk = load_nls_default();
        !           732:                } else {
        !           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:                        MOD_DEC_USE_COUNT;
        !           737:                        return NULL;
        !           738:                }
        !           739: @@ -433,6 +465,8 @@
        !           740:                                kfree(opts.iocharset);
        !           741:                                unload_nls(MSDOS_SB(sb)->nls_disk);
        !           742:                                sb->s_dev = 0;
        !           743: +                              if(MSDOS_SB(sb)->private_data)kfree(MSDOS_SB(sb)->private_data);
        !           744: +                              MSDOS_SB(sb)->private_data=NULL;
        !           745:                                MOD_DEC_USE_COUNT;
        !           746:                                return NULL;
        !           747:                        } else {
        !           748: @@ -447,9 +481,16 @@
        !           749:                unload_nls(MSDOS_SB(sb)->nls_disk);
        !           750:                if (MSDOS_SB(sb)->nls_io) unload_nls(MSDOS_SB(sb)->nls_io);
        !           751:                if (opts.iocharset) kfree(opts.iocharset);
        !           752: +              if(MSDOS_SB(sb)->private_data)kfree(MSDOS_SB(sb)->private_data);
        !           753: +              MSDOS_SB(sb)->private_data=NULL;
        !           754:                MOD_DEC_USE_COUNT;
        !           755:                return NULL;
        !           756:        }
        !           757: +      
        !           758: +      if(i>=0)
        !           759: +      { MSDOS_SB(sb)->cvf_format=cvf_formats[i];
        !           760: +        ++cvf_format_use_count[i];
        !           761: +      }
        !           762:  
        !           763:        return sb;
        !           764:  }
        !           765: @@ -459,7 +500,13 @@
        !           766:  {
        !           767:        int free,nr;
        !           768:        struct statfs tmp;
        !           769: -
        !           770: +       
        !           771: +        if(MSDOS_SB(sb)->cvf_format)
        !           772: +          if(MSDOS_SB(sb)->cvf_format->cvf_statfs)
        !           773: +          { MSDOS_SB(sb)->cvf_format->cvf_statfs(sb,buf,bufsiz);
        !           774: +            return;
        !           775: +          }
        !           776: +          
        !           777:        lock_fat(sb);
        !           778:        if (MSDOS_SB(sb)->free_clusters != -1)
        !           779:                free = MSDOS_SB(sb)->free_clusters;
        !           780: @@ -488,6 +535,10 @@
        !           781:        int cluster,offset;
        !           782:  
        !           783:        sb = MSDOS_SB(inode->i_sb);
        !           784: +      if(sb->cvf_format)
        !           785: +        if(sb->cvf_format->cvf_bmap)
        !           786: +          return sb->cvf_format->cvf_bmap(inode,block);
        !           787: +      
        !           788:        if ((inode->i_ino == MSDOS_ROOT_INO) && (sb->fat_bits != 32)) {
        !           789:                return sb->dir_start + block;
        !           790:        }
        !           791: @@ -600,7 +651,12 @@
        !           792:                       !is_exec(raw_entry->ext)))
        !           793:                        ? S_IRUGO|S_IWUGO : S_IRWXUGO)
        !           794:                    & ~MSDOS_SB(sb)->options.fs_umask) | S_IFREG;
        !           795: -              inode->i_op = (sb->s_blocksize == 1024)
        !           796: +              if(MSDOS_SB(sb)->cvf_format)
        !           797: +                inode->i_op = (MSDOS_SB(sb)->cvf_format->flags&CVF_USE_READPAGE)
        !           798: +                      ? &fat_file_inode_operations_readpage
        !           799: +                      : &fat_file_inode_operations_1024;
        !           800: +              else
        !           801: +                inode->i_op = (sb->s_blocksize == 1024)
        !           802:                        ? &fat_file_inode_operations_1024
        !           803:                        : &fat_file_inode_operations;
        !           804:                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
        !           805: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/misc.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/misc.c
        !           806: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/misc.c     Sun Jan  4 11:55:32 1998
        !           807: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/misc.c        Sun Jan  4 11:59:56 1998
        !           808: @@ -225,6 +225,10 @@
        !           809:  #endif
        !           810:        sector = MSDOS_SB(sb)->data_start+(nr-2)*cluster_size;
        !           811:        last_sector = sector + cluster_size;
        !           812: +      if(MSDOS_SB(sb)->cvf_format&&
        !           813: +        MSDOS_SB(sb)->cvf_format->zero_out_cluster)
        !           814: +          MSDOS_SB(sb)->cvf_format->zero_out_cluster(inode,nr);
        !           815: +      else
        !           816:        for ( ; sector < last_sector; sector++) {
        !           817:                #ifdef DEBUG
        !           818:                        printk("zeroing sector %d\n",sector);
        !           819: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/fat/mmap.c linux-2.0.33-cyrix-patched-fat32-test/fs/fat/mmap.c
        !           820: --- linux-2.0.33-cyrix-patched-fat32/fs/fat/mmap.c     Sun Jan  4 11:55:32 1998
        !           821: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/fat/mmap.c        Sun Jan  4 11:59:56 1998
        !           822: @@ -100,6 +100,9 @@
        !           823:   */
        !           824:  int fat_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
        !           825:  {
        !           826: +      if(MSDOS_SB(inode->i_sb)->cvf_format)
        !           827: +        if(MSDOS_SB(inode->i_sb)->cvf_format->cvf_mmap)
        !           828: +          return MSDOS_SB(inode->i_sb)->cvf_format->cvf_mmap(inode,file,vma);
        !           829:        if (vma->vm_flags & VM_SHARED)  /* only PAGE_COW or read-only supported now */
        !           830:                return -EINVAL;
        !           831:        if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
        !           832: @@ -117,4 +120,12 @@
        !           833:        return 0;
        !           834:  }
        !           835:  
        !           836: +int fat_readpage(struct inode * inode, struct page * page)
        !           837: +{
        !           838: +      if(MSDOS_SB(inode->i_sb)->cvf_format)
        !           839: +        if(MSDOS_SB(inode->i_sb)->cvf_format->cvf_readpage)
        !           840: +          return MSDOS_SB(inode->i_sb)->cvf_format->cvf_readpage(inode,page);
        !           841:  
        !           842: +      printk("fat_readpage called with no handler (shouldn't happen)\n");
        !           843: +      return -1;
        !           844: +}
        !           845: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/umsdos/emd.c linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/emd.c
        !           846: --- linux-2.0.33-cyrix-patched-fat32/fs/umsdos/emd.c   Wed Feb  7 08:39:29 1996
        !           847: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/emd.c      Sun Jan  4 11:59:56 1998
        !           848: @@ -32,6 +32,7 @@
        !           849:        int ret;
        !           850:        int old_fs = get_fs();  
        !           851:        set_fs (KERNEL_DS);
        !           852: +      MSDOS_I(inode)->i_binary=2;
        !           853:        ret = fat_file_read(inode,filp,buf,count);
        !           854:        set_fs (old_fs);
        !           855:        return ret;
        !           856: @@ -48,6 +49,7 @@
        !           857:        int ret;
        !           858:        int old_fs = get_fs();
        !           859:        set_fs (KERNEL_DS);
        !           860: +      MSDOS_I(inode)->i_binary=2;
        !           861:        ret = fat_file_write(inode,filp,buf,count);
        !           862:        set_fs (old_fs);
        !           863:        return ret;
        !           864: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/umsdos/file.c linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/file.c
        !           865: --- linux-2.0.33-cyrix-patched-fat32/fs/umsdos/file.c  Tue Feb 20 09:28:13 1996
        !           866: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/file.c     Sun Jan  4 11:59:56 1998
        !           867: @@ -129,3 +129,38 @@
        !           868:        NULL,                   /* smap */
        !           869:  };
        !           870:  
        !           871: +/* For other with larger and unaligned file system with readpage */
        !           872: +struct file_operations umsdos_file_operations_readpage = {
        !           873: +      NULL,                           /* lseek - default */
        !           874: +      UMSDOS_file_read,       /* read */
        !           875: +      UMSDOS_file_write,      /* write */
        !           876: +      NULL,                           /* readdir - bad */
        !           877: +      NULL,                           /* select - default */
        !           878: +      NULL,                           /* ioctl - default */
        !           879: +      generic_file_mmap,              /* mmap */
        !           880: +      NULL,                           /* no special open is needed */
        !           881: +      NULL,                           /* release */
        !           882: +      file_fsync                      /* fsync */
        !           883: +};
        !           884: +
        !           885: +struct inode_operations umsdos_file_inode_operations_readpage = {
        !           886: +      &umsdos_file_operations_readpage,       /* default file operations */
        !           887: +      NULL,                   /* create */
        !           888: +      NULL,                   /* lookup */
        !           889: +      NULL,                   /* link */
        !           890: +      NULL,                   /* unlink */
        !           891: +      NULL,                   /* symlink */
        !           892: +      NULL,                   /* mkdir */
        !           893: +      NULL,                   /* rmdir */
        !           894: +      NULL,                   /* mknod */
        !           895: +      NULL,                   /* rename */
        !           896: +      NULL,                   /* readlink */
        !           897: +      NULL,                   /* follow_link */
        !           898: +      fat_readpage,           /* readpage */
        !           899: +      NULL,                   /* writepage */
        !           900: +      NULL,                   /* bmap */
        !           901: +      UMSDOS_truncate,/* truncate */
        !           902: +      NULL,                   /* permission */
        !           903: +      NULL,                   /* smap */
        !           904: +};
        !           905: +
        !           906: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/umsdos/inode.c linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/inode.c
        !           907: --- linux-2.0.33-cyrix-patched-fat32/fs/umsdos/inode.c Sat Nov 30 11:21:22 1996
        !           908: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/inode.c    Sun Jan  4 11:59:56 1998
        !           909: @@ -149,11 +149,20 @@
        !           910:        if (!umsdos_isinit(inode)){
        !           911:                inode->u.umsdos_i.i_emd_dir = 0;
        !           912:                if (S_ISREG(inode->i_mode)){
        !           913: +                  if (MSDOS_SB(inode->i_sb)->cvf_format){
        !           914: +                      if (MSDOS_SB(inode->i_sb)->cvf_format->flags
        !           915: +                          &CVF_USE_READPAGE){
        !           916: +                              inode->i_op = &umsdos_file_inode_operations_readpage;
        !           917: +                      }else{
        !           918: +                              inode->i_op = &umsdos_file_inode_operations_no_bmap;
        !           919: +                      }
        !           920: +                  } else {
        !           921:                        if (inode->i_op->bmap != NULL){
        !           922:                                inode->i_op = &umsdos_file_inode_operations;
        !           923:                        }else{
        !           924:                                inode->i_op = &umsdos_file_inode_operations_no_bmap;
        !           925:                        }
        !           926: +                  }
        !           927:                }else if (S_ISDIR(inode->i_mode)){
        !           928:                        if (dir != NULL){
        !           929:                                umsdos_setup_dir_inode(inode);
        !           930: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/fs/umsdos/ioctl.c linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/ioctl.c
        !           931: --- linux-2.0.33-cyrix-patched-fat32/fs/umsdos/ioctl.c Wed Jul  3 15:39:48 1996
        !           932: +++ linux-2.0.33-cyrix-patched-fat32-test/fs/umsdos/ioctl.c    Sun Jan  4 11:59:56 1998
        !           933: @@ -60,6 +60,21 @@
        !           934:  {
        !           935:        int ret = -EPERM;
        !           936:        int err;
        !           937: +      
        !           938: +      /* forward non-umsdos ioctls - this hopefully doesn't cause conflicts */
        !           939: +      if(cmd!=UMSDOS_GETVERSION
        !           940: +         &&cmd!=UMSDOS_READDIR_DOS
        !           941: +         &&cmd!=UMSDOS_READDIR_EMD
        !           942: +         &&cmd!=UMSDOS_INIT_EMD
        !           943: +         &&cmd!=UMSDOS_CREAT_EMD
        !           944: +         &&cmd!=UMSDOS_RENAME_DOS
        !           945: +         &&cmd!=UMSDOS_UNLINK_EMD
        !           946: +         &&cmd!=UMSDOS_UNLINK_DOS
        !           947: +         &&cmd!=UMSDOS_RMDIR_DOS
        !           948: +         &&cmd!=UMSDOS_STAT_DOS
        !           949: +         &&cmd!=UMSDOS_DOS_SETUP)
        !           950: +              return fat_dir_ioctl(dir,filp,cmd,data);
        !           951: +              
        !           952:        /* #Specification: ioctl / acces
        !           953:                Only root (effective id) is allowed to do IOCTL on directory
        !           954:                in UMSDOS. EPERM is returned for other user.
        !           955: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/include/linux/fat_cvf.h linux-2.0.33-cyrix-patched-fat32-test/include/linux/fat_cvf.h
        !           956: --- linux-2.0.33-cyrix-patched-fat32/include/linux/fat_cvf.h   Thu Jan  1 01:00:00 1970
        !           957: +++ linux-2.0.33-cyrix-patched-fat32-test/include/linux/fat_cvf.h      Sun Jan  4 11:59:56 1998
        !           958: @@ -0,0 +1,55 @@
        !           959: +#ifndef _FAT_CVF
        !           960: +#define _FAT_CVF
        !           961: +
        !           962: +#define CVF_USE_READPAGE  0x0001
        !           963: +
        !           964: +struct cvf_format
        !           965: +{ int cvf_version;
        !           966: +  char* cvf_version_text;
        !           967: +  unsigned long flags;
        !           968: +  int (*detect_cvf) (struct super_block*sb);
        !           969: +  int (*mount_cvf) (struct super_block*sb,char*options);
        !           970: +  int (*unmount_cvf) (struct super_block*sb);
        !           971: +  struct buffer_head* (*cvf_bread) (struct super_block*sb,int block);
        !           972: +  struct buffer_head* (*cvf_getblk) (struct super_block*sb,int block);
        !           973: +  void (*cvf_brelse) (struct super_block *sb,struct buffer_head *bh);
        !           974: +  void (*cvf_mark_buffer_dirty) (struct super_block *sb,
        !           975: +                              struct buffer_head *bh,
        !           976: +                              int dirty_val);
        !           977: +  void (*cvf_set_uptodate) (struct super_block *sb,
        !           978: +                         struct buffer_head *bh,
        !           979: +                         int val);
        !           980: +  int (*cvf_is_uptodate) (struct super_block *sb,struct buffer_head *bh);
        !           981: +  void (*cvf_ll_rw_block) (struct super_block *sb,
        !           982: +                        int opr,
        !           983: +                        int nbreq,
        !           984: +                        struct buffer_head *bh[32]);
        !           985: +  int (*fat_access) (struct super_block *sb,int nr,int new_value);
        !           986: +  void (*cvf_statfs) (struct super_block *sb,struct statfs *buf, int bufsiz);
        !           987: +  int (*cvf_bmap) (struct inode *inode,int block);
        !           988: +  int (*cvf_smap) (struct inode *inode,int sector);
        !           989: +  int (*cvf_file_read) ( struct inode *inode,
        !           990: +                     struct file *filp,
        !           991: +                     char *buf,
        !           992: +                     int count);
        !           993: +  int (*cvf_file_write) ( struct inode *inode,
        !           994: +                      struct file *filp,
        !           995: +                      const char *buf,
        !           996: +                      int count);
        !           997: +  int (*cvf_mmap) (struct inode*, struct file *, struct vm_area_struct *);
        !           998: +  int (*cvf_readpage) (struct inode *, struct page *);
        !           999: +  int (*cvf_writepage) (struct inode *, struct page *);
        !          1000: +  int (*cvf_dir_ioctl) (struct inode * inode, struct file * filp,
        !          1001: +                        unsigned int cmd, unsigned long arg);
        !          1002: +  void (*zero_out_cluster) (struct inode*, int clusternr);
        !          1003: +};
        !          1004: +
        !          1005: +int register_cvf_format(struct cvf_format*cvf_format);
        !          1006: +int unregister_cvf_format(struct cvf_format*cvf_format);
        !          1007: +void dec_cvf_format_use_count_by_version(int version);
        !          1008: +int detect_cvf(struct super_block*sb,char*force);
        !          1009: +
        !          1010: +extern struct cvf_format *cvf_formats[];
        !          1011: +extern int cvf_format_use_count[];
        !          1012: +
        !          1013: +#endif
        !          1014: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/include/linux/msdos_fs.h linux-2.0.33-cyrix-patched-fat32-test/include/linux/msdos_fs.h
        !          1015: --- linux-2.0.33-cyrix-patched-fat32/include/linux/msdos_fs.h  Sun Jan  4 11:55:33 1998
        !          1016: +++ linux-2.0.33-cyrix-patched-fat32-test/include/linux/msdos_fs.h     Sun Jan  4 12:40:48 1998
        !          1017: @@ -246,12 +246,14 @@
        !          1018:  /* file.c */
        !          1019:  extern struct inode_operations fat_file_inode_operations;
        !          1020:  extern struct inode_operations fat_file_inode_operations_1024;
        !          1021: +extern struct inode_operations fat_file_inode_operations_readpage;
        !          1022:  extern int fat_file_read(struct inode *, struct file *, char *, int);
        !          1023:  extern int fat_file_write(struct inode *, struct file *, const char *, int);
        !          1024:  extern void fat_truncate(struct inode *inode);
        !          1025:  
        !          1026:  /* mmap.c */
        !          1027:  extern int fat_mmap(struct inode *, struct file *, struct vm_area_struct *);
        !          1028: +extern int fat_readpage(struct inode *, struct page *);
        !          1029:  
        !          1030:  
        !          1031:  /* vfat.c */
        !          1032: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/include/linux/msdos_fs_sb.h linux-2.0.33-cyrix-patched-fat32-test/include/linux/msdos_fs_sb.h
        !          1033: --- linux-2.0.33-cyrix-patched-fat32/include/linux/msdos_fs_sb.h       Sun Jan  4 11:55:33 1998
        !          1034: +++ linux-2.0.33-cyrix-patched-fat32-test/include/linux/msdos_fs_sb.h  Sun Jan  4 12:02:05 1998
        !          1035: @@ -1,5 +1,6 @@
        !          1036:  #ifndef _MSDOS_FS_SB
        !          1037:  #define _MSDOS_FS_SB
        !          1038: +#include<linux/fat_cvf.h>
        !          1039:  
        !          1040:  /*
        !          1041:   * MS-DOS file system in-core superblock data
        !          1042: @@ -46,6 +47,8 @@
        !          1043:        struct fat_mount_options options;
        !          1044:        struct nls_table *nls_disk;  /* Codepage used on disk */
        !          1045:        struct nls_table *nls_io;    /* Charset used for input and display */
        !          1046: +      struct cvf_format* cvf_format;
        !          1047: +      void* private_data;     
        !          1048:  };
        !          1049:  
        !          1050:  #endif
        !          1051: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/include/linux/umsdos_fs.h linux-2.0.33-cyrix-patched-fat32-test/include/linux/umsdos_fs.h
        !          1052: --- linux-2.0.33-cyrix-patched-fat32/include/linux/umsdos_fs.h Tue Dec 23 22:50:14 1997
        !          1053: +++ linux-2.0.33-cyrix-patched-fat32-test/include/linux/umsdos_fs.h    Sun Jan  4 12:40:48 1998
        !          1054: @@ -135,6 +135,7 @@
        !          1055:  extern struct file_operations  umsdos_file_operations;
        !          1056:  extern struct inode_operations umsdos_file_inode_operations;
        !          1057:  extern struct inode_operations umsdos_file_inode_operations_no_bmap;
        !          1058: +extern struct inode_operations umsdos_file_inode_operations_readpage;
        !          1059:  extern struct inode_operations umsdos_symlink_inode_operations;
        !          1060:  extern int init_umsdos_fs(void);
        !          1061:  
        !          1062: diff -u -r -N linux-2.0.33-cyrix-patched-fat32/kernel/ksyms.c linux-2.0.33-cyrix-patched-fat32-test/kernel/ksyms.c
        !          1063: --- linux-2.0.33-cyrix-patched-fat32/kernel/ksyms.c    Sun Jan  4 11:55:33 1998
        !          1064: +++ linux-2.0.33-cyrix-patched-fat32-test/kernel/ksyms.c       Sun Jan  4 11:59:56 1998
        !          1065: @@ -124,6 +124,9 @@
        !          1066:        X(do_mmap),
        !          1067:        X(do_munmap),
        !          1068:        X(exit_mm),
        !          1069: +      X(exit_sighand),
        !          1070: +      X(exit_fs),
        !          1071: +      X(exit_files),
        !          1072:  
        !          1073:        /* internal kernel memory management */
        !          1074:        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.