Commit 85719573 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Replaced some casts by an union. Improved comments

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent d207450c
...@@ -759,7 +759,7 @@ struct digest_info { ...@@ -759,7 +759,7 @@ struct digest_info {
struct drbd_epoch_entry { struct drbd_epoch_entry {
struct drbd_work w; struct drbd_work w;
struct hlist_node colision; struct hlist_node colision;
struct drbd_epoch *epoch; struct drbd_epoch *epoch; /* for writes */
struct drbd_conf *mdev; struct drbd_conf *mdev;
struct page *pages; struct page *pages;
atomic_t pending_bios; atomic_t pending_bios;
...@@ -767,7 +767,10 @@ struct drbd_epoch_entry { ...@@ -767,7 +767,10 @@ struct drbd_epoch_entry {
/* see comments on ee flag bits below */ /* see comments on ee flag bits below */
unsigned long flags; unsigned long flags;
sector_t sector; sector_t sector;
union {
u64 block_id; u64 block_id;
struct digest_info *digest;
};
}; };
/* ee flag bits. /* ee flag bits.
...@@ -1032,10 +1035,10 @@ struct drbd_conf { ...@@ -1032,10 +1035,10 @@ struct drbd_conf {
spinlock_t epoch_lock; spinlock_t epoch_lock;
unsigned int epochs; unsigned int epochs;
enum write_ordering_e write_ordering; enum write_ordering_e write_ordering;
struct list_head active_ee; /* IO in progress */ struct list_head active_ee; /* IO in progress (P_DATA gets written to disk) */
struct list_head sync_ee; /* IO in progress */ struct list_head sync_ee; /* IO in progress (P_RS_DATA_REPLY gets written to disk) */
struct list_head done_ee; /* send ack */ struct list_head done_ee; /* send ack */
struct list_head read_ee; /* IO in progress */ struct list_head read_ee; /* IO in progress (any read) */
struct list_head net_ee; /* zero-copy network send in progress */ struct list_head net_ee; /* zero-copy network send in progress */
struct hlist_head *ee_hash; /* is proteced by req_lock! */ struct hlist_head *ee_hash; /* is proteced by req_lock! */
unsigned int ee_hash_s; unsigned int ee_hash_s;
......
...@@ -2097,7 +2097,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h) ...@@ -2097,7 +2097,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h)
if (drbd_recv(mdev, di->digest, digest_size) != digest_size) if (drbd_recv(mdev, di->digest, digest_size) != digest_size)
goto out_free_e; goto out_free_e;
e->block_id = (u64)(unsigned long)di; e->digest = di;
if (h->command == P_CSUM_RS_REQUEST) { if (h->command == P_CSUM_RS_REQUEST) {
D_ASSERT(mdev->agreed_pro_version >= 89); D_ASSERT(mdev->agreed_pro_version >= 89);
e->w.cb = w_e_end_csum_rs_req; e->w.cb = w_e_end_csum_rs_req;
...@@ -3769,6 +3769,7 @@ static void drbd_disconnect(struct drbd_conf *mdev) ...@@ -3769,6 +3769,7 @@ static void drbd_disconnect(struct drbd_conf *mdev)
drbd_thread_stop(&mdev->asender); drbd_thread_stop(&mdev->asender);
drbd_free_sock(mdev); drbd_free_sock(mdev);
/* wait for current activity to cease. */
spin_lock_irq(&mdev->req_lock); spin_lock_irq(&mdev->req_lock);
_drbd_wait_ee_list_empty(mdev, &mdev->active_ee); _drbd_wait_ee_list_empty(mdev, &mdev->active_ee);
_drbd_wait_ee_list_empty(mdev, &mdev->sync_ee); _drbd_wait_ee_list_empty(mdev, &mdev->sync_ee);
......
...@@ -1018,7 +1018,7 @@ int w_e_end_csum_rs_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel) ...@@ -1018,7 +1018,7 @@ int w_e_end_csum_rs_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
drbd_rs_complete_io(mdev, e->sector); drbd_rs_complete_io(mdev, e->sector);
di = (struct digest_info *)(unsigned long)e->block_id; di = e->digest;
if (likely((e->flags & EE_WAS_ERROR) == 0)) { if (likely((e->flags & EE_WAS_ERROR) == 0)) {
/* quick hack to try to avoid a race against reconfiguration. /* quick hack to try to avoid a race against reconfiguration.
...@@ -1126,7 +1126,7 @@ int w_e_end_ov_reply(struct drbd_conf *mdev, struct drbd_work *w, int cancel) ...@@ -1126,7 +1126,7 @@ int w_e_end_ov_reply(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
* the resync lru has been cleaned up already */ * the resync lru has been cleaned up already */
drbd_rs_complete_io(mdev, e->sector); drbd_rs_complete_io(mdev, e->sector);
di = (struct digest_info *)(unsigned long)e->block_id; di = e->digest;
if (likely((e->flags & EE_WAS_ERROR) == 0)) { if (likely((e->flags & EE_WAS_ERROR) == 0)) {
digest_size = crypto_hash_digestsize(mdev->verify_tfm); digest_size = crypto_hash_digestsize(mdev->verify_tfm);
......
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