* [PATCH 1/4] dm-latency: move struct mapped_device from dm.c to dm.h
@ 2015-02-26 6:41 Coly Li
0 siblings, 0 replies; only message in thread
From: Coly Li @ 2015-02-26 6:41 UTC (permalink / raw)
To: dm-devel; +Cc: Tao Ma, Robin Dong, Laurence Oberman, Alasdair Kergon
From: Coly Li <bosong.ly@alibaba-inc.com>
Because struct mapped_device will be referenced in dm-sysfs.c, move its
definition into dm.h which is included by dm-sysfs.c
Signed-off-by: Coly Li <bosong.ly@alibaba-inc.com>
Reviewed-by: Robin Dong <sanbai@alibaba-inc.com>
Reviewed-by: Tao Ma <boyu.mt@taobao.com>
---
drivers/md/dm.c | 89
--------------------------------------------------------------------------------------
drivers/md/dm.h | 106
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 98 insertions(+), 97 deletions(-)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 73f2880..e2532c8 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -20,7 +20,6 @@
#include <linux/hdreg.h>
#include <linux/delay.h>
#include <linux/wait.h>
-#include <linux/kthread.h>
#include <trace/events/block.h>
@@ -131,94 +130,6 @@ struct dm_table {
};
/*
- * Work processed by per-device workqueue.
- */
-struct mapped_device {
- struct srcu_struct io_barrier;
- struct mutex suspend_lock;
- atomic_t holders;
- atomic_t open_count;
-
- /*
- * The current mapping.
- * Use dm_get_live_table{_fast} or take suspend_lock for
- * dereference.
- */
- struct dm_table __rcu *map;
-
- struct list_head table_devices;
- struct mutex table_devices_lock;
-
- unsigned long flags;
-
- struct request_queue *queue;
- unsigned type;
- /* Protect queue and type against concurrent access. */
- struct mutex type_lock;
-
- 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;
- struct bio_list deferred;
- spinlock_t deferred_lock;
-
- /*
- * 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;
-
- /*
- * Event handling.
- */
- atomic_t event_nr;
- wait_queue_head_t eventq;
- atomic_t uevent_seq;
- struct list_head uevent_list;
- spinlock_t uevent_lock; /* Protect access to uevent_list */
-
- /*
- * freeze/thaw support require holding onto a super block
- */
- struct super_block *frozen_sb;
- struct block_device *bdev;
-
- /* forced geometry settings */
- struct hd_geometry geometry;
-
- /* kobject and completion */
- struct dm_kobject_holder kobj_holder;
-
- /* zero-length flush that will be cloned and submitted to targets */
- struct bio flush_bio;
-
- /* the number of internal suspends */
- unsigned internal_suspend_count;
-
- struct dm_stats stats;
-
- struct kthread_worker kworker;
- struct task_struct *kworker_task;
-};
-
-/*
* For mempools pre-allocation at the table loading time.
*/
struct dm_md_mempools {
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 59f53e7..3014667 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -17,6 +17,7 @@
#include <linux/hdreg.h>
#include <linux/completion.h>
#include <linux/kobject.h>
+#include <linux/kthread.h>
#include "dm-stats.h"
@@ -39,6 +40,103 @@
#define DM_TYPE_REQUEST_BASED 2
#define DM_TYPE_MQ_REQUEST_BASED 3
+
+/*
+ * sysfs interface
+ */
+struct dm_kobject_holder {
+ struct kobject kobj;
+ struct completion completion;
+};
+
+/*
+ * Work processed by per-device workqueue.
+ */
+struct mapped_device {
+ struct srcu_struct io_barrier;
+ struct mutex suspend_lock;
+ atomic_t holders;
+ atomic_t open_count;
+
+ /*
+ * The current mapping.
+ * Use dm_get_live_table{_fast} or take suspend_lock for
+ * dereference.
+ */
+ struct dm_table __rcu *map;
+
+ struct list_head table_devices;
+ struct mutex table_devices_lock;
+
+ unsigned long flags;
+
+ struct request_queue *queue;
+ unsigned type;
+ /* Protect queue and type against concurrent access. */
+ struct mutex type_lock;
+
+ 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;
+ struct bio_list deferred;
+ spinlock_t deferred_lock;
+
+ /*
+ * 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;
+
+ /*
+ * Event handling.
+ */
+ atomic_t event_nr;
+ wait_queue_head_t eventq;
+ atomic_t uevent_seq;
+ struct list_head uevent_list;
+ spinlock_t uevent_lock; /* Protect access to uevent_list */
+
+ /*
+ * freeze/thaw support require holding onto a super block
+ */
+ struct super_block *frozen_sb;
+ struct block_device *bdev;
+
+ /* forced geometry settings */
+ struct hd_geometry geometry;
+
+ /* kobject and completion */
+ struct dm_kobject_holder kobj_holder;
+
+ /* zero-length flush that will be cloned and submitted to targets */
+ struct bio flush_bio;
+
+ /* the number of internal suspends */
+ unsigned internal_suspend_count;
+
+ struct dm_stats stats;
+
+ struct kthread_worker kworker;
+ struct task_struct *kworker_task;
+};
+
/*
* List of devices that a metadevice uses and should open/close.
*/
@@ -158,14 +256,6 @@ void dm_deferred_remove(void);
int dm_interface_init(void);
void dm_interface_exit(void);
-/*
- * sysfs interface
- */
-struct dm_kobject_holder {
- struct kobject kobj;
- struct completion completion;
-};
-
static inline struct completion *dm_get_completion_from_kobject(struct
kobject *kobj)
{
return &container_of(kobj, struct dm_kobject_holder, kobj)->completion;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-26 6:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 6:41 [PATCH 1/4] dm-latency: move struct mapped_device from dm.c to dm.h Coly Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.