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

2016-09-23 Thread Konstantin Khorenko
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 
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 

https://jira.sw.ru/browse/PSBM-50727

(cherry picked from commit 1d3aa6f683b1c1a813a63339d7309cff58ba4531)
Signed-off-by: Andrey Ryabinin 
---
 drivers/md/dm.c | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

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(>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);
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel


[Devel] [PATCH RHEL7 COMMIT] ms/dm: remove dummy definition of 'struct dm_table' from dm-ioctl.c

2016-09-23 Thread Konstantin Khorenko
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 1347427ba3370f15348561cc4ca46c402b85c984
Author: Andrey Ryabinin 
Date:   Fri Sep 23 18:15:12 2016 +0400

ms/dm: remove dummy definition of 'struct dm_table' from dm-ioctl.c

There is no need for it.

https://jira.sw.ru/browse/PSBM-50727

Signed-off-by: Andrey Ryabinin 
---
 drivers/md/dm-ioctl.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 720ceeb..0fe4233 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -36,14 +36,6 @@ struct hash_cell {
struct dm_table *new_map;
 };
 
-/*
- * A dummy definition to make RCU happy.
- * struct dm_table should never be dereferenced in this file.
- */
-struct dm_table {
-   int undefined__;
-};
-
 struct vers_iter {
 size_t param_size;
 struct dm_target_versions *vers, *old_vers;
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel