public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2] tape: typo fixes
Date: Mon, 24 Apr 2023 09:51:04 +0200	[thread overview]
Message-ID: <20230424075104.840740-1-d.csapak@proxmox.com> (raw)

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





             reply	other threads:[~2023-04-24  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24  7:51 Dominik Csapak [this message]
2023-04-24  7:55 ` [pbs-devel] applied " Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230424075104.840740-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal