1. 26 10月, 2010 1 次提交
    • B
      [SCSI] libosd: Support for scatter gather write/read commands · e96e72c4
      Boaz Harrosh 提交于
      This patch adds the Scatter-Gather (sg) API to libosd.
      Scatter-gather enables a write/read of multiple none-contiguous
      areas of an object, in a single call. The extents may overlap
      and/or be in any order.
      
      The Scatter-Gather list is sent to the target in what is called
      a "cdb continuation segment". This is yet another possible segment
      in the osd-out-buffer. It is unlike all other segments in that it
      sits before the actual "data" segment (which until now was always
      first), and that it is signed by itself and not part of the data
      buffer. This is because the cdb-continuation-segment is considered
      a spill-over of the CDB data, and is therefor signed under
      OSD_SEC_CAPKEY and higher.
      
      TODO: A new osd_finalize_request_ex version should be supplied so
      the @caps received on the network also contains a size parameter
      and can be spilled over into the "cdb continuation segment".
      
      Thanks to John Chandy <john.chandy@uconn.edu> for the original
      code, and investigations. And the implementation of SG support
      in the osd-target.
      Original-coded-by: NJohn Chandy <john.chandy@uconn.edu>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e96e72c4
  2. 10 12月, 2009 1 次提交
    • B
      [SCSI] libosd: Fix blk_put_request locking again · 5d0961fd
      Boaz Harrosh 提交于
      So libosd has decided to sacrifice some code simplicity for the sake of
      a clean API. One of these things is the possibility for users to call
      osd_end_request, in any condition at any state. This opens up some
      problems with calling blk_put_request when out-side of the completion
      callback but calling __blk_put_request when detecting a from-completion
      state.
      
      The current hack was working just fine until exofs decided to operate on
      all devices in parallel and wait for the sum of the requests, before
      deallocating all osd-requests at once. There are two new possible cases
      1. All request in a group are deallocated as part of the last request's
         async-done, request_queue is locked.
      2. All request in a group where executed asynchronously, but
         de-allocation was delayed to after the async-done, in the context of
         another thread. Async execution but request_queue is not locked.
      
      The solution I chose was to separate the deallocation of the osd_request
      which has the information users need, from the deallocation of the
      internal(2) requests which impose the locking problem. The internal
      block-requests are freed unconditionally inside the async-done-callback,
      when we know the queue is always locked. If at osd_end_request time we
      still have a bock-request, then we know it did not come from within an
      async-done-callback and we can call the regular blk_put_request.
      
      The internal requests were used for carrying error information after
      execution. This information is now copied to osd_request members for
      later analysis by user code.
      
      The external API and behaviour was unchanged, except now it really
      supports what was previously advertised.
      Reported-by: NVineet Agarwal <checkout.vineet@gmail.com>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      5d0961fd
  3. 05 12月, 2009 4 次提交
    • B
      [SCSI] libosd: Error handling revamped · aa9fffbe
      Boaz Harrosh 提交于
      Administer some love to the osd_req_decode_sense function
      
      * Fix a bad bug with osd_req_decode_sense(). If there was no scsi
        residual, .i.e the request never reached the target, then all the
        osd_sense_info members where garbage.
      
      * Add grossly missing in/out_resid to osd_sense_info and fill them in
        properly.
      
      * Define an osd_err_priority enum which divides the possible errors into
        7 categories in ascending severity. Each category is also assigned a
        Linux return code translation.
      
        Analyze the different osd/scsi/block returned errors and set the
        proper osd_err_priority and Linux return code accordingly.
      
      * extra check a few situations so not to get stuck with inconsistent
        error view. Example an empty residual with an error code, and other
        places ...
      
      Lots of libosd's osd_req_decode_sense clients had this logic in some
      form or another. Consolidate all these into one place that should
      actually know about osd returns. Thous translating it to a more
      abstract error.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      aa9fffbe
    • B
      [SCSI] libosd: osd_dev_info: Unique Identification of an OSD device · 2cdd6410
      Boaz Harrosh 提交于
      Define an osd_dev_info structure that Uniquely identifies an OSD
      device lun on the network. The identification is built from unique
      target attributes and is the same for all network/SAN machines.
      
      osduld_info_lookup() - NEW
          New API that will lookup an osd_dev by its osd_dev_info.
          This is used by pNFS-objects for cross network global device
          identification. And by exofs multy-device support, the device
          info is specified in the on-disk exofs device table.
      
      osduld_device_info() - NEW
          Given an osd_dev handle returns its associated osd_dev_info.
          The ULD fetches this information at startup and hangs it on
          each OSD device. (This is a fast operation that can be called
          at any condition)
      
      osduld_device_same() - NEW
          With a given osd_dev at one hand and an osd_dev_info
          at another, we would like to know if they are the same
          device.
          Two osd_dev handles can be checked by:
              osduld_device_same(od1, osduld_device_info(od2));
      
      osd_auto_detect_ver() - REVISED
          Now returns an osd_dev_info structure. Is only called once
          by ULD as before. See added comments for how to use.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      2cdd6410
    • B
      [SCSI] osduld: Use device->release instead of internal kref · d6ae4333
      Boaz Harrosh 提交于
      The true logic of this patch will be clear in the next patch where we
      use the class_find_device() API. When doing so the use of an internal
      kref leaves us a narrow window where a find is started while the actual
      object can go away. Using the device's kobj reference solves this
      problem because now the same kref is used for both operations. (Remove
      and find)
      
      Core changes
      * Embed a struct device in uld_ structure and use device_register
        instead of devie_create. Set __remove to be the device release
        function.
      * __uld_get/put is just get_/put_device. Now every thing is accounted
        for on the device object. Internal kref is removed.
      * At __remove() we can safely de-allocate the uld_ structure. (The
        function has moved to avoid forward declaration)
      
      Some cleanups
      * Use class register/unregister is cleaner for this driver now.
      * cdev ref-counting games are no longer necessary
      
      I have incremented the device version string in case of new bugs.
      
      Note: Previous bugfix of taking the reference around fput() still
            applies.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      d6ae4333
    • B
      [SCSI] libosd: osd_dev_is_ver1 - Minor API cleanup · d531b379
      Boaz Harrosh 提交于
      define a new osd_dev_is_ver1 that operates on devices
      and the old osd_req_is_ver1 uses that new API.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      d531b379
  4. 10 6月, 2009 4 次提交
  5. 13 3月, 2009 6 次提交