Flashcache(混合存储)-结构

1.概述

什么是flashcache?flashcache是Facebook的一个开源项目。

将这个单词拆开:flash + cache,可以理解为用flash做cache。flash即SSD,所以flashcache是三层结构,实现的是一种混合存储方式。



2.Device-Mapper

Flashcache是基于Device-Mapper的,所以要理解Flashcache,必须先了解Device-Mapper,至少是Flashcache使用到的数据结构和接口

Device-Mapper Framework

详见: http://www.ibm.com/developerworks/cn/linux/l-devmapper/


2.1.DM

flashcache挂载在这个模块上。

2.2.Target

相当于一个逻辑句柄,DM模块通过此对象流入Flashcache。

Structure

结构如下(3.17 include/linux/device-mapper.h)

195 struct dm_target {
196         struct dm_table *table;
197         <span style="color:#ff6666;">struct target_type *type;</span>
198 
199         /* target limits */
200         sector_t begin;
201         sector_t len;
202 
203         /* If non-zero, maximum size of I/O submitted to a target. */
204         uint32_t max_io_len;
205 
206         /*
207          * A number of zero-length barrier bios that will be submitted
208          * to the target for the purpose of flushing cache.
209          *
210          * The bio number can be accessed with dm_bio_get_target_bio_nr.
211          * It is a responsibility of the target driver to remap these bios
212          * to the real underlying devices.
213          */
214         unsigned num_flush_bios;
215 
216         /*
217          * The number of discard bios that will be submitted to the target.
218          * The bio number can be accessed with dm_bio_get_target_bio_nr.
219          */
220         unsigned num_discard_bios;
221 
222         /*
223          * The number of WRITE SAME bios that will be submitted to the target.
224          * The bio number can be accessed with dm_bio_get_target_bio_nr.
225          */
226         unsigned num_write_same_bios;
227 
228      
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值