inflator

Inflate previously deflated files

Note: You must be root to start this resource manager.

Syntax:

inflator [-b num] [-t num] [-v[v...]] [mountpoints...]
         [!exclude...]

Runs on:

QNX Neutrino

Options:

-b num
The number of decompression buffers (default: 8).
-t num
The maximum number of worker threads; the default is 4.
-v[v...]
Be verbose. Each additional v makes the output more verbose.
Note: If you specify the -v option, you need to start inflator in the background. If you don't use this option, inflator automatically daemonizes itself.
mountpoints
Directories to overlay (the default is /). If a mountpoint starts with an exclamation mark (!), that directory is excluded.
!exclude
Directories to exclude.

Description:

The inflator pass-through resource manager sits in front of other filesystems and inflates files that were previously deflated using the deflate utility. It's typically used when the underlying filesystem is a flash filesystem—it can almost double the effective size of the flash memory.

When started without arguments, inflator takes over /, placing it in front of any existing filesystems. It then catches each open() first. If the file is being opened for read, inflator attempts to open the file itself on an underlying filesystem. It reads the first 16 bytes and checks for the signature of a deflated file. If the file was deflated, inflator places itself between the application and the underlying filesystem. All reads return the original file data before it was deflated.

From the application's point of view, the file appears to be uncompressed. Random seeks are also supported. If the application does a stat() on the file, the size of the inflated file (the original size before it was deflated) is returned. If it's necessary to open a deflated file and see the deflated data or the deflated size, append .~~~ to the filename and open that. For example:

$ deflate file1    # Deflate a file
$ wc file1         # wc sees the contents of the original file
$ wc file1.~~~     # wc sees the contents of the deflated file
$ ls -l file1      # ls reports the size of the original file
$ ls -l file1.~~~  # ls reports the size of the deflated file

If a file opened for read doesn't have the deflate signature, inflator returns ENOENT, which gives the file to the next underlying filesystem. In this manner, inflator gets out of the way. Likewise if a file is opened for any write mode, inflator again returns ENOENT and gets out of the way. You can use the -v option to monitor the opens that inflator receives and which ones it accepts. You can use multiple -v options to obtain more verbosity.

By default, inflator maintains 8 inflation buffers that are used to decompress data. If more than 8 files are being processed at one time, the buffers are used as a cache. If a buffer is stolen away from a file, a subsequent read on that file requires the data to be reread and inflated again. A single -v prints a message each time a buffer is stolen, allowing you to tune your system. Since memory is often in short supply in embedded systems, you should use the minimum number of buffers needed to achieve acceptable performance.

The size of the buffers is determined by the deflate utility. It defaults to 8 KB, but may be set to any of 4 KB, 8 KB, 16 KB or 32 KB. In effect, the file is broken into smaller compression blocks instead of compressing the entire file as a whole. Without this, random seeking in the file would be a performance nightmare. On fast processors (200 MHz), the cost of inflating the data shouldn't be significant. On slower processors, it may be a performance issue as the inflation code competes for processor cycles.

Note: Running more than one pass-through filesystem or resource manager on overlapping pathname spaces might cause deadlocks.

Examples:

Take over / and inflate files that have been deflated when they're opened for reading by applications:

inflator

Take over / as above, but pass on any files under /tmp to any underlying filesystems without examining them in any way:

inflator / !/tmp

Take over directories where executables are usually located. Inflate files that have been deflated when they're opened for reading by applications:

inflator /sbin /bin /usr/sbin /usr/bin 

Take over / as above, but output some diagnostics (note the ampersand, which is needed to make inflator run in the background when -v is specified):

inflator -v &

Take over / as above, but output lots of diagnostics:

inflator -vvvvv &