mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-05-02 18:15:03 -04:00
drbd: Move conf_mutex from connection to resource
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
This commit is contained in:
committed by
Philipp Reisner
parent
3ab706fe52
commit
0500813fe0
@@ -851,9 +851,9 @@ static void complete_conflicting_writes(struct drbd_request *req)
|
||||
break;
|
||||
/* Indicate to wake up device->misc_wait on progress. */
|
||||
i->waiting = true;
|
||||
spin_unlock_irq(&first_peer_device(device)->connection->req_lock);
|
||||
spin_unlock_irq(&device->resource->req_lock);
|
||||
schedule();
|
||||
spin_lock_irq(&first_peer_device(device)->connection->req_lock);
|
||||
spin_lock_irq(&device->resource->req_lock);
|
||||
}
|
||||
finish_wait(&device->misc_wait, &wait);
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ static void drbd_send_and_submit(struct drbd_device *device, struct drbd_request
|
||||
struct bio_and_error m = { NULL, };
|
||||
bool no_remote = false;
|
||||
|
||||
spin_lock_irq(&first_peer_device(device)->connection->req_lock);
|
||||
spin_lock_irq(&device->resource->req_lock);
|
||||
if (rw == WRITE) {
|
||||
/* This may temporarily give up the req_lock,
|
||||
* but will re-aquire it before it returns here.
|
||||
@@ -1140,9 +1140,9 @@ static void drbd_send_and_submit(struct drbd_device *device, struct drbd_request
|
||||
/* needs to be marked within the same spinlock */
|
||||
_req_mod(req, TO_BE_SUBMITTED);
|
||||
/* but we need to give up the spinlock to submit */
|
||||
spin_unlock_irq(&first_peer_device(device)->connection->req_lock);
|
||||
spin_unlock_irq(&device->resource->req_lock);
|
||||
drbd_submit_req_private_bio(req);
|
||||
spin_lock_irq(&first_peer_device(device)->connection->req_lock);
|
||||
spin_lock_irq(&device->resource->req_lock);
|
||||
} else if (no_remote) {
|
||||
nodata:
|
||||
if (__ratelimit(&drbd_ratelimit_state))
|
||||
@@ -1155,7 +1155,7 @@ nodata:
|
||||
out:
|
||||
if (drbd_req_put_completion_ref(req, &m, 1))
|
||||
kref_put(&req->kref, drbd_req_destroy);
|
||||
spin_unlock_irq(&first_peer_device(device)->connection->req_lock);
|
||||
spin_unlock_irq(&device->resource->req_lock);
|
||||
|
||||
if (m.bio)
|
||||
complete_master_bio(device, &m);
|
||||
@@ -1360,10 +1360,10 @@ void request_timer_fn(unsigned long data)
|
||||
|
||||
now = jiffies;
|
||||
|
||||
spin_lock_irq(&connection->req_lock);
|
||||
spin_lock_irq(&device->resource->req_lock);
|
||||
req = find_oldest_request(connection);
|
||||
if (!req) {
|
||||
spin_unlock_irq(&connection->req_lock);
|
||||
spin_unlock_irq(&device->resource->req_lock);
|
||||
mod_timer(&device->request_timer, now + et);
|
||||
return;
|
||||
}
|
||||
@@ -1397,6 +1397,6 @@ void request_timer_fn(unsigned long data)
|
||||
__drbd_chk_io_error(device, DRBD_FORCE_DETACH);
|
||||
}
|
||||
nt = (time_after(now, req->start_time + et) ? now : req->start_time) + et;
|
||||
spin_unlock_irq(&connection->req_lock);
|
||||
spin_unlock_irq(&connection->resource->req_lock);
|
||||
mod_timer(&device->request_timer, nt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user