drbd: drbd_uuid_compare: pass a peer_device

Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20230330102744.2128122-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Böhmwalder 2023-03-30 12:27:42 +02:00 committed by Jens Axboe
parent 5e54c2a601
commit db445db1cd
1 changed files with 5 additions and 4 deletions

View File

@ -3226,10 +3226,11 @@ static void drbd_uuid_dump(struct drbd_device *device, char *text, u64 *uuid,
-1096 requires proto 96 -1096 requires proto 96
*/ */
static int drbd_uuid_compare(struct drbd_device *const device, enum drbd_role const peer_role, int *rule_nr) __must_hold(local) static int drbd_uuid_compare(struct drbd_peer_device *const peer_device,
enum drbd_role const peer_role, int *rule_nr) __must_hold(local)
{ {
struct drbd_peer_device *const peer_device = first_peer_device(device); struct drbd_connection *const connection = peer_device->connection;
struct drbd_connection *const connection = peer_device ? peer_device->connection : NULL; struct drbd_device *device = peer_device->device;
u64 self, peer; u64 self, peer;
int i, j; int i, j;
@ -3465,7 +3466,7 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_peer_device *peer_device,
drbd_uuid_dump(device, "peer", device->p_uuid, drbd_uuid_dump(device, "peer", device->p_uuid,
device->p_uuid[UI_SIZE], device->p_uuid[UI_FLAGS]); device->p_uuid[UI_SIZE], device->p_uuid[UI_FLAGS]);
hg = drbd_uuid_compare(device, peer_role, &rule_nr); hg = drbd_uuid_compare(peer_device, peer_role, &rule_nr);
spin_unlock_irq(&device->ldev->md.uuid_lock); spin_unlock_irq(&device->ldev->md.uuid_lock);
drbd_info(device, "uuid_compare()=%d by rule %d\n", hg, rule_nr); drbd_info(device, "uuid_compare()=%d by rule %d\n", hg, rule_nr);