dm.c (115485e83f497fdf9b4bf779038cfe4e141292a9) | dm.c (1d3aa6f683b1c1a813a63339d7309cff58ba4531) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 107 unchanged lines hidden (view full) --- 116#define DMF_FROZEN 2 117#define DMF_FREEING 3 118#define DMF_DELETING 4 119#define DMF_NOFLUSH_SUSPENDING 5 120#define DMF_DEFERRED_REMOVE 6 121#define DMF_SUSPENDED_INTERNALLY 7 122 123/* | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 107 unchanged lines hidden (view full) --- 116#define DMF_FROZEN 2 117#define DMF_FREEING 3 118#define DMF_DELETING 4 119#define DMF_NOFLUSH_SUSPENDING 5 120#define DMF_DEFERRED_REMOVE 6 121#define DMF_SUSPENDED_INTERNALLY 7 122 123/* |
124 * A dummy definition to make RCU happy. 125 * struct dm_table should never be dereferenced in this file. 126 */ 127struct dm_table { 128 int undefined__; 129}; 130 131/* | |
132 * Work processed by per-device workqueue. 133 */ 134struct mapped_device { 135 struct srcu_struct io_barrier; 136 struct mutex suspend_lock; 137 atomic_t holders; 138 atomic_t open_count; 139 140 /* | 124 * Work processed by per-device workqueue. 125 */ 126struct mapped_device { 127 struct srcu_struct io_barrier; 128 struct mutex suspend_lock; 129 atomic_t holders; 130 atomic_t open_count; 131 132 /* |
141 * The current mapping. | 133 * The current mapping (struct dm_table *). |
142 * Use dm_get_live_table{_fast} or take suspend_lock for 143 * dereference. 144 */ | 134 * Use dm_get_live_table{_fast} or take suspend_lock for 135 * dereference. 136 */ |
145 struct dm_table __rcu *map; | 137 void __rcu *map; |
146 147 struct list_head table_devices; 148 struct mutex table_devices_lock; 149 150 unsigned long flags; 151 152 struct request_queue *queue; 153 int numa_node_id; --- 2403 unchanged lines hidden (view full) --- 2557 * - used to optimize both dm_request_fn and dm_mq_queue_rq 2558 */ 2559 md->immutable_target = dm_table_get_immutable_target(t); 2560 } 2561 2562 __bind_mempools(md, t); 2563 2564 old_map = rcu_dereference_protected(md->map, lockdep_is_held(&md->suspend_lock)); | 138 139 struct list_head table_devices; 140 struct mutex table_devices_lock; 141 142 unsigned long flags; 143 144 struct request_queue *queue; 145 int numa_node_id; --- 2403 unchanged lines hidden (view full) --- 2549 * - used to optimize both dm_request_fn and dm_mq_queue_rq 2550 */ 2551 md->immutable_target = dm_table_get_immutable_target(t); 2552 } 2553 2554 __bind_mempools(md, t); 2555 2556 old_map = rcu_dereference_protected(md->map, lockdep_is_held(&md->suspend_lock)); |
2565 rcu_assign_pointer(md->map, t); | 2557 rcu_assign_pointer(md->map, (void *)t); |
2566 md->immutable_target_type = dm_table_get_immutable_target_type(t); 2567 2568 dm_table_set_restrictions(t, q, limits); 2569 if (old_map) 2570 dm_sync_table(md); 2571 2572 return old_map; 2573} --- 1183 unchanged lines hidden --- | 2558 md->immutable_target_type = dm_table_get_immutable_target_type(t); 2559 2560 dm_table_set_restrictions(t, q, limits); 2561 if (old_map) 2562 dm_sync_table(md); 2563 2564 return old_map; 2565} --- 1183 unchanged lines hidden --- |