drbd: Get rid of first_peer_device() in handle_write_conflicts()
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
This commit is contained in:
parent
6db7e50a8a
commit
e33b32de04
|
@ -2065,7 +2065,7 @@ static void fail_postponed_requests(struct drbd_device *device, sector_t sector,
|
||||||
static int handle_write_conflicts(struct drbd_device *device,
|
static int handle_write_conflicts(struct drbd_device *device,
|
||||||
struct drbd_peer_request *peer_req)
|
struct drbd_peer_request *peer_req)
|
||||||
{
|
{
|
||||||
struct drbd_connection *connection = first_peer_device(device)->connection;
|
struct drbd_connection *connection = peer_req->peer_device->connection;
|
||||||
bool resolve_conflicts = test_bit(RESOLVE_CONFLICTS, &connection->flags);
|
bool resolve_conflicts = test_bit(RESOLVE_CONFLICTS, &connection->flags);
|
||||||
sector_t sector = peer_req->i.sector;
|
sector_t sector = peer_req->i.sector;
|
||||||
const unsigned int size = peer_req->i.size;
|
const unsigned int size = peer_req->i.size;
|
||||||
|
@ -2119,7 +2119,7 @@ static int handle_write_conflicts(struct drbd_device *device,
|
||||||
peer_req->w.cb = superseded ? e_send_superseded :
|
peer_req->w.cb = superseded ? e_send_superseded :
|
||||||
e_send_retry_write;
|
e_send_retry_write;
|
||||||
list_add_tail(&peer_req->w.list, &device->done_ee);
|
list_add_tail(&peer_req->w.list, &device->done_ee);
|
||||||
wake_asender(first_peer_device(device)->connection);
|
wake_asender(connection);
|
||||||
|
|
||||||
err = -ENOENT;
|
err = -ENOENT;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -2148,9 +2148,7 @@ static int handle_write_conflicts(struct drbd_device *device,
|
||||||
*/
|
*/
|
||||||
err = drbd_wait_misc(device, &req->i);
|
err = drbd_wait_misc(device, &req->i);
|
||||||
if (err) {
|
if (err) {
|
||||||
_conn_request_state(first_peer_device(device)->connection,
|
_conn_request_state(connection, NS(conn, C_TIMEOUT), CS_HARD);
|
||||||
NS(conn, C_TIMEOUT),
|
|
||||||
CS_HARD);
|
|
||||||
fail_postponed_requests(device, sector, size);
|
fail_postponed_requests(device, sector, size);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue