[Devel,RHEL7,COMMIT] ms/dm: remove dummy definition of 'struct dm_table'

Submitted by Konstantin Khorenko on Sept. 23, 2016, 2:15 p.m.

Details

Message ID 201609231415.u8NEFBjO018872@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Sept. 23, 2016, 2:15 p.m.
The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.9
------>
commit 718f12861b3e5d7494b17e6a753cdef8b1f0a5f4
Author: Mike Snitzer <snitzer@redhat.com>
Date:   Fri Sep 23 18:15:11 2016 +0400

    ms/dm: remove dummy definition of 'struct dm_table'
    
    Change the map pointer in 'struct mapped_device' from 'struct dm_table
    __rcu *' to 'void __rcu *' to avoid the need for the dummy definition.
    
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    
    https://jira.sw.ru/browse/PSBM-50727
    
    (cherry picked from commit 1d3aa6f683b1c1a813a63339d7309cff58ba4531)
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 drivers/md/dm.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index d9a24c9..a7993cf 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -129,14 +129,6 @@  EXPORT_SYMBOL_GPL(dm_get_rq_mapinfo);
 #define DMF_SUSPENDED_INTERNALLY 8
 
 /*
- * A dummy definition to make RCU happy.
- * struct dm_table should never be dereferenced in this file.
- */
-struct dm_table {
-	int undefined__;
-};
-
-/*
  * Work processed by per-device workqueue.
  */
 struct mapped_device {
@@ -146,11 +138,11 @@  struct mapped_device {
 	atomic_t open_count;
 
 	/*
-	 * The current mapping.
+	 * The current mapping (struct dm_table *).
 	 * Use dm_get_live_table{_fast} or take suspend_lock for
 	 * dereference.
 	 */
-	struct dm_table __rcu *map;
+	void __rcu *map;
 
 	struct list_head table_devices;
 	struct mutex table_devices_lock;
@@ -2694,7 +2686,7 @@  static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t,
 	merge_is_optional = dm_table_merge_is_optional(t);
 
 	old_map = rcu_dereference_protected(md->map, lockdep_is_held(&md->suspend_lock));
-	rcu_assign_pointer(md->map, t);
+	rcu_assign_pointer(md->map, (void *)t);
 	md->immutable_target_type = dm_table_get_immutable_target_type(t);
 
 	dm_table_set_restrictions(t, q, limits);