Category: Device mapper

Linux kernel DM map_info接口改为per-bio data

最近在将一个之前版本的 Linux DM(device mapper)驱动移植到新的 3.18 版本 Linux kernel 上出现编译报错,提示 DM target_type 中的 dm_map_fn 等成员函数指针类型不正确。 看看老版本上 dm_map_fn 函数指针的声明: typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, union map_info *map_context); 这个是新的 3.18 版本 Linux 上的形式: typedef int (*dm_map_fn) (struct dm_ […]

使用Linux kernel dm-mirror实现设备间同步

本文同步自(最佳显示效果请点击):https://zohead.com/archives/dm-mirror-sync-device/ 在某些场合下,用户需要在 Linux 系统中实现直接的块设备同步方式,需要将一个裸设备中的内容完全同步到另一个裸设备,有时甚至需要能自定义位移和大小进行同步,这时 Linux 自带的 dm-mirror 模块很可能是比较好的实现方案。 dm-mirror 是 Linux kernel 中 device-mapper(DM)模块(device-mapper 内部称为 target)中的一个,可以实现多个块设备间的数据同步,并支持通过 dm-log 模块保存同步时 […]