Commit db830c46 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Local variable renames: e -> peer_req

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 6c852bec
......@@ -1701,9 +1701,9 @@ static inline int drbd_bio_has_active_page(struct bio *bio)
return 0;
}
static inline int drbd_ee_has_active_page(struct drbd_peer_request *e)
static inline int drbd_ee_has_active_page(struct drbd_peer_request *peer_req)
{
struct page *page = e->pages;
struct page *page = peer_req->pages;
page_chain_for_each(page) {
if (page_count(page) > 1)
return 1;
......
......@@ -2429,17 +2429,17 @@ int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd,
/**
* drbd_send_ack() - Sends an ack packet
* @mdev: DRBD device.
* @cmd: Packet command code.
* @e: Epoch entry.
* @mdev: DRBD device
* @cmd: packet command code
* @peer_req: peer request
*/
int drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_peer_request *e)
struct drbd_peer_request *peer_req)
{
return _drbd_send_ack(mdev, cmd,
cpu_to_be64(e->i.sector),
cpu_to_be32(e->i.size),
e->block_id);
cpu_to_be64(peer_req->i.sector),
cpu_to_be32(peer_req->i.size),
peer_req->block_id);
}
/* This function misuses the block_id field to signal if the blocks
......@@ -2641,10 +2641,12 @@ static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio)
return 1;
}
static int _drbd_send_zc_ee(struct drbd_conf *mdev, struct drbd_peer_request *e)
static int _drbd_send_zc_ee(struct drbd_conf *mdev,
struct drbd_peer_request *peer_req)
{
struct page *page = e->pages;
unsigned len = e->i.size;
struct page *page = peer_req->pages;
unsigned len = peer_req->i.size;
/* hint all but last page with MSG_MORE */
page_chain_for_each(page) {
unsigned l = min_t(unsigned, len, PAGE_SIZE);
......@@ -2747,7 +2749,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
* C_SYNC_SOURCE -> C_SYNC_TARGET (P_RS_DATA_REPLY)
*/
int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_peer_request *e)
struct drbd_peer_request *peer_req)
{
int ok;
struct p_data p;
......@@ -2757,9 +2759,11 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->integrity_w_tfm) ?
crypto_hash_digestsize(mdev->tconn->integrity_w_tfm) : 0;
prepare_header(mdev, &p.head, cmd, sizeof(p) - sizeof(struct p_header80) + dgs + e->i.size);
p.sector = cpu_to_be64(e->i.sector);
p.block_id = e->block_id;
prepare_header(mdev, &p.head, cmd, sizeof(p) -
sizeof(struct p_header80) +
dgs + peer_req->i.size);
p.sector = cpu_to_be64(peer_req->i.sector);
p.block_id = peer_req->block_id;
p.seq_num = 0; /* unused */
/* Only called by our kernel thread.
......@@ -2772,11 +2776,11 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
ok = sizeof(p) == drbd_send(mdev, mdev->tconn->data.socket, &p, sizeof(p), dgs ? MSG_MORE : 0);
if (ok && dgs) {
dgb = mdev->tconn->int_dig_out;
drbd_csum_ee(mdev, mdev->tconn->integrity_w_tfm, e, dgb);
drbd_csum_ee(mdev, mdev->tconn->integrity_w_tfm, peer_req, dgb);
ok = dgs == drbd_send(mdev, mdev->tconn->data.socket, dgb, dgs, 0);
}
if (ok)
ok = _drbd_send_zc_ee(mdev, e);
ok = _drbd_send_zc_ee(mdev, peer_req);
drbd_put_data_sock(mdev);
......
......@@ -2445,7 +2445,7 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name)
void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
const char *seen_hash, const char *calc_hash,
const struct drbd_peer_request *e)
const struct drbd_peer_request *peer_req)
{
struct cn_msg *cn_reply;
struct drbd_nl_cfg_reply *reply;
......@@ -2453,7 +2453,7 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
struct page *page;
unsigned len;
if (!e)
if (!peer_req)
return;
if (!reason || !reason[0])
return;
......@@ -2472,8 +2472,10 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
GFP_NOIO);
if (!cn_reply) {
dev_err(DEV, "could not kmalloc buffer for drbd_bcast_ee, sector %llu, size %u\n",
(unsigned long long)e->i.sector, e->i.size);
dev_err(DEV, "could not kmalloc buffer for drbd_bcast_ee, "
"sector %llu, size %u\n",
(unsigned long long)peer_req->i.sector,
peer_req->i.size);
return;
}
......@@ -2483,15 +2485,15 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
tl = tl_add_str(tl, T_dump_ee_reason, reason);
tl = tl_add_blob(tl, T_seen_digest, seen_hash, dgs);
tl = tl_add_blob(tl, T_calc_digest, calc_hash, dgs);
tl = tl_add_int(tl, T_ee_sector, &e->i.sector);
tl = tl_add_int(tl, T_ee_block_id, &e->block_id);
tl = tl_add_int(tl, T_ee_sector, &peer_req->i.sector);
tl = tl_add_int(tl, T_ee_block_id, &peer_req->block_id);
/* dump the first 32k */
len = min_t(unsigned, e->i.size, 32 << 10);
len = min_t(unsigned, peer_req->i.size, 32 << 10);
put_unaligned(T_ee_data, tl++);
put_unaligned(len, tl++);
page = e->pages;
page = peer_req->pages;
page_chain_for_each(page) {
void *d = kmap_atomic(page, KM_USER0);
unsigned l = min_t(unsigned, len, PAGE_SIZE);
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment