From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 1A7D898603
 for <pbs-devel@lists.proxmox.com>; Mon, 24 Apr 2023 09:51:37 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id EE90A2DDA8
 for <pbs-devel@lists.proxmox.com>; Mon, 24 Apr 2023 09:51:06 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pbs-devel@lists.proxmox.com>; Mon, 24 Apr 2023 09:51:05 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 74D8E450EE
 for <pbs-devel@lists.proxmox.com>; Mon, 24 Apr 2023 09:51:05 +0200 (CEST)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Date: Mon, 24 Apr 2023 09:51:04 +0200
Message-Id: <20230424075104.840740-1-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.035 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 PROLO_LEO1                0.1 Meta Catches all Leo drug variations so far
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pbs-devel] [PATCH proxmox-backup v2] tape: typo fixes
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 24 Apr 2023 07:51:37 -0000

replacable to replaceable
 the field 'field_replacable_unit_code' is not currently used anywhere
descriptior to descriptor
Resuqest to Request
and flags2 to flags3 (the number indicates the numbering of the field
 and it's the third field, not the second)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
v2 includes all typo fixes that i did in my 3/4 previously, but weren't
included in dietmars version of the patch

 pbs-tape/src/sgutils2.rs | 42 ++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/pbs-tape/src/sgutils2.rs b/pbs-tape/src/sgutils2.rs
index 30f287b0..afe85501 100644
--- a/pbs-tape/src/sgutils2.rs
+++ b/pbs-tape/src/sgutils2.rs
@@ -192,7 +192,7 @@ pub struct RequestSenseFixed {
     pub command_specific_information: [u8; 4],
     pub additional_sense_code: u8,
     pub additional_sense_code_qualifier: u8,
-    pub field_replacable_unit_code: u8,
+    pub field_replaceable_unit_code: u8,
     pub sense_key_specific: [u8; 3],
 }
 
@@ -232,7 +232,7 @@ pub struct ModeParameterHeader10 {
     pub medium_type: u8,
     pub flags3: u8,
     reserved4: [u8; 2],
-    pub block_descriptior_len: u16,
+    pub block_descriptor_len: u16,
 }
 
 #[repr(C, packed)]
@@ -243,8 +243,8 @@ pub struct ModeParameterHeader6 {
     // drives, medium_type provides very limited information and is
     // not compatible with IBM.
     pub medium_type: u8,
-    pub flags2: u8,
-    pub block_descriptior_len: u8,
+    pub flags3: u8,
+    pub block_descriptor_len: u8,
 }
 
 impl ModeParameterHeader10 {
@@ -271,21 +271,21 @@ impl ModeParameterHeader10 {
 impl ModeParameterHeader6 {
     #[allow(clippy::unusual_byte_groupings)]
     pub fn buffer_mode(&self) -> u8 {
-        (self.flags2 & 0b0_111_0000) >> 4
+        (self.flags3 & 0b0_111_0000) >> 4
     }
 
     #[allow(clippy::unusual_byte_groupings)]
     pub fn set_buffer_mode(&mut self, buffer_mode: bool) {
-        let mut mode = self.flags2 & 0b1_000_1111;
+        let mut mode = self.flags3 & 0b1_000_1111;
         if buffer_mode {
             mode |= 0b0_001_0000;
         }
-        self.flags2 = mode;
+        self.flags3 = mode;
     }
 
     #[allow(clippy::unusual_byte_groupings)]
     pub fn write_protect(&self) -> bool {
-        (self.flags2 & 0b1_000_0000) != 0
+        (self.flags3 & 0b1_000_0000) != 0
     }
 }
 
@@ -764,17 +764,17 @@ fn decode_mode_sense10_result<P: Endian>(
         _ => (),
     }
 
-    if disable_block_descriptor && head.block_descriptior_len != 0 {
-        let len = head.block_descriptior_len;
-        bail!("wrong block_descriptior_len: {}, expected 0", len);
+    if disable_block_descriptor && head.block_descriptor_len != 0 {
+        let len = head.block_descriptor_len;
+        bail!("wrong block_descriptor_len: {}, expected 0", len);
     }
 
     let mut block_descriptor: Option<ModeBlockDescriptor> = None;
 
     if !disable_block_descriptor {
-        if head.block_descriptior_len != 8 {
-            let len = head.block_descriptior_len;
-            bail!("wrong block_descriptior_len: {}, expected 8", len);
+        if head.block_descriptor_len != 8 {
+            let len = head.block_descriptor_len;
+            bail!("wrong block_descriptor_len: {}, expected 8", len);
         }
 
         block_descriptor = Some(unsafe { reader.read_be_value()? });
@@ -810,17 +810,17 @@ fn decode_mode_sense6_result<P: Endian>(
         _ => (),
     }
 
-    if disable_block_descriptor && head.block_descriptior_len != 0 {
-        let len = head.block_descriptior_len;
-        bail!("wrong block_descriptior_len: {}, expected 0", len);
+    if disable_block_descriptor && head.block_descriptor_len != 0 {
+        let len = head.block_descriptor_len;
+        bail!("wrong block_descriptor_len: {}, expected 0", len);
     }
 
     let mut block_descriptor: Option<ModeBlockDescriptor> = None;
 
     if !disable_block_descriptor {
-        if head.block_descriptior_len != 8 {
-            let len = head.block_descriptior_len;
-            bail!("wrong block_descriptior_len: {}, expected 8", len);
+        if head.block_descriptor_len != 8 {
+            let len = head.block_descriptor_len;
+            bail!("wrong block_descriptor_len: {}, expected 8", len);
         }
 
         block_descriptor = Some(unsafe { reader.read_be_value()? });
@@ -977,7 +977,7 @@ pub fn scsi_mode_sense6<F: AsRawFd, P: Endian>(
         .map_err(|err| format_err!("decode mode sense(6) failed - {}", err))
 }
 
-/// Resuqest Sense
+/// Request Sense
 pub fn scsi_request_sense<F: AsRawFd>(file: &mut F) -> Result<RequestSenseFixed, ScsiError> {
     // request 252 bytes, as mentioned in the Seagate SCSI reference
     let allocation_len: u8 = 252;
-- 
2.30.2