aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_nl.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-01-19 08:16:30 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-08-29 05:30:15 -0400
commit87eeee41f8740451b61a1e7d37a494333a906861 (patch)
treef7b328aa626ed5153ec5cf5b9dbd94c23676b6a8 /drivers/block/drbd/drbd_nl.c
parent31890f4ab299c4116cf0a104ca9ce4f9ca2c5da0 (diff)
drbd: moved req_lock and transfer log from mdev to tconn
sed -i \ -e 's/mdev->req_lock/mdev->tconn->req_lock/g' \ -e 's/mdev->unused_spare_tle/mdev->tconn->unused_spare_tle/g' \ -e 's/mdev->newest_tle/mdev->tconn->newest_tle/g' \ -e 's/mdev->oldest_tle/mdev->tconn->oldest_tle/g' \ -e 's/mdev->out_of_sequence_requests/mdev->tconn->out_of_sequence_requests/g' \ *.[ch] Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r--drivers/block/drbd/drbd_nl.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index a9ede8fc8880..4eaf81a463b5 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -287,13 +287,13 @@ static int _try_outdate_peer_async(void *data)
287 pdsk == D_INCONSISTENT while conn >= C_CONNECTED is valid, 287 pdsk == D_INCONSISTENT while conn >= C_CONNECTED is valid,
288 therefore we have to have the pre state change check here. 288 therefore we have to have the pre state change check here.
289 */ 289 */
290 spin_lock_irq(&mdev->req_lock); 290 spin_lock_irq(&mdev->tconn->req_lock);
291 ns = mdev->state; 291 ns = mdev->state;
292 if (ns.conn < C_WF_REPORT_PARAMS) { 292 if (ns.conn < C_WF_REPORT_PARAMS) {
293 ns.pdsk = nps; 293 ns.pdsk = nps;
294 _drbd_set_state(mdev, ns, CS_VERBOSE, NULL); 294 _drbd_set_state(mdev, ns, CS_VERBOSE, NULL);
295 } 295 }
296 spin_unlock_irq(&mdev->req_lock); 296 spin_unlock_irq(&mdev->tconn->req_lock);
297 297
298 return 0; 298 return 0;
299} 299}
@@ -884,7 +884,7 @@ static void drbd_reconfig_start(struct drbd_conf *mdev)
884 * wakes potential waiters */ 884 * wakes potential waiters */
885static void drbd_reconfig_done(struct drbd_conf *mdev) 885static void drbd_reconfig_done(struct drbd_conf *mdev)
886{ 886{
887 spin_lock_irq(&mdev->req_lock); 887 spin_lock_irq(&mdev->tconn->req_lock);
888 if (mdev->state.disk == D_DISKLESS && 888 if (mdev->state.disk == D_DISKLESS &&
889 mdev->state.conn == C_STANDALONE && 889 mdev->state.conn == C_STANDALONE &&
890 mdev->state.role == R_SECONDARY) { 890 mdev->state.role == R_SECONDARY) {
@@ -892,7 +892,7 @@ static void drbd_reconfig_done(struct drbd_conf *mdev)
892 drbd_thread_stop_nowait(&mdev->tconn->worker); 892 drbd_thread_stop_nowait(&mdev->tconn->worker);
893 } else 893 } else
894 clear_bit(CONFIG_PENDING, &mdev->flags); 894 clear_bit(CONFIG_PENDING, &mdev->flags);
895 spin_unlock_irq(&mdev->req_lock); 895 spin_unlock_irq(&mdev->tconn->req_lock);
896 wake_up(&mdev->state_wait); 896 wake_up(&mdev->state_wait);
897} 897}
898 898
@@ -909,11 +909,11 @@ static void drbd_suspend_al(struct drbd_conf *mdev)
909 return; 909 return;
910 } 910 }
911 911
912 spin_lock_irq(&mdev->req_lock); 912 spin_lock_irq(&mdev->tconn->req_lock);
913 if (mdev->state.conn < C_CONNECTED) 913 if (mdev->state.conn < C_CONNECTED)
914 s = !test_and_set_bit(AL_SUSPENDED, &mdev->flags); 914 s = !test_and_set_bit(AL_SUSPENDED, &mdev->flags);
915 915
916 spin_unlock_irq(&mdev->req_lock); 916 spin_unlock_irq(&mdev->tconn->req_lock);
917 917
918 if (s) 918 if (s)
919 dev_info(DEV, "Suspended AL updates\n"); 919 dev_info(DEV, "Suspended AL updates\n");
@@ -1240,7 +1240,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
1240 if (_drbd_bm_total_weight(mdev) == drbd_bm_bits(mdev)) 1240 if (_drbd_bm_total_weight(mdev) == drbd_bm_bits(mdev))
1241 drbd_suspend_al(mdev); /* IO is still suspended here... */ 1241 drbd_suspend_al(mdev); /* IO is still suspended here... */
1242 1242
1243 spin_lock_irq(&mdev->req_lock); 1243 spin_lock_irq(&mdev->tconn->req_lock);
1244 os = mdev->state; 1244 os = mdev->state;
1245 ns.i = os.i; 1245 ns.i = os.i;
1246 /* If MDF_CONSISTENT is not set go into inconsistent state, 1246 /* If MDF_CONSISTENT is not set go into inconsistent state,
@@ -1285,7 +1285,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
1285 1285
1286 rv = _drbd_set_state(mdev, ns, CS_VERBOSE, NULL); 1286 rv = _drbd_set_state(mdev, ns, CS_VERBOSE, NULL);
1287 ns = mdev->state; 1287 ns = mdev->state;
1288 spin_unlock_irq(&mdev->req_lock); 1288 spin_unlock_irq(&mdev->tconn->req_lock);
1289 1289
1290 if (rv < SS_SUCCESS) 1290 if (rv < SS_SUCCESS)
1291 goto force_diskless_dec; 1291 goto force_diskless_dec;
@@ -1521,10 +1521,10 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
1521 } 1521 }
1522 1522
1523 drbd_flush_workqueue(mdev); 1523 drbd_flush_workqueue(mdev);
1524 spin_lock_irq(&mdev->req_lock); 1524 spin_lock_irq(&mdev->tconn->req_lock);
1525 if (mdev->tconn->net_conf != NULL) { 1525 if (mdev->tconn->net_conf != NULL) {
1526 retcode = ERR_NET_CONFIGURED; 1526 retcode = ERR_NET_CONFIGURED;
1527 spin_unlock_irq(&mdev->req_lock); 1527 spin_unlock_irq(&mdev->tconn->req_lock);
1528 goto fail; 1528 goto fail;
1529 } 1529 }
1530 mdev->tconn->net_conf = new_conf; 1530 mdev->tconn->net_conf = new_conf;
@@ -1548,7 +1548,7 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
1548 mdev->int_dig_in=int_dig_in; 1548 mdev->int_dig_in=int_dig_in;
1549 mdev->int_dig_vv=int_dig_vv; 1549 mdev->int_dig_vv=int_dig_vv;
1550 retcode = _drbd_set_state(_NS(mdev, conn, C_UNCONNECTED), CS_VERBOSE, NULL); 1550 retcode = _drbd_set_state(_NS(mdev, conn, C_UNCONNECTED), CS_VERBOSE, NULL);
1551 spin_unlock_irq(&mdev->req_lock); 1551 spin_unlock_irq(&mdev->tconn->req_lock);
1552 1552
1553 kobject_uevent(&disk_to_dev(mdev->vdisk)->kobj, KOBJ_CHANGE); 1553 kobject_uevent(&disk_to_dev(mdev->vdisk)->kobj, KOBJ_CHANGE);
1554 reply->ret_code = retcode; 1554 reply->ret_code = retcode;
@@ -1582,10 +1582,10 @@ static int drbd_nl_disconnect(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nl
1582 } 1582 }
1583 1583
1584 if (dc.force) { 1584 if (dc.force) {
1585 spin_lock_irq(&mdev->req_lock); 1585 spin_lock_irq(&mdev->tconn->req_lock);
1586 if (mdev->state.conn >= C_WF_CONNECTION) 1586 if (mdev->state.conn >= C_WF_CONNECTION)
1587 _drbd_set_state(_NS(mdev, conn, C_DISCONNECTING), CS_HARD, NULL); 1587 _drbd_set_state(_NS(mdev, conn, C_DISCONNECTING), CS_HARD, NULL);
1588 spin_unlock_irq(&mdev->req_lock); 1588 spin_unlock_irq(&mdev->tconn->req_lock);
1589 goto done; 1589 goto done;
1590 } 1590 }
1591 1591
@@ -1917,10 +1917,10 @@ static int drbd_nl_invalidate(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nl
1917 retcode = drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T)); 1917 retcode = drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T));
1918 1918
1919 while (retcode == SS_NEED_CONNECTION) { 1919 while (retcode == SS_NEED_CONNECTION) {
1920 spin_lock_irq(&mdev->req_lock); 1920 spin_lock_irq(&mdev->tconn->req_lock);
1921 if (mdev->state.conn < C_CONNECTED) 1921 if (mdev->state.conn < C_CONNECTED)
1922 retcode = _drbd_set_state(_NS(mdev, disk, D_INCONSISTENT), CS_VERBOSE, NULL); 1922 retcode = _drbd_set_state(_NS(mdev, disk, D_INCONSISTENT), CS_VERBOSE, NULL);
1923 spin_unlock_irq(&mdev->req_lock); 1923 spin_unlock_irq(&mdev->tconn->req_lock);
1924 1924
1925 if (retcode != SS_NEED_CONNECTION) 1925 if (retcode != SS_NEED_CONNECTION)
1926 break; 1926 break;
@@ -2193,10 +2193,10 @@ static int drbd_nl_new_c_uuid(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nl
2193 drbd_send_uuids_skip_initial_sync(mdev); 2193 drbd_send_uuids_skip_initial_sync(mdev);
2194 _drbd_uuid_set(mdev, UI_BITMAP, 0); 2194 _drbd_uuid_set(mdev, UI_BITMAP, 0);
2195 drbd_print_uuids(mdev, "cleared bitmap UUID"); 2195 drbd_print_uuids(mdev, "cleared bitmap UUID");
2196 spin_lock_irq(&mdev->req_lock); 2196 spin_lock_irq(&mdev->tconn->req_lock);
2197 _drbd_set_state(_NS2(mdev, disk, D_UP_TO_DATE, pdsk, D_UP_TO_DATE), 2197 _drbd_set_state(_NS2(mdev, disk, D_UP_TO_DATE, pdsk, D_UP_TO_DATE),
2198 CS_VERBOSE, NULL); 2198 CS_VERBOSE, NULL);
2199 spin_unlock_irq(&mdev->req_lock); 2199 spin_unlock_irq(&mdev->tconn->req_lock);
2200 } 2200 }
2201 } 2201 }
2202 2202