mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-14 09:47:20 +00:00
drbd: drbd_send_drequest(): Return 0 upon success and an error code otherwise
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
5b9f499c66
commit
6c1005e74d
@ -1308,15 +1308,13 @@ int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packet cmd,
|
|||||||
int drbd_send_drequest(struct drbd_conf *mdev, int cmd,
|
int drbd_send_drequest(struct drbd_conf *mdev, int cmd,
|
||||||
sector_t sector, int size, u64 block_id)
|
sector_t sector, int size, u64 block_id)
|
||||||
{
|
{
|
||||||
int ok;
|
|
||||||
struct p_block_req p;
|
struct p_block_req p;
|
||||||
|
|
||||||
p.sector = cpu_to_be64(sector);
|
p.sector = cpu_to_be64(sector);
|
||||||
p.block_id = block_id;
|
p.block_id = block_id;
|
||||||
p.blksize = cpu_to_be32(size);
|
p.blksize = cpu_to_be32(size);
|
||||||
|
|
||||||
ok = !drbd_send_cmd(mdev, &mdev->tconn->data, cmd, &p.head, sizeof(p));
|
return drbd_send_cmd(mdev, &mdev->tconn->data, cmd, &p.head, sizeof(p));
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int drbd_send_drequest_csum(struct drbd_conf *mdev, sector_t sector, int size,
|
int drbd_send_drequest_csum(struct drbd_conf *mdev, sector_t sector, int size,
|
||||||
|
@ -637,7 +637,7 @@ next_sector:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
inc_rs_pending(mdev);
|
inc_rs_pending(mdev);
|
||||||
if (!drbd_send_drequest(mdev, P_RS_DATA_REQUEST,
|
if (drbd_send_drequest(mdev, P_RS_DATA_REQUEST,
|
||||||
sector, size, ID_SYNCER)) {
|
sector, size, ID_SYNCER)) {
|
||||||
dev_err(DEV, "drbd_send_drequest() failed, aborting...\n");
|
dev_err(DEV, "drbd_send_drequest() failed, aborting...\n");
|
||||||
dec_rs_pending(mdev);
|
dec_rs_pending(mdev);
|
||||||
@ -1287,8 +1287,8 @@ int w_send_read_req(struct drbd_work *w, int cancel)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = drbd_send_drequest(mdev, P_DATA_REQUEST, req->i.sector, req->i.size,
|
ok = !drbd_send_drequest(mdev, P_DATA_REQUEST, req->i.sector, req->i.size,
|
||||||
(unsigned long)req);
|
(unsigned long)req);
|
||||||
|
|
||||||
req_mod(req, ok ? HANDED_OVER_TO_NETWORK : SEND_FAILED);
|
req_mod(req, ok ? HANDED_OVER_TO_NETWORK : SEND_FAILED);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user