aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 10:39:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 10:39:18 -0700
commit7272c30b6fbc051bf8a3f3c973e64f230c91c8b3 (patch)
tree0989d2d97282e1f00aaa3575d459fcb5ce0beac1 /include
parentMerge branch 'for-linus-for-3.6-rc1' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping (diff)
parentdm thin: commit before gathering status (diff)
downloadlinux-dev-7272c30b6fbc051bf8a3f3c973e64f230c91c8b3.tar.xz
linux-dev-7272c30b6fbc051bf8a3f3c973e64f230c91c8b3.zip
Merge tag 'dm-3.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
Pull device-mapper updates from Alasdair G Kergon: - Flip the thin target into new read-only or failed modes if errors are detected; - Handle chunk sizes that are not powers of two in the snapshot and thin targets; - Provide a way for userspace to avoid replacing an already-loaded multipath hardware handler while booting; - Reduce dm_thin_endio_hook slab size to avoid allocation failures; - Numerous small changes and cleanups to the code. * tag 'dm-3.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm: (63 commits) dm thin: commit before gathering status dm thin: add read only and fail io modes dm thin metadata: introduce dm_pool_abort_metadata dm thin metadata: introduce dm_pool_metadata_set_read_only dm persistent data: introduce dm_bm_set_read_only dm thin: reduce number of metadata commits dm thin metadata: add dm_thin_changed_this_transaction dm thin metadata: add format option to dm_pool_metadata_open dm thin metadata: tidy up open and format error paths dm thin metadata: only check incompat features on open dm thin metadata: remove duplicate pmd initialisation dm thin metadata: remove create parameter from __create_persistent_data_objects dm thin metadata: move __superblock_all_zeroes to __open_or_format_metadata dm thin metadata: remove nr_blocks arg from __create_persistent_data_objects dm thin metadata: split __open or format metadata dm thin metadata: use struct dm_pool_metadata members in __open_or_format_metadata dm thin metadata: zero unused superblock uuid dm thin metadata: lift __begin_transaction out of __write_initial_superblock dm thin metadata: move dm_commit_pool_metadata into __write_initial_superblock dm thin metadata: factor out __write_initial_superblock ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/device-mapper.h29
-rw-r--r--include/linux/dm-ioctl.h6
2 files changed, 26 insertions, 9 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 98f34b886f95..38d27a10aa5d 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -66,14 +66,13 @@ typedef int (*dm_request_endio_fn) (struct dm_target *ti,
struct request *clone, int error,
union map_info *map_context);
-typedef void (*dm_flush_fn) (struct dm_target *ti);
typedef void (*dm_presuspend_fn) (struct dm_target *ti);
typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
typedef int (*dm_preresume_fn) (struct dm_target *ti);
typedef void (*dm_resume_fn) (struct dm_target *ti);
typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
- char *result, unsigned int maxlen);
+ unsigned status_flags, char *result, unsigned maxlen);
typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv);
@@ -139,7 +138,6 @@ struct target_type {
dm_map_request_fn map_rq;
dm_endio_fn end_io;
dm_request_endio_fn rq_end_io;
- dm_flush_fn flush;
dm_presuspend_fn presuspend;
dm_postsuspend_fn postsuspend;
dm_preresume_fn preresume;
@@ -188,8 +186,8 @@ struct dm_target {
sector_t begin;
sector_t len;
- /* Always a power of 2 */
- sector_t split_io;
+ /* If non-zero, maximum size of I/O submitted to a target. */
+ uint32_t max_io_len;
/*
* A number of zero-length barrier requests that will be submitted
@@ -214,15 +212,27 @@ struct dm_target {
char *error;
/*
+ * Set if this target needs to receive flushes regardless of
+ * whether or not its underlying devices have support.
+ */
+ bool flush_supported:1;
+
+ /*
* Set if this target needs to receive discards regardless of
* whether or not its underlying devices have support.
*/
- unsigned discards_supported:1;
+ bool discards_supported:1;
+
+ /*
+ * Set if the target required discard request to be split
+ * on max_io_len boundary.
+ */
+ bool split_discard_requests:1;
/*
* Set if this target does not return zeroes on discarded blocks.
*/
- unsigned discard_zeroes_data_unsupported:1;
+ bool discard_zeroes_data_unsupported:1;
};
/* Each target can link one of these into the table */
@@ -360,6 +370,11 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback
int dm_table_complete(struct dm_table *t);
/*
+ * Target may require that it is never sent I/O larger than len.
+ */
+int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
+
+/*
* Table reference counting.
*/
struct dm_table *dm_get_live_table(struct mapped_device *md);
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 75fd5573516e..91e3a360f611 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
#define DM_VERSION_MAJOR 4
-#define DM_VERSION_MINOR 22
+#define DM_VERSION_MINOR 23
#define DM_VERSION_PATCHLEVEL 0
-#define DM_VERSION_EXTRA "-ioctl (2011-10-19)"
+#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -307,6 +307,8 @@ enum {
/*
* Set this to suspend without flushing queued ios.
+ * Also disables flushing uncommitted changes in the thin target before
+ * generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
*/
#define DM_NOFLUSH_FLAG (1 << 11) /* In */