Documentation/device-mapper/kcopyd

Chinese translated version of Documentation/filesystems/ecryptfs


If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.




Chinese maintainer: 朱司仪  331954465@qq.com
---------------------------------------------------------------------
Documentation/device-mapper/kcopyd的中文翻译




如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。


中文版维护者: 朱司仪  331954465@qq.com
中文版翻译者: 朱司仪  331954465@qq.com
中文版校译者: 朱司仪  331954465@qq.com




以下为正文
---------------------------------------------------------------------
                      =============
                      Documentation/device-mapper/kcopyd
                      =============
======


Kcopyd provides the ability to copy a range of sectors from one block-device
to one or more other block-devices, with an asynchronous completion
notification. It is used by dm-snapshot and dm-mirror.


Kcopyd提供复制能力的一系列领域,从一个块设备
到一个或多个其他块设备,在一个异步完成
通知。它被使用于dm-snapshot和dm-mirror。




Users of kcopyd must first create a client and indicate how many memory pages
to set aside for their copy jobs. This is done with a call to
kcopyd_client_create().


   int kcopyd_client_create(unsigned int num_pages,
                            struct kcopyd_client **result);




用户的kcopyd必须先创建一个客户端,并说明有多少内存页
预留给他们的复印操作。这是通过调用kcopyd_client_create()来实现的。

   int kcopyd_client_create(unsigned int num_pages,
                            struct kcopyd_client **result);




To start a copy job, the user must set up io_region structures to describe
the source and destinations of the copy. Each io_region indicates a
block-device along with the starting sector and size of the region. The source
of the copy is given as one io_region structure, and the destinations of the
copy are given as an array of io_region structures.


   struct io_region {
      struct block_device *bdev;
      sector_t sector;
      sector_t count;
   };


   
要开始复印操作,用户必须设置了io_region结构来描述源和目的地址的副本。
每个io_region表示块的移动设备,以及与该区域的起始扇区和大小。源
的副本被给定为一个的io_region结构和目的地之间的副本作为数组的io_region结构。


   struct io_region {
      struct block_device *bdev;
      sector_t sector;
      sector_t count;
   };
   
   
   
To start the copy, the user calls kcopyd_copy(), passing in the client
pointer, pointers to the source and destination io_regions, the name of a
completion callback routine, and a pointer to some context data for the copy.


   int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
                   unsigned int num_dests, struct io_region *dests,
                   unsigned int flags, kcopyd_notify_fn fn, void *context);


   typedef void (*kcopyd_notify_fn)(int read_err, unsigned int write_err,
   void *context);



要开始复制前,用户需调用kcopyd_copy(),通过在客户端
指针,指针到源和目标io_regions的,名称
完成回调例程,以及一些上下文数据副本的指针。


   int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
                   unsigned int num_dests, struct io_region *dests,
                   unsigned int flags, kcopyd_notify_fn fn, void *context);


   typedef void (*kcopyd_notify_fn)(int read_err, unsigned int write_err,
   void *context);



When the copy completes, kcopyd will call the user's completion routine,
passing back the user's context pointer. It will also indicate if a read or
write error occurred during the copy.




当复制完成后,kcopyd将调用用户的完成例程,
传回用户的上下文指针。它也表明,如果一个读或
写在复制过程中发生错误。




When a user is done with all their copy jobs, they should call
kcopyd_client_destroy() to delete the kcopyd client, which will release the
associated memory pages.




当用户完成了所有的复印作业,他们应该传输指令到
kcopyd_client_destroy()来删除kcopyd的客户端,这将释放
相关的内存页。


   void kcopyd_client_destroy(struct kcopyd_client *kc);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值