linux/Documentation/filesystems/omfs.txt
<<
>>
Prefs
   1Optimized MPEG Filesystem (OMFS)
   2
   3Overview
   4========
   5
   6OMFS is a filesystem created by SonicBlue for use in the ReplayTV DVR
   7and Rio Karma MP3 player.  The filesystem is extent-based, utilizing
   8block sizes from 2k to 8k, with hash-based directories.  This
   9filesystem driver may be used to read and write disks from these
  10devices.
  11
  12Note, it is not recommended that this FS be used in place of a general
  13filesystem for your own streaming media device.  Native Linux filesystems
  14will likely perform better.
  15
  16More information is available at:
  17
  18    http://linux-karma.sf.net/
  19
  20Various utilities, including mkomfs and omfsck, are included with
  21omfsprogs, available at:
  22
  23    http://bobcopeland.com/karma/
  24
  25Instructions are included in its README.
  26
  27Options
  28=======
  29
  30OMFS supports the following mount-time options:
  31
  32    uid=n        - make all files owned by specified user
  33    gid=n        - make all files owned by specified group
  34    umask=xxx    - set permission umask to xxx
  35    fmask=xxx    - set umask to xxx for files
  36    dmask=xxx    - set umask to xxx for directories
  37
  38Disk format
  39===========
  40
  41OMFS discriminates between "sysblocks" and normal data blocks.  The sysblock
  42group consists of super block information, file metadata, directory structures,
  43and extents.  Each sysblock has a header containing CRCs of the entire
  44sysblock, and may be mirrored in successive blocks on the disk.  A sysblock may
  45have a smaller size than a data block, but since they are both addressed by the
  46same 64-bit block number, any remaining space in the smaller sysblock is
  47unused.
  48
  49Sysblock header information:
  50
  51struct omfs_header {
  52        __be64 h_self;                  /* FS block where this is located */
  53        __be32 h_body_size;             /* size of useful data after header */
  54        __be16 h_crc;                   /* crc-ccitt of body_size bytes */
  55        char h_fill1[2];
  56        u8 h_version;                   /* version, always 1 */
  57        char h_type;                    /* OMFS_INODE_X */
  58        u8 h_magic;                     /* OMFS_IMAGIC */
  59        u8 h_check_xor;                 /* XOR of header bytes before this */
  60        __be32 h_fill2;
  61};
  62
  63Files and directories are both represented by omfs_inode:
  64
  65struct omfs_inode {
  66        struct omfs_header i_head;      /* header */
  67        __be64 i_parent;                /* parent containing this inode */
  68        __be64 i_sibling;               /* next inode in hash bucket */
  69        __be64 i_ctime;                 /* ctime, in milliseconds */
  70        char i_fill1[35];
  71        char i_type;                    /* OMFS_[DIR,FILE] */
  72        __be32 i_fill2;
  73        char i_fill3[64];
  74        char i_name[OMFS_NAMELEN];      /* filename */
  75        __be64 i_size;                  /* size of file, in bytes */
  76};
  77
  78Directories in OMFS are implemented as a large hash table.  Filenames are
  79hashed then prepended into the bucket list beginning at OMFS_DIR_START.
  80Lookup requires hashing the filename, then seeking across i_sibling pointers
  81until a match is found on i_name.  Empty buckets are represented by block
  82pointers with all-1s (~0).
  83
  84A file is an omfs_inode structure followed by an extent table beginning at
  85OMFS_EXTENT_START:
  86
  87struct omfs_extent_entry {
  88        __be64 e_cluster;               /* start location of a set of blocks */
  89        __be64 e_blocks;                /* number of blocks after e_cluster.  83s6y9Documentation/filesystems9omfs.90t#L76" id="L76" class="line" name="L76">  76};
<9 href="D9cumentation/filesystems9omfs.9xt#L31" id="L31" class="line" name="L31">  31
<9 href="D9cumentation/filesystems9omfs.92t#L87" id="L87" class= name="L87">  87struct omfs_extent_entry {
<9 href="D9cumentation/filesystems9omfs.9xt#L53" id="L53" class>   ne" name="L75">  75    e is an omfs_   __be64        /* number of blocks after e_cluster.  83< href="D9cumentation/filesystems9omfs.9xt#L54" id="L54" clae class="c="L3;"L75">  75  76};
<9 href="D9cumentation/filesystems9omfs.9xt#L66" id="L66" class="lclass="line" e"line";5">  75       _e is anlineize;                  /* size of file, in bytes */
<9 href="D9cumentation/filesystems9omfs.97t#L76" id="L76" class="line" name="L76">  76};
<9 href="D9cumentation/filesystems9omfs.9xt#L48" id="L48" class="line" name="L48">  48
<9a href="DDocumentation/filesystemomfs.9xt#L8ass="e is anholdclass=      offuste">  84A >        __be64 e_l        toy be used to read and write disks from these
        __be64 y be used to read and write disks from these
  83
<10 href="Do0cumentation/filesystems/04mfs/oxt#L5If 64L84 omfs_overf 8421"    __inu class=   __bs/a>fiis ="L632" id=me="Lbuccessive blocks on the disk.  A sysblock may
<10 href="Do0cumentation/filesystems/05mfs/oxt#L7ss>   . namesirec id="  u8 h_cu   a   64-bh i7  Each s"line" name="L8ny be used to read and write disks from these
  86
<10 href="Do0cumentation/filesystems/07mfs/o7t#L7
ame="L7gLnal LXR softwe" naa bloid="L23" class="lsourcor; ge//linprojid=s/lx ">LXR "linunityt#L7, 64L84experiass="la>      naa d="L23" cmailto:lx @lx @
lx .Redps="for pro ASt#L7, provid     _or you"L42ultstrucine"peraL25" cs3" icze;>have 1995.
h_results/16 huls/htmlor