1. 26 10月, 2010 4 次提交
  2. 03 9月, 2010 1 次提交
  3. 08 8月, 2010 1 次提交
    • C
      block: unify flags for struct bio and struct request · 7b6d91da
      Christoph Hellwig 提交于
      Remove the current bio flags and reuse the request flags for the bio, too.
      This allows to more easily trace the type of I/O from the filesystem
      down to the block driver.  There were two flags in the bio that were
      missing in the requests:  BIO_RW_UNPLUG and BIO_RW_AHEAD.  Also I've
      renamed two request flags that had a superflous RW in them.
      
      Note that the flags are in bio.h despite having the REQ_ name - as
      blkdev.h includes bio.h that is the only way to go for now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      7b6d91da
  4. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  5. 03 3月, 2010 1 次提交
  6. 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
  7. 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: Bugfix of error handling in attributes-list decoding · eff21490
      Boaz Harrosh 提交于
      When an error was detected in an attribute list do to
      a target bug. We would print an error but spin endlessly
      regardless. Fix it.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      eff21490
    • B
      [SCSI] libosd: bug in osd_req_decode_sense_full() · 71ecb74b
      Boaz Harrosh 提交于
      The (never tested) osd_sense_attribute_identification case
      has never worked. The loop was never advanced on.
      Fix it to work as intended.
      
      On 10/30/2009 04:39 PM, Roel Kluin wrote:
        I found this by code analysis, searching for while
        loops that test a local variable, but do not modify
        the variable.
      Reported-by: NRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      71ecb74b
    • 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
  8. 10 6月, 2009 6 次提交
  9. 19 5月, 2009 2 次提交
  10. 11 5月, 2009 1 次提交
    • T
      block: cleanup rq->data_len usages · b0790410
      Tejun Heo 提交于
      With recent unification of fields, it's now guaranteed that
      rq->data_len always equals blk_rq_bytes().  Convert all non-IDE direct
      users to accessors.  IDE will be converted in a separate patch.
      
      Boaz: spotted incorrect data_len/resid_len conversion in osd.
      
      [ Impact: convert direct rq->data_len usages to blk_rq_bytes() ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      Cc: Darrick J. Wong <djwong@us.ibm.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      b0790410
  11. 28 4月, 2009 4 次提交
  12. 03 4月, 2009 1 次提交
  13. 13 3月, 2009 9 次提交