aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 13:39:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 13:39:18 -0400
commit7272c30b6fbc051bf8a3f3c973e64f230c91c8b3 (patch)
tree0989d2d97282e1f00aaa3575d459fcb5ce0beac1 /include/linux
parent6f51f51582e793ea13e7de7ed6b138f71c51784b (diff)
parent1f4e0ff07980820977f45d6a5dbc81d3bb9ce4d3 (diff)
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/linux')
-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,
66 struct request *clone, int error, 66 struct request *clone, int error,
67 union map_info *map_context); 67 union map_info *map_context);
68 68
69typedef void (*dm_flush_fn) (struct dm_target *ti);
70typedef void (*dm_presuspend_fn) (struct dm_target *ti); 69typedef void (*dm_presuspend_fn) (struct dm_target *ti);
71typedef void (*dm_postsuspend_fn) (struct dm_target *ti); 70typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
72typedef int (*dm_preresume_fn) (struct dm_target *ti); 71typedef int (*dm_preresume_fn) (struct dm_target *ti);
73typedef void (*dm_resume_fn) (struct dm_target *ti); 72typedef void (*dm_resume_fn) (struct dm_target *ti);
74 73
75typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, 74typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
76 char *result, unsigned int maxlen); 75 unsigned status_flags, char *result, unsigned maxlen);
77 76
78typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); 77typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv);
79 78
@@ -139,7 +138,6 @@ struct target_type {
139 dm_map_request_fn map_rq; 138 dm_map_request_fn map_rq;
140 dm_endio_fn end_io; 139 dm_endio_fn end_io;
141 dm_request_endio_fn rq_end_io; 140 dm_request_endio_fn rq_end_io;
142 dm_flush_fn flush;
143 dm_presuspend_fn presuspend; 141 dm_presuspend_fn presuspend;
144 dm_postsuspend_fn postsuspend; 142 dm_postsuspend_fn postsuspend;
145 dm_preresume_fn preresume; 143 dm_preresume_fn preresume;
@@ -188,8 +186,8 @@ struct dm_target {
188 sector_t begin; 186 sector_t begin;
189 sector_t len; 187 sector_t len;
190 188
191 /* Always a power of 2 */ 189 /* If non-zero, maximum size of I/O submitted to a target. */
192 sector_t split_io; 190 uint32_t max_io_len;
193 191
194 /* 192 /*
195 * A number of zero-length barrier requests that will be submitted 193 * A number of zero-length barrier requests that will be submitted
@@ -214,15 +212,27 @@ struct dm_target {
214 char *error; 212 char *error;
215 213
216 /* 214 /*
215 * Set if this target needs to receive flushes regardless of
216 * whether or not its underlying devices have support.
217 */
218 bool flush_supported:1;
219
220 /*
217 * Set if this target needs to receive discards regardless of 221 * Set if this target needs to receive discards regardless of
218 * whether or not its underlying devices have support. 222 * whether or not its underlying devices have support.
219 */ 223 */
220 unsigned discards_supported:1; 224 bool discards_supported:1;
225
226 /*
227 * Set if the target required discard request to be split
228 * on max_io_len boundary.
229 */
230 bool split_discard_requests:1;
221 231
222 /* 232 /*
223 * Set if this target does not return zeroes on discarded blocks. 233 * Set if this target does not return zeroes on discarded blocks.
224 */ 234 */
225 unsigned discard_zeroes_data_unsupported:1; 235 bool discard_zeroes_data_unsupported:1;
226}; 236};
227 237
228/* Each target can link one of these into the table */ 238/* 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
360int dm_table_complete(struct dm_table *t); 370int dm_table_complete(struct dm_table *t);
361 371
362/* 372/*
373 * Target may require that it is never sent I/O larger than len.
374 */
375int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
376
377/*
363 * Table reference counting. 378 * Table reference counting.
364 */ 379 */
365struct dm_table *dm_get_live_table(struct mapped_device *md); 380struct 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 {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 22 270#define DM_VERSION_MINOR 23
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2011-10-19)" 272#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -307,6 +307,8 @@ enum {
307 307
308/* 308/*
309 * Set this to suspend without flushing queued ios. 309 * Set this to suspend without flushing queued ios.
310 * Also disables flushing uncommitted changes in the thin target before
311 * generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
310 */ 312 */
311#define DM_NOFLUSH_FLAG (1 << 11) /* In */ 313#define DM_NOFLUSH_FLAG (1 << 11) /* In */
312 314