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 1/3] tape: changer: remove unnecesary inquiry parameter
Date: Wed, 28 Jul 2021 12:05:09 +0200	[thread overview]
Message-ID: <20210728100511.2862784-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210728100511.2862784-1-d.csapak@proxmox.com>

this is never used, so remove it.
Ok, since they are only non public functions.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/tape/changer/sg_pt_changer.rs | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/tape/changer/sg_pt_changer.rs b/src/tape/changer/sg_pt_changer.rs
index 3124b96f..2c5434f6 100644
--- a/src/tape/changer/sg_pt_changer.rs
+++ b/src/tape/changer/sg_pt_changer.rs
@@ -24,7 +24,6 @@ use crate::{
     tools::sgutils2::{
         SgRaw,
         SENSE_KEY_NOT_READY,
-        InquiryInfo,
         ScsiError,
         scsi_ascii_to_string,
         scsi_inquiry,
@@ -319,7 +318,6 @@ fn scsi_read_element_status_cdb(
 
 // query a single element type from the changer
 fn get_element<F: AsRawFd>(
-    inquiry: &InquiryInfo,
     sg_raw: &mut SgRaw<F>,
     element_type: ElementType,
     allocation_len: u32,
@@ -342,7 +340,7 @@ fn get_element<F: AsRawFd>(
 
         let data = execute_scsi_command(sg_raw, &cmd, "read element status (B8h)", retry)?;
 
-        let page = decode_element_status_page(&inquiry, &data, start_element_address)?;
+        let page = decode_element_status_page(&data, start_element_address)?;
 
         retry = false; // only retry the first command
 
@@ -394,18 +392,18 @@ pub fn read_element_status<F: AsRawFd>(file: &mut F) -> Result<MtxStatus, Error>
     let mut import_export_slots = Vec::new();
     let mut transports = Vec::new();
 
-    let page = get_element(&inquiry, &mut sg_raw, ElementType::Storage, allocation_len, true)?;
+    let page = get_element(&mut sg_raw, ElementType::Storage, allocation_len, true)?;
     storage_slots.extend(page.storage_slots);
 
-    let page = get_element(&inquiry, &mut sg_raw, ElementType::ImportExport, allocation_len, false)?;
+    let page = get_element(&mut sg_raw, ElementType::ImportExport, allocation_len, false)?;
     import_export_slots.extend(page.import_export_slots);
 
-    let page = get_element(&inquiry, &mut sg_raw, ElementType::DataTransfer, allocation_len, false)?;
+    let page = get_element(&mut sg_raw, ElementType::DataTransfer, allocation_len, false)?;
     drives.extend(page.drives);
 
     // get the serial + vendor + model,
     // some changer require this to be an extra scsi command
-    let page = get_element(&inquiry, &mut sg_raw, ElementType::DataTransferWithDVCID, allocation_len, false)?;
+    let page = get_element(&mut sg_raw, ElementType::DataTransferWithDVCID, allocation_len, false)?;
     // should be in same order and same count, but be on the safe side.
     // there should not be too many drives normally
     for drive in drives.iter_mut() {
@@ -418,7 +416,7 @@ pub fn read_element_status<F: AsRawFd>(file: &mut F) -> Result<MtxStatus, Error>
         }
     }
 
-    let page = get_element(&inquiry, &mut sg_raw, ElementType::MediumTransport, allocation_len, false)?;
+    let page = get_element(&mut sg_raw, ElementType::MediumTransport, allocation_len, false)?;
     transports.extend(page.transports);
 
     let transport_count = setup.transport_element_count as usize;
@@ -668,7 +666,6 @@ fn decode_dvcid_info<R: Read>(reader: &mut R) -> Result<DvcidInfo, Error> {
 }
 
 fn decode_element_status_page(
-    _info: &InquiryInfo,
     data: &[u8],
     start_element_address: u16,
 ) -> Result<DecodedStatusPage, Error> {
-- 
2.30.2





  reply	other threads:[~2021-07-28 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 10:05 [pbs-devel] [PATCH proxmox-backup 0/3] improve status page decoding Dominik Csapak
2021-07-28 10:05 ` Dominik Csapak [this message]
2021-07-28 10:20   ` [pbs-devel] applied: [PATCH proxmox-backup 1/3] tape: changer: remove unnecesary inquiry parameter Dietmar Maurer
2021-07-28 10:05 ` [pbs-devel] [PATCH proxmox-backup 2/3] tape: changer: handle libraries that sends wrong amount of data Dominik Csapak
2021-07-28 10:35   ` [pbs-devel] applied: " Dietmar Maurer
2021-07-28 10:05 ` [pbs-devel] [PATCH proxmox-backup 3/3] tape: changer: add tests for decode_element_status_page Dominik Csapak
2021-07-28 10:35   ` [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=20210728100511.2862784-2-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