Documentation/admin-guide/device-mapper/kcopyd.rst

Source file repositories/reference/linux-study-clean/Documentation/admin-guide/device-mapper/kcopyd.rst

File Facts

System
Linux kernel
Corpus path
Documentation/admin-guide/device-mapper/kcopyd.rst
Extension
.rst
Size
1911 bytes
Lines
48
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

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);

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.

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::

   void kcopyd_client_destroy(struct kcopyd_client *kc);

Annotation

Implementation Notes