Initialize main structures

The mounting of a JFFS2 filesystem begins with memory allocations. JFFS2 allocates memory for jffs2_sb_info (called c pointer in almost every function). This is the main structure of the filesystem.

JFFS2 stores some often used information in memory about inodes on flash, named inode cache (c->inocache_list). Inode cache is an array of jffs2_inode_cache pointers. The length of this array is defined by INOCACHE_HASHSIZE macro (it can be changed only in compilation time), the default value of the macro is 128.

Figure 2: Inode cache
\includegraphics[scale=0.5]{dia/inocache_list.eps}

In JFFS2 every eraseblock has an unique jffs2_eraseblock (in short jeb) representation in memory. This structure describes the status of the eraseblock (offset, size counters, etc.) JFFS2 allocates memory to store the jebs in an array and the pointer of the array is c->blocks.



Havasi Ferenc 2005-12-22