-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'dm-4.8-changes' of git://git.kernel.org/pub/scm/linux/kern…
…el/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - initially based on Jens' 'for-4.8/core' (given all the flag churn) and later merged with 'for-4.8/core' to pickup the QUEUE_FLAG_DAX commits that DM depends on to provide its DAX support - clean up the bio-based vs request-based DM core code by moving the request-based DM core code out to dm-rq.[hc] - reinstate bio-based support in the DM multipath target (done with the idea that fast storage like NVMe over Fabrics could benefit) -- while preserving support for request_fn and blk-mq request-based DM mpath - SCSI and DM multipath persistent reservation fixes that were coordinated with Martin Petersen. - the DM raid target saw the most extensive change this cycle; it now provides reshape and takeover support (by layering ontop of the corresponding MD capabilities) - DAX support for DM core and the linear, stripe and error targets - a DM thin-provisioning block discard vs allocation race fix that addresses potential for corruption - a stable fix for DM verity-fec's block calculation during decode - a few cleanups and fixes to DM core and various targets * tag 'dm-4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (73 commits) dm: allow bio-based table to be upgraded to bio-based with DAX support dm snap: add fake origin_direct_access dm stripe: add DAX support dm error: add DAX support dm linear: add DAX support dm: add infrastructure for DAX support dm thin: fix a race condition between discarding and provisioning a block dm btree: fix a bug in dm_btree_find_next_single() dm raid: fix random optimal_io_size for raid0 dm raid: address checkpatch.pl complaints dm: call PR reserve/unreserve on each underlying device sd: don't use the ALL_TG_PT bit for reservations dm: fix second blk_delay_queue() parameter to be in msec units not jiffies dm raid: change logical functions to actually return bool dm raid: use rdev_for_each in status dm raid: use rs->raid_disks to avoid memory leaks on free dm raid: support delta_disks for raid1, fix table output dm raid: enhance reshape check and factor out reshape setup dm raid: allow resize during recovery dm raid: fix rs_is_recovering() to allow for lvextend ...
- Loading branch information
Showing
29 changed files
with
4,638 additions
and
1,975 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "dm.h" | ||
#include "dm-core.h" | ||
|
||
/* | ||
* The kobject release method must not be placed in the module itself, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/* | ||
* Internal header file _only_ for device mapper core | ||
* | ||
* Copyright (C) 2016 Red Hat, Inc. All rights reserved. | ||
* | ||
* This file is released under the LGPL. | ||
*/ | ||
|
||
#ifndef DM_CORE_INTERNAL_H | ||
#define DM_CORE_INTERNAL_H | ||
|
||
#include <linux/kthread.h> | ||
#include <linux/ktime.h> | ||
#include <linux/blk-mq.h> | ||
|
||
#include <trace/events/block.h> | ||
|
||
#include "dm.h" | ||
|
||
#define DM_RESERVED_MAX_IOS 1024 | ||
|
||
struct dm_kobject_holder { | ||
struct kobject kobj; | ||
struct completion completion; | ||
}; | ||
|
||
/* | ||
* DM core internal structure that used directly by dm.c and dm-rq.c | ||
* DM targets must _not_ deference a mapped_device to directly access its members! | ||
*/ | ||
struct mapped_device { | ||
struct srcu_struct io_barrier; | ||
struct mutex suspend_lock; | ||
|
||
/* | ||
* The current mapping (struct dm_table *). | ||
* Use dm_get_live_table{_fast} or take suspend_lock for | ||
* dereference. | ||
*/ | ||
void __rcu *map; | ||
|
||
struct list_head table_devices; | ||
struct mutex table_devices_lock; | ||
|
||
unsigned long flags; | ||
|
||
struct request_queue *queue; | ||
int numa_node_id; | ||
|
||
unsigned type; | ||
/* Protect queue and type against concurrent access. */ | ||
struct mutex type_lock; | ||
|
||
atomic_t holders; | ||
atomic_t open_count; | ||
|
||
struct dm_target *immutable_target; | ||
struct target_type *immutable_target_type; | ||
|
||
struct gendisk *disk; | ||
char name[16]; | ||
|
||
void *interface_ptr; | ||
|
||
/* | ||
* A list of ios that arrived while we were suspended. | ||
*/ | ||
atomic_t pending[2]; | ||
wait_queue_head_t wait; | ||
struct work_struct work; | ||
spinlock_t deferred_lock; | ||
struct bio_list deferred; | ||
|
||
/* | ||
* Event handling. | ||
*/ | ||
wait_queue_head_t eventq; | ||
atomic_t event_nr; | ||
atomic_t uevent_seq; | ||
struct list_head uevent_list; | ||
spinlock_t uevent_lock; /* Protect access to uevent_list */ | ||
|
||
/* the number of internal suspends */ | ||
unsigned internal_suspend_count; | ||
|
||
/* | ||
* Processing queue (flush) | ||
*/ | ||
struct workqueue_struct *wq; | ||
|
||
/* | ||
* io objects are allocated from here. | ||
*/ | ||
mempool_t *io_pool; | ||
mempool_t *rq_pool; | ||
|
||
struct bio_set *bs; | ||
|
||
/* | ||
* freeze/thaw support require holding onto a super block | ||
*/ | ||
struct super_block *frozen_sb; | ||
|
||
/* forced geometry settings */ | ||
struct hd_geometry geometry; | ||
|
||
struct block_device *bdev; | ||
|
||
/* kobject and completion */ | ||
struct dm_kobject_holder kobj_holder; | ||
|
||
/* zero-length flush that will be cloned and submitted to targets */ | ||
struct bio flush_bio; | ||
|
||
struct dm_stats stats; | ||
|
||
struct kthread_worker kworker; | ||
struct task_struct *kworker_task; | ||
|
||
/* for request-based merge heuristic in dm_request_fn() */ | ||
unsigned seq_rq_merge_deadline_usecs; | ||
int last_rq_rw; | ||
sector_t last_rq_pos; | ||
ktime_t last_rq_start_time; | ||
|
||
/* for blk-mq request-based DM support */ | ||
struct blk_mq_tag_set *tag_set; | ||
bool use_blk_mq:1; | ||
bool init_tio_pdu:1; | ||
}; | ||
|
||
void dm_init_md_queue(struct mapped_device *md); | ||
void dm_init_normal_md_queue(struct mapped_device *md); | ||
int md_in_flight(struct mapped_device *md); | ||
void disable_write_same(struct mapped_device *md); | ||
|
||
static inline struct completion *dm_get_completion_from_kobject(struct kobject *kobj) | ||
{ | ||
return &container_of(kobj, struct dm_kobject_holder, kobj)->completion; | ||
} | ||
|
||
unsigned __dm_get_module_param(unsigned *module_param, unsigned def, unsigned max); | ||
|
||
static inline bool dm_message_test_buffer_overflow(char *result, unsigned maxlen) | ||
{ | ||
return !maxlen || strlen(result) + 1 >= maxlen; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.