Chapter 41. Configuration

Configuration Options

The format and footprint of the filesystem are controlled by a number of configuration options, described in the following sections.

General Options

The following options define the version and revision of the filesystem.

CYGNUM_FS_MMFS_VERSION

This is the version of the filesystem supported.

Default value: 1

CYGNUM_FS_MMFS_REVISION

This is the revision of the filesystem supported.

Default value: 0

Formatting Options

These options control the formatting of an MMFS disk. They are only used when a filesystem is formatted. Under normal circumstances the filesystem will fetch these values from the disk volume label.

CYGNUM_FS_MMFS_BLOCK_SIZE

This option defines the size of filesystem blocks. The value is defined in KiB and must be a power of 2.

Default value: 256

CYGNUM_FS_MMFS_ROOTDIR_SIZE

This option defines the size of the root directory in blocks. Since all files are contained in this directory, its size gives a hard limit to the number of files that the filesystem may contain.

Default value: 1

CYGNUM_FS_MMFS_BAT_SIZE

This option defines the size of the Block Allocation Tables used to store the addresses of file data blocks. This gives a hard upper limit on the size of a file.

Default value: 2

CYGNUM_FS_MMFS_BAT_COUNT

This option defines the number of BATs allocated in the filesystem. The default is to define 200 BATs.

Default value: 200

Footprint Options

These options control the memory footprint and other parameters for an active filesystem.

CYGNUM_FS_MMFS_FILE_COUNT

This option defines the maximum number of open files supported by the filesystem. This depends on the expected number of data streams, plus any random access files, that may be open simultaneously.

Default value: 4

CYGNUM_FS_MMFS_DIRNODE_COUNT

This option defines the maximum number of cached directory entries. At least one is required for each open file, plus a few for handling other filesystem operations such as renaming or deleting.

Default value: CYGNUM_FS_MMFS_FILE_COUNT+4

CYGNUM_FS_MMFS_MULTI_BUFFER

This defines the level of per-file multi-buffering. During streaming the filesystem will read ahead and write behind by this number of data blocks.

Default value: 2

CYGNUM_FS_MMFS_DATA_CACHE_SIZE

This defines the amount of memory occupied by the data cache. The default value is calculated from the multi-buffering level, and the number of files.

Default value: (CYGNUM_FS_MMFS_MULTI_BUFFER+2)*CYGNUM_FS_MMFS_FILE_COUNT*CYGNUM_FS_MMFS_BLOCK_SIZE

CYGNUM_FS_MMFS_META_CACHE_SIZE

This defines the amount of memory occupied by the metadata cache. The default value is calculated from the number of files plus an overhead to support the freelist and directory scanning.

Default value: (CYGNUM_FS_MMFS_FILE_COUNT+6)*CYGNUM_FS_MMFS_META_BLOCK_SIZE

CYGNUM_FS_MMFS_META_BLOCK_SIZE

This defines the size of a metadata cache block. These are used to contain portions of the the directory, freelist and BATs.

Default value: 4

CYGNUM_FS_MMFS_DISKIO_PRIORITY

This defines the priority of the disk IO thread. This thread should generally run at a high priority since it does very little but it is vital to the performance of the filesystem.

Default value: 4

CYGNUM_FS_MMFS_FLUSH_INTERVAL

This defines the interval at which metadata cache blocks are flushed. Each time this interval expires the oldest dirty block in the cache is written to disk. This allows dirty data to be trickled out to disk without severely impacting streaming transfers.

Default value: 10

CYGNUM_FS_MMFS_FLUSH_PERIOD

This defines the cache flush period in multiples of the cache flush interval. Each time this period expires, the entire metadata cache will be flushed to disk. The action of the flush interval will generally cause this operation to do nothing.

Default value: 6

2017-02-09
Documentation license for this page: eCosPro License