f2fs学习笔记之四:冷热数据分离

多路日志的原理

多路日志的相关数据结构

/*
 * For SIT manager
 *
 * By default, there are 6 active log areas across the whole main area.
 * When considering hot and cold data separation to reduce cleaning overhead,
 * we split 3 for data logs and 3 for node logs as hot, warm, and cold types,
 * respectively.
 * In the current design, you should not change the numbers intentionally.
 * Instead, as a mount option such as active_logs=x, you can use 2, 4, and 6
 * logs individually according to the underlying devices. (default: 6)
 * Just in case, on-disk layout covers maximum 16 logs that consist of 8 for
 * data and 8 for node logs.
 */
#define NR_CURSEG_DATA_TYPE     (3)
#define NR_CURSEG_NODE_TYPE     (3)
#define NR_CURSEG_TYPE  (NR_CURSEG_DATA_TYPE + NR_CURSEG_NODE_TYPE)

enum {
        CURSEG_HOT_DATA = 0,    /* directory entry blocks */
        CURSEG_WARM_DATA,       /* data blocks */
        CURSEG_COLD_DATA,       /* multimedia or GCed data blocks */
        CURSEG_HOT_NODE,        /* direct node blocks of directory files */
        CURSEG_WARM_NODE,       /* direct node blocks of normal files */
        CURSEG_COLD_NODE,       /* indirect node blocks */
        NO_CHECK_TYPE,
};

多路日志的协作

猜你喜欢

转载自blog.51cto.com/xiamachao/2348987