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) ...@@ -1701,9 +1701,9 @@ static inline int drbd_bio_has_active_page(struct bio *bio)
return 0; 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) { page_chain_for_each(page) {
if (page_count(page) > 1) if (page_count(page) > 1)
return 1; return 1;
......
...@@ -2429,17 +2429,17 @@ int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -2429,17 +2429,17 @@ int drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd,
/** /**
* drbd_send_ack() - Sends an ack packet * drbd_send_ack() - Sends an ack packet
* @mdev: DRBD device. * @mdev: DRBD device
* @cmd: Packet command code. * @cmd: packet command code
* @e: Epoch entry. * @peer_req: peer request
*/ */
int drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd, 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, return _drbd_send_ack(mdev, cmd,
cpu_to_be64(e->i.sector), cpu_to_be64(peer_req->i.sector),
cpu_to_be32(e->i.size), cpu_to_be32(peer_req->i.size),
e->block_id); peer_req->block_id);
} }
/* This function misuses the block_id field to signal if the blocks /* 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) ...@@ -2641,10 +2641,12 @@ static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio)
return 1; 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; struct page *page = peer_req->pages;
unsigned len = e->i.size; unsigned len = peer_req->i.size;
/* hint all but last page with MSG_MORE */ /* hint all but last page with MSG_MORE */
page_chain_for_each(page) { page_chain_for_each(page) {
unsigned l = min_t(unsigned, len, PAGE_SIZE); unsigned l = min_t(unsigned, len, PAGE_SIZE);
...@@ -2747,7 +2749,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req) ...@@ -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) * C_SYNC_SOURCE -> C_SYNC_TARGET (P_RS_DATA_REPLY)
*/ */
int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd, 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; int ok;
struct p_data p; struct p_data p;
...@@ -2757,9 +2759,11 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -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) ? dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->integrity_w_tfm) ?
crypto_hash_digestsize(mdev->tconn->integrity_w_tfm) : 0; 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); prepare_header(mdev, &p.head, cmd, sizeof(p) -
p.sector = cpu_to_be64(e->i.sector); sizeof(struct p_header80) +
p.block_id = e->block_id; 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 */ p.seq_num = 0; /* unused */
/* Only called by our kernel thread. /* Only called by our kernel thread.
...@@ -2772,11 +2776,11 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -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); ok = sizeof(p) == drbd_send(mdev, mdev->tconn->data.socket, &p, sizeof(p), dgs ? MSG_MORE : 0);
if (ok && dgs) { if (ok && dgs) {
dgb = mdev->tconn->int_dig_out; 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); ok = dgs == drbd_send(mdev, mdev->tconn->data.socket, dgb, dgs, 0);
} }
if (ok) if (ok)
ok = _drbd_send_zc_ee(mdev, e); ok = _drbd_send_zc_ee(mdev, peer_req);
drbd_put_data_sock(mdev); drbd_put_data_sock(mdev);
......
...@@ -2445,7 +2445,7 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name) ...@@ -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, void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
const char *seen_hash, const char *calc_hash, 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 cn_msg *cn_reply;
struct drbd_nl_cfg_reply *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, ...@@ -2453,7 +2453,7 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
struct page *page; struct page *page;
unsigned len; unsigned len;
if (!e) if (!peer_req)
return; return;
if (!reason || !reason[0]) if (!reason || !reason[0])
return; return;
...@@ -2472,8 +2472,10 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs, ...@@ -2472,8 +2472,10 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
GFP_NOIO); GFP_NOIO);
if (!cn_reply) { if (!cn_reply) {
dev_err(DEV, "could not kmalloc buffer for drbd_bcast_ee, sector %llu, size %u\n", dev_err(DEV, "could not kmalloc buffer for drbd_bcast_ee, "
(unsigned long long)e->i.sector, e->i.size); "sector %llu, size %u\n",
(unsigned long long)peer_req->i.sector,
peer_req->i.size);
return; return;
} }
...@@ -2483,15 +2485,15 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs, ...@@ -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_str(tl, T_dump_ee_reason, reason);
tl = tl_add_blob(tl, T_seen_digest, seen_hash, dgs); 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_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_sector, &peer_req->i.sector);
tl = tl_add_int(tl, T_ee_block_id, &e->block_id); tl = tl_add_int(tl, T_ee_block_id, &peer_req->block_id);
/* dump the first 32k */ /* 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(T_ee_data, tl++);
put_unaligned(len, tl++); put_unaligned(len, tl++);
page = e->pages; page = peer_req->pages;
page_chain_for_each(page) { page_chain_for_each(page) {
void *d = kmap_atomic(page, KM_USER0); void *d = kmap_atomic(page, KM_USER0);
unsigned l = min_t(unsigned, len, PAGE_SIZE); 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