Commit 79a3c8d3 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: drbd_csum_bio(), drbd_csum_ee(): Remove unused device argument

Signed-off-by: default avatarAndreas Gruenbacher <agruen@linbit.com>
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
parent 753c6191
...@@ -1320,9 +1320,8 @@ static inline void ov_out_of_sync_print(struct drbd_device *device) ...@@ -1320,9 +1320,8 @@ static inline void ov_out_of_sync_print(struct drbd_device *device)
} }
extern void drbd_csum_bio(struct drbd_device *, struct crypto_hash *, struct bio *, void *); extern void drbd_csum_bio(struct crypto_hash *, struct bio *, void *);
extern void drbd_csum_ee(struct drbd_device *, struct crypto_hash *, extern void drbd_csum_ee(struct crypto_hash *, struct drbd_peer_request *, void *);
struct drbd_peer_request *, void *);
/* worker callbacks */ /* worker callbacks */
extern int w_e_end_data_req(struct drbd_work *, int); extern int w_e_end_data_req(struct drbd_work *, int);
extern int w_e_end_rsdata_req(struct drbd_work *, int); extern int w_e_end_rsdata_req(struct drbd_work *, int);
......
...@@ -1646,7 +1646,7 @@ int drbd_send_dblock(struct drbd_device *device, struct drbd_request *req) ...@@ -1646,7 +1646,7 @@ int drbd_send_dblock(struct drbd_device *device, struct drbd_request *req)
} }
p->dp_flags = cpu_to_be32(dp_flags); p->dp_flags = cpu_to_be32(dp_flags);
if (dgs) if (dgs)
drbd_csum_bio(device, first_peer_device(device)->connection->integrity_tfm, req->master_bio, p + 1); drbd_csum_bio(first_peer_device(device)->connection->integrity_tfm, req->master_bio, p + 1);
err = __send_command(first_peer_device(device)->connection, device->vnr, sock, P_DATA, sizeof(*p) + dgs, NULL, req->i.size); err = __send_command(first_peer_device(device)->connection, device->vnr, sock, P_DATA, sizeof(*p) + dgs, NULL, req->i.size);
if (!err) { if (!err) {
/* For protocol A, we have to memcpy the payload into /* For protocol A, we have to memcpy the payload into
...@@ -1670,7 +1670,7 @@ int drbd_send_dblock(struct drbd_device *device, struct drbd_request *req) ...@@ -1670,7 +1670,7 @@ int drbd_send_dblock(struct drbd_device *device, struct drbd_request *req)
/* 64 byte, 512 bit, is the largest digest size /* 64 byte, 512 bit, is the largest digest size
* currently supported in kernel crypto. */ * currently supported in kernel crypto. */
unsigned char digest[64]; unsigned char digest[64];
drbd_csum_bio(device, first_peer_device(device)->connection->integrity_tfm, req->master_bio, digest); drbd_csum_bio(first_peer_device(device)->connection->integrity_tfm, req->master_bio, digest);
if (memcmp(p + 1, digest, dgs)) { if (memcmp(p + 1, digest, dgs)) {
drbd_warn(device, drbd_warn(device,
"Digest mismatch, buffer modified by upper layers during write: %llus +%u\n", "Digest mismatch, buffer modified by upper layers during write: %llus +%u\n",
...@@ -1710,7 +1710,7 @@ int drbd_send_block(struct drbd_device *device, enum drbd_packet cmd, ...@@ -1710,7 +1710,7 @@ int drbd_send_block(struct drbd_device *device, enum drbd_packet cmd,
p->seq_num = 0; /* unused */ p->seq_num = 0; /* unused */
p->dp_flags = 0; p->dp_flags = 0;
if (dgs) if (dgs)
drbd_csum_ee(device, first_peer_device(device)->connection->integrity_tfm, peer_req, p + 1); drbd_csum_ee(first_peer_device(device)->connection->integrity_tfm, peer_req, p + 1);
err = __send_command(first_peer_device(device)->connection, device->vnr, sock, cmd, sizeof(*p) + dgs, NULL, peer_req->i.size); err = __send_command(first_peer_device(device)->connection, device->vnr, sock, cmd, sizeof(*p) + dgs, NULL, peer_req->i.size);
if (!err) if (!err)
err = _drbd_send_zc_ee(device, peer_req); err = _drbd_send_zc_ee(device, peer_req);
......
...@@ -1560,7 +1560,7 @@ read_in_block(struct drbd_device *device, u64 id, sector_t sector, ...@@ -1560,7 +1560,7 @@ read_in_block(struct drbd_device *device, u64 id, sector_t sector,
} }
if (dgs) { if (dgs) {
drbd_csum_ee(device, first_peer_device(device)->connection->peer_integrity_tfm, peer_req, dig_vv); drbd_csum_ee(first_peer_device(device)->connection->peer_integrity_tfm, peer_req, dig_vv);
if (memcmp(dig_in, dig_vv, dgs)) { if (memcmp(dig_in, dig_vv, dgs)) {
drbd_err(device, "Digest integrity check FAILED: %llus +%u\n", drbd_err(device, "Digest integrity check FAILED: %llus +%u\n",
(unsigned long long)sector, data_size); (unsigned long long)sector, data_size);
...@@ -1637,7 +1637,7 @@ static int recv_dless_read(struct drbd_device *device, struct drbd_request *req, ...@@ -1637,7 +1637,7 @@ static int recv_dless_read(struct drbd_device *device, struct drbd_request *req,
} }
if (dgs) { if (dgs) {
drbd_csum_bio(device, first_peer_device(device)->connection->peer_integrity_tfm, bio, dig_vv); drbd_csum_bio(first_peer_device(device)->connection->peer_integrity_tfm, bio, dig_vv);
if (memcmp(dig_in, dig_vv, dgs)) { if (memcmp(dig_in, dig_vv, dgs)) {
drbd_err(device, "Digest integrity check FAILED. Broken NICs?\n"); drbd_err(device, "Digest integrity check FAILED. Broken NICs?\n");
return -EINVAL; return -EINVAL;
......
...@@ -282,8 +282,7 @@ void drbd_request_endio(struct bio *bio, int error) ...@@ -282,8 +282,7 @@ void drbd_request_endio(struct bio *bio, int error)
complete_master_bio(device, &m); complete_master_bio(device, &m);
} }
void drbd_csum_ee(struct drbd_device *device, struct crypto_hash *tfm, void drbd_csum_ee(struct crypto_hash *tfm, struct drbd_peer_request *peer_req, void *digest)
struct drbd_peer_request *peer_req, void *digest)
{ {
struct hash_desc desc; struct hash_desc desc;
struct scatterlist sg; struct scatterlist sg;
...@@ -310,7 +309,7 @@ void drbd_csum_ee(struct drbd_device *device, struct crypto_hash *tfm, ...@@ -310,7 +309,7 @@ void drbd_csum_ee(struct drbd_device *device, struct crypto_hash *tfm,
crypto_hash_final(&desc, digest); crypto_hash_final(&desc, digest);
} }
void drbd_csum_bio(struct drbd_device *device, struct crypto_hash *tfm, struct bio *bio, void *digest) void drbd_csum_bio(struct crypto_hash *tfm, struct bio *bio, void *digest)
{ {
struct hash_desc desc; struct hash_desc desc;
struct scatterlist sg; struct scatterlist sg;
...@@ -350,7 +349,7 @@ static int w_e_send_csum(struct drbd_work *w, int cancel) ...@@ -350,7 +349,7 @@ static int w_e_send_csum(struct drbd_work *w, int cancel)
if (digest) { if (digest) {
sector_t sector = peer_req->i.sector; sector_t sector = peer_req->i.sector;
unsigned int size = peer_req->i.size; unsigned int size = peer_req->i.size;
drbd_csum_ee(device, first_peer_device(device)->connection->csums_tfm, peer_req, digest); drbd_csum_ee(first_peer_device(device)->connection->csums_tfm, peer_req, digest);
/* Free peer_req and pages before send. /* Free peer_req and pages before send.
* In case we block on congestion, we could otherwise run into * In case we block on congestion, we could otherwise run into
* some distributed deadlock, if the other side blocks on * some distributed deadlock, if the other side blocks on
...@@ -1103,7 +1102,7 @@ int w_e_end_csum_rs_req(struct drbd_work *w, int cancel) ...@@ -1103,7 +1102,7 @@ int w_e_end_csum_rs_req(struct drbd_work *w, int cancel)
digest = kmalloc(digest_size, GFP_NOIO); digest = kmalloc(digest_size, GFP_NOIO);
} }
if (digest) { if (digest) {
drbd_csum_ee(device, first_peer_device(device)->connection->csums_tfm, peer_req, digest); drbd_csum_ee(first_peer_device(device)->connection->csums_tfm, peer_req, digest);
eq = !memcmp(digest, di->digest, digest_size); eq = !memcmp(digest, di->digest, digest_size);
kfree(digest); kfree(digest);
} }
...@@ -1155,7 +1154,7 @@ int w_e_end_ov_req(struct drbd_work *w, int cancel) ...@@ -1155,7 +1154,7 @@ int w_e_end_ov_req(struct drbd_work *w, int cancel)
} }
if (likely(!(peer_req->flags & EE_WAS_ERROR))) if (likely(!(peer_req->flags & EE_WAS_ERROR)))
drbd_csum_ee(device, first_peer_device(device)->connection->verify_tfm, peer_req, digest); drbd_csum_ee(first_peer_device(device)->connection->verify_tfm, peer_req, digest);
else else
memset(digest, 0, digest_size); memset(digest, 0, digest_size);
...@@ -1221,7 +1220,7 @@ int w_e_end_ov_reply(struct drbd_work *w, int cancel) ...@@ -1221,7 +1220,7 @@ int w_e_end_ov_reply(struct drbd_work *w, int cancel)
digest_size = crypto_hash_digestsize(first_peer_device(device)->connection->verify_tfm); digest_size = crypto_hash_digestsize(first_peer_device(device)->connection->verify_tfm);
digest = kmalloc(digest_size, GFP_NOIO); digest = kmalloc(digest_size, GFP_NOIO);
if (digest) { if (digest) {
drbd_csum_ee(device, first_peer_device(device)->connection->verify_tfm, peer_req, digest); drbd_csum_ee(first_peer_device(device)->connection->verify_tfm, peer_req, digest);
D_ASSERT(device, digest_size == di->digest_size); D_ASSERT(device, digest_size == di->digest_size);
eq = !memcmp(digest, di->digest, digest_size); eq = !memcmp(digest, di->digest, digest_size);
......
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