]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/target/target_core_spc.c
target: Add/check max_write_same_len device attribute + update block limits VPD
[karo-tx-linux.git] / drivers / target / target_core_spc.c
index 4b3c18305ec802eddcd67ea4add4704206660839..cf1b8bb310c433a70c5415b51fbf07d9c7c7c3ea 100644 (file)
@@ -465,7 +465,7 @@ spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
         * Exit now if we don't support TP.
         */
        if (!have_tp)
-               return 0;
+               goto max_write_same;
 
        /*
         * Set MAXIMUM UNMAP LBA COUNT
@@ -491,6 +491,12 @@ spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
        if (dev->dev_attrib.unmap_granularity_alignment != 0)
                buf[32] |= 0x80; /* Set the UGAVALID bit */
 
+       /*
+        * MAXIMUM WRITE SAME LENGTH
+        */
+max_write_same:
+       put_unaligned_be64(dev->dev_attrib.max_write_same_len, &buf[36]);
+
        return 0;
 }