Linux Device Mapper development
 help / color / mirror / Atom feed
* [PATCH 3/4] dm: move dm_table to dm-core.h
@ 2019-02-14 15:00 Mikulas Patocka
  0 siblings, 0 replies; only message in thread
From: Mikulas Patocka @ 2019-02-14 15:00 UTC (permalink / raw)
  To: Mike Snitzer, Alasdair G Kergon; +Cc: dm-devel, Mikulas Patocka

[-- Attachment #1: move-dm_table-to-dm-core.patch --]
[-- Type: text/plain, Size: 3195 bytes --]

Move the definition of struct dm_table from dm-table.c to dm-core.h - so,
that it can be used by dm.c.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/md/dm-core.h  |   45 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/md/dm-table.c |   44 --------------------------------------------
 2 files changed, 45 insertions(+), 44 deletions(-)

Index: linux-2.6/drivers/md/dm-core.h
===================================================================
--- linux-2.6.orig/drivers/md/dm-core.h	2019-02-12 15:26:19.000000000 +0100
+++ linux-2.6/drivers/md/dm-core.h	2019-02-12 15:32:24.000000000 +0100
@@ -115,6 +115,51 @@ struct mapped_device {
 	struct srcu_struct io_barrier;
 };
 
+#define MAX_DEPTH 16
+#define NODE_SIZE L1_CACHE_BYTES
+#define KEYS_PER_NODE (NODE_SIZE / sizeof(sector_t))
+#define CHILDREN_PER_NODE (KEYS_PER_NODE + 1)
+
+struct dm_table {
+	struct mapped_device *md;
+	enum dm_queue_mode type;
+
+	/* btree table */
+	unsigned int depth;
+	unsigned int counts[MAX_DEPTH];	/* in nodes */
+	sector_t *index[MAX_DEPTH];
+
+	unsigned int num_targets;
+	unsigned int num_allocated;
+	sector_t *highs;
+	struct dm_target *targets;
+
+	struct target_type *immutable_target_type;
+
+	bool integrity_supported:1;
+	bool singleton:1;
+	unsigned integrity_added:1;
+
+	/*
+	 * Indicates the rw permissions for the new logical
+	 * device.  This should be a combination of FMODE_READ
+	 * and FMODE_WRITE.
+	 */
+	fmode_t mode;
+
+	/* a list of devices used by this table */
+	struct list_head devices;
+
+	/* events get handed up using this callback */
+	void (*event_fn)(void *);
+	void *event_context;
+
+	struct dm_md_mempools *mempools;
+
+	struct list_head target_callbacks;
+};
+
+
 void disable_write_same(struct mapped_device *md);
 void disable_write_zeroes(struct mapped_device *md);
 
Index: linux-2.6/drivers/md/dm-table.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-table.c	2019-02-12 15:26:19.000000000 +0100
+++ linux-2.6/drivers/md/dm-table.c	2019-02-12 15:32:24.000000000 +0100
@@ -24,50 +24,6 @@
 
 #define DM_MSG_PREFIX "table"
 
-#define MAX_DEPTH 16
-#define NODE_SIZE L1_CACHE_BYTES
-#define KEYS_PER_NODE (NODE_SIZE / sizeof(sector_t))
-#define CHILDREN_PER_NODE (KEYS_PER_NODE + 1)
-
-struct dm_table {
-	struct mapped_device *md;
-	enum dm_queue_mode type;
-
-	/* btree table */
-	unsigned int depth;
-	unsigned int counts[MAX_DEPTH];	/* in nodes */
-	sector_t *index[MAX_DEPTH];
-
-	unsigned int num_targets;
-	unsigned int num_allocated;
-	sector_t *highs;
-	struct dm_target *targets;
-
-	struct target_type *immutable_target_type;
-
-	bool integrity_supported:1;
-	bool singleton:1;
-	unsigned integrity_added:1;
-
-	/*
-	 * Indicates the rw permissions for the new logical
-	 * device.  This should be a combination of FMODE_READ
-	 * and FMODE_WRITE.
-	 */
-	fmode_t mode;
-
-	/* a list of devices used by this table */
-	struct list_head devices;
-
-	/* events get handed up using this callback */
-	void (*event_fn)(void *);
-	void *event_context;
-
-	struct dm_md_mempools *mempools;
-
-	struct list_head target_callbacks;
-};
-
 /*
  * Similar to ceiling(log_size(n))
  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-14 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-14 15:00 [PATCH 3/4] dm: move dm_table to dm-core.h Mikulas Patocka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox