inode checkpoints
Artem B. Bityuckiy
abityuckiy at yandex.ru
Mon Oct 4 10:18:15 EDT 2004
Of course, ICPs shouldn't contain full node headers, only those
information which is needed for the inode cache creation should be includes.
I'm imaging the following data structures for ICPs...
------------------------------------------------------------
Regular file inode checkpoints (FICP)
------------------------------------------------------------
The FICP are represented by the following structure:
struct jffs2_raw_ficp {
/* standard JFFS2 node header fields */
jint32_t magic;
jint32_t nodetype;
jint32_t totlen;
jint32_t hdr_crc;
jint32_t version; /* the checkpoint version */
jint32_t highest_version; /* the highest version of node,
described by this checkpoint */
jint32_t lowest_version; /* the lowest version of node, described
by this checkpoint */
jint32_t dsize; /* checkpoint's data size in uncompressed form */
jint32_t ino; /* the inode described by this checkpoint */
jint32_t num; /* the number of nodes, described by this checkpoint */
uint8_t compr; /* the checkpoint node data compression type;
standard values are used */
uint8_t unused[3]; /* just padding */
jint32_t data_crc; /* the CRC checksum of the checkpoint data */
jint32_t node_crc; /* the CRC checksum of the checkpoint object
without data */
struct jffs2_raw_ficp_entry data[0]; /* */
};
Each node, described by the FICP is represented by the following
structure (fields are the same as in the jffs2_raw_inode structure).
struct jffs2_raw_ficp_entry {
jint32_t offset; /* the offset in the regular file, to which the
changes which are introduced by this node belong */
jint32_t version; /* the node version */
jint32_t size; /* size of the data belonging to the node (in
uncompressed form) */
};
------------------------------------------------------------
Directory inode checkpoints (DICP)
------------------------------------------------------------
The directory checkpoint is represented by the following structure:
struct jffs2_raw_dicp {
/* standard JFFS2 node header fields */
jint32_t magic;
jint32_t nodetype;
jint32_t totlen;
jint32_t hdr_crc;
jint32_t version; /* the checkpoint version */
jint32_t highest_version; /* the lowest version of the direntry
node, described by this checkpoint */
jint32_t lowest_version; /* the lowest version of the direntry
node, described by this checkpoint */
jint32_t dsize; /* checkpoint's data size in uncompressed form */
jint32_t ino /* the inode number of directory, which is described
by this checkpoint */;
jint32_t num; /* the number of direntry nodes, described by this
checkpoint */
uint8_t compr; /* the checkpoint node data compression type;
standard values are used */
uint8_t unused[3]; /* ust padding */
jint32_t data_crc; /* the CRC checksum of the checkpoint data */
jint32_t node_crc; /* the CRC checksum of the checkpoint object
without data */
struct jffs2_raw_dicp_entry data[0];
};
Each direntry node, described by the directory checkpoint is represented
by the following structure (fields are the same as in the
jffs2_raw_dirent structure).
struct jffs2_raw_dicp_entry {
jint32_t ino; /* the inode number of the target file (i.e., of the
file to which this direntry */
jint32_t version; /* the direntry node version */
uint8_t size; /* the direntry name length */
uint8_t type; /* the type of the target file (the same as the type
field in the struct */
uint8_t name[0] /* the direntry name */
} __attribute__((packed));
----------------------------------------------------
For FICP and DICP new node type identifiers ought to be introduced.
These identifiers are defined as:
#define JFFS2_NODETYPE_FICP \
(JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 5)
#define JFFS2_NODETYPE_DICP \
(JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
----------------------------------------------------
Comments ?
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list