mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
dm: introduce merge_bvec_fn
Introduce a bvec merge function for device mapper devices for dynamic size restrictions. This code ensures the requested biovec lies within a single target and then calls a target-specific function to check against any constraints imposed by underlying devices. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
parent
92e868122e
commit
f6fccb1213
3 changed files with 52 additions and 2 deletions
|
@ -9,11 +9,13 @@
|
|||
#define _LINUX_DEVICE_MAPPER_H
|
||||
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
struct dm_target;
|
||||
struct dm_table;
|
||||
struct dm_dev;
|
||||
struct mapped_device;
|
||||
struct bio_vec;
|
||||
|
||||
typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t;
|
||||
|
||||
|
@ -72,6 +74,9 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode,
|
|||
struct file *filp, unsigned int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
|
||||
struct bio_vec *biovec, int max_size);
|
||||
|
||||
void dm_error(const char *message);
|
||||
|
||||
/*
|
||||
|
@ -107,6 +112,7 @@ struct target_type {
|
|||
dm_status_fn status;
|
||||
dm_message_fn message;
|
||||
dm_ioctl_fn ioctl;
|
||||
dm_merge_fn merge;
|
||||
};
|
||||
|
||||
struct io_restrictions {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue