Commit b9ed7080 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: consistently use list_add_tail for peer_request tracking

Keep the epoch entry lists (active_ee, read_ee, sync_ee, ...)
consistently "oldest first".  That way finding the oldest not yet
successfully processed request is simply list_first_entry_or_null.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 41d9f7cd
...@@ -1777,7 +1777,7 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto ...@@ -1777,7 +1777,7 @@ static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t secto
peer_req->w.cb = e_end_resync_block; peer_req->w.cb = e_end_resync_block;
spin_lock_irq(&device->resource->req_lock); spin_lock_irq(&device->resource->req_lock);
list_add(&peer_req->w.list, &device->sync_ee); list_add_tail(&peer_req->w.list, &device->sync_ee);
spin_unlock_irq(&device->resource->req_lock); spin_unlock_irq(&device->resource->req_lock);
atomic_add(pi->size >> 9, &device->rs_sect_ev); atomic_add(pi->size >> 9, &device->rs_sect_ev);
...@@ -2341,7 +2341,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info * ...@@ -2341,7 +2341,7 @@ static int receive_Data(struct drbd_connection *connection, struct packet_info *
* active_ee to become empty in drbd_submit_peer_request(); * active_ee to become empty in drbd_submit_peer_request();
* better not add ourselves here. */ * better not add ourselves here. */
if ((peer_req->flags & EE_IS_TRIM_USE_ZEROOUT) == 0) if ((peer_req->flags & EE_IS_TRIM_USE_ZEROOUT) == 0)
list_add(&peer_req->w.list, &device->active_ee); list_add_tail(&peer_req->w.list, &device->active_ee);
spin_unlock_irq(&device->resource->req_lock); spin_unlock_irq(&device->resource->req_lock);
if (device->state.conn == C_SYNC_TARGET) if (device->state.conn == C_SYNC_TARGET)
......
...@@ -410,7 +410,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector, ...@@ -410,7 +410,7 @@ static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector,
peer_req->w.cb = w_e_send_csum; peer_req->w.cb = w_e_send_csum;
spin_lock_irq(&device->resource->req_lock); spin_lock_irq(&device->resource->req_lock);
list_add(&peer_req->w.list, &device->read_ee); list_add_tail(&peer_req->w.list, &device->read_ee);
spin_unlock_irq(&device->resource->req_lock); spin_unlock_irq(&device->resource->req_lock);
atomic_add(size >> 9, &device->rs_sect_ev); atomic_add(size >> 9, &device->rs_sect_ev);
......
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