Merge tag 'for-5.18/drivers-2022-04-01' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / drivers / block / drbd / drbd_main.c
index 6831ddb..9676a1d 100644 (file)
@@ -915,7 +915,7 @@ assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
                p->qlim->io_min = cpu_to_be32(queue_io_min(q));
                p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
                p->qlim->discard_enabled = blk_queue_discard(q);
-               p->qlim->write_same_capable = !!q->limits.max_write_same_sectors;
+               p->qlim->write_same_capable = 0;
        } else {
                q = device->rq_queue;
                p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
@@ -1594,9 +1594,6 @@ static int _drbd_send_bio(struct drbd_peer_device *peer_device, struct bio *bio)
                                         ? 0 : MSG_MORE);
                if (err)
                        return err;
-               /* REQ_OP_WRITE_SAME has only one segment */
-               if (bio_op(bio) == REQ_OP_WRITE_SAME)
-                       break;
        }
        return 0;
 }
@@ -1615,9 +1612,6 @@ static int _drbd_send_zc_bio(struct drbd_peer_device *peer_device, struct bio *b
                                      bio_iter_last(bvec, iter) ? 0 : MSG_MORE);
                if (err)
                        return err;
-               /* REQ_OP_WRITE_SAME has only one segment */
-               if (bio_op(bio) == REQ_OP_WRITE_SAME)
-                       break;
        }
        return 0;
 }
@@ -1649,7 +1643,6 @@ static u32 bio_flags_to_wire(struct drbd_connection *connection,
                return  (bio->bi_opf & REQ_SYNC ? DP_RW_SYNC : 0) |
                        (bio->bi_opf & REQ_FUA ? DP_FUA : 0) |
                        (bio->bi_opf & REQ_PREFLUSH ? DP_FLUSH : 0) |
-                       (bio_op(bio) == REQ_OP_WRITE_SAME ? DP_WSAME : 0) |
                        (bio_op(bio) == REQ_OP_DISCARD ? DP_DISCARD : 0) |
                        (bio_op(bio) == REQ_OP_WRITE_ZEROES ?
                          ((connection->agreed_features & DRBD_FF_WZEROES) ?
@@ -1668,7 +1661,6 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
        struct drbd_device *device = peer_device->device;
        struct drbd_socket *sock;
        struct p_data *p;
-       struct p_wsame *wsame = NULL;
        void *digest_out;
        unsigned int dp_flags = 0;
        int digest_size;
@@ -1706,29 +1698,14 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
                err = __send_command(peer_device->connection, device->vnr, sock, cmd, sizeof(*t), NULL, 0);
                goto out;
        }
-       if (dp_flags & DP_WSAME) {
-               /* this will only work if DRBD_FF_WSAME is set AND the
-                * handshake agreed that all nodes and backend devices are
-                * WRITE_SAME capable and agree on logical_block_size */
-               wsame = (struct p_wsame*)p;
-               digest_out = wsame + 1;
-               wsame->size = cpu_to_be32(req->i.size);
-       } else
-               digest_out = p + 1;
+       digest_out = p + 1;
 
        /* our digest is still only over the payload.
         * TRIM does not carry any payload. */
        if (digest_size)
                drbd_csum_bio(peer_device->connection->integrity_tfm, req->master_bio, digest_out);
-       if (wsame) {
-               err =
-                   __send_command(peer_device->connection, device->vnr, sock, P_WSAME,
-                                  sizeof(*wsame) + digest_size, NULL,
-                                  bio_iovec(req->master_bio).bv_len);
-       } else
-               err =
-                   __send_command(peer_device->connection, device->vnr, sock, P_DATA,
-                                  sizeof(*p) + digest_size, NULL, req->i.size);
+       err = __send_command(peer_device->connection, device->vnr, sock, P_DATA,
+                            sizeof(*p) + digest_size, NULL, req->i.size);
        if (!err) {
                /* For protocol A, we have to memcpy the payload into
                 * socket buffers, as we may complete right away