1. 28 4月, 2009 15 次提交
    • T
      mg_disk: fold mg_disk.h into mg_disk.c · eec94620
      Tejun Heo 提交于
      include/linux/mg_disk.h is used only by drivers/block/mg_disk.c.  No
      reason to put it in a separate header.  Fold it into mg_disk.c.
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: unsik Kim <donari75@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      eec94620
    • T
      block: make blk_end_request_cur() return bool · 9fd8d0e1
      Tejun Heo 提交于
      In the process of mindlessly copying [__]blk_end_request_all(),
      [__]blk_end_request_cur() ended up returning void even though they're
      partial completion functions.  Fix it.
      
      [ Impact: fix braindead API ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      9fd8d0e1
    • T
      block: kill rq->data · 731ec497
      Tejun Heo 提交于
      Now that all block request data transfer is done via bio, rq->data
      isn't used.  Kill it.
      
      While at it, make the roles of rq->special and buffer clear.
      
      [ Impact: drop now unncessary field from struct request ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      731ec497
    • T
      block: replace end_request() with [__]blk_end_request_cur() · f06d9a2b
      Tejun Heo 提交于
      end_request() has been kept around for backward compatibility;
      however, it's about time for it to go away.
      
      * There aren't too many users left.
      
      * Its use of @updtodate is pretty confusing.
      
      * In some cases, newer code ends up using mixture of end_request() and
        [__]blk_end_request[_all](), which is way too confusing.
      
      So, add [__]blk_end_request_cur() and replace end_request() with it.
      Most conversions are straightforward.  Noteworthy ones are...
      
      * paride/pcd: next_request() updated to take 0/-errno instead of 1/0.
      
      * paride/pf: pf_end_request() and next_request() updated to take
        0/-errno instead of 1/0.
      
      * xd: xd_readwrite() updated to return 0/-errno instead of 1/0.
      
      * mtd/mtd_blkdevs: blktrans_discard_request() updated to return
        0/-errno instead of 1/0.  Unnecessary local variable res
        initialization removed from mtd_blktrans_thread().
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NJoerg Dorchain <joerg@dorchain.net>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NLaurent Vivier <Laurent@lvivier.info>
      Cc: Tim Waugh <tim@cyberelk.net>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: unsik Kim <donari75@gmail.com>
      f06d9a2b
    • T
      block: implement and use [__]blk_end_request_all() · 40cbbb78
      Tejun Heo 提交于
      There are many [__]blk_end_request() call sites which call it with
      full request length and expect full completion.  Many of them ensure
      that the request actually completes by doing BUG_ON() the return
      value, which is awkward and error-prone.
      
      This patch adds [__]blk_end_request_all() which takes @rq and @error
      and fully completes the request.  BUG_ON() is added to to ensure that
      this actually happens.
      
      Most conversions are simple but there are a few noteworthy ones.
      
      * cdrom/viocd: viocd_end_request() replaced with direct calls to
        __blk_end_request_all().
      
      * s390/block/dasd: dasd_end_request() replaced with direct calls to
        __blk_end_request_all().
      
      * s390/char/tape_block: tapeblock_end_request() replaced with direct
        calls to blk_end_request_all().
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      40cbbb78
    • T
      block: clean up request completion API · 2e60e022
      Tejun Heo 提交于
      Request completion has gone through several changes and became a bit
      messy over the time.  Clean it up.
      
      1. end_that_request_data() is a thin wrapper around
         end_that_request_data_first() which checks whether bio is NULL
         before doing anything and handles bidi completion.
         blk_update_request() is a thin wrapper around
         end_that_request_data() which clears nr_sectors on the last
         iteration but doesn't use the bidi completion.
      
         Clean it up by moving the initial bio NULL check and nr_sectors
         clearing on the last iteration into end_that_request_data() and
         renaming it to blk_update_request(), which makes blk_end_io() the
         only user of end_that_request_data().  Collapse
         end_that_request_data() into blk_end_io().
      
      2. There are four visible completion variants - blk_end_request(),
         __blk_end_request(), blk_end_bidi_request() and end_request().
         blk_end_request() and blk_end_bidi_request() uses blk_end_request()
         as the backend but __blk_end_request() and end_request() use
         separate implementation in __blk_end_request() due to different
         locking rules.
      
         blk_end_bidi_request() is identical to blk_end_io().  Collapse
         blk_end_io() into blk_end_bidi_request(), separate out request
         update into internal helper blk_update_bidi_request() and add
         __blk_end_bidi_request().  Redefine [__]blk_end_request() as thin
         inline wrappers around [__]blk_end_bidi_request().
      
      3. As the whole request issue/completion usages are about to be
         modified and audited, it's a good chance to convert completion
         functions return bool which better indicates the intended meaning
         of return values.
      
      4. The function name end_that_request_last() is from the days when it
         was a public interface and slighly confusing.  Give it a proper
         internal name - blk_finish_request().
      
      5. Add description explaning that blk_end_bidi_request() can be safely
         used for uni requests as suggested by Boaz Harrosh.
      
      The only visible behavior change is from #1.  nr_sectors counts are
      cleared after the final iteration no matter which function is used to
      complete the request.  I couldn't find any place where the code
      assumes those nr_sectors counters contain the values for the last
      segment and this change is good as it makes the API much more
      consistent as the end result is now same whether a request is
      completed using [__]blk_end_request() alone or in combination with
      blk_update_request().
      
      API further cleaned up per Christoph's suggestion.
      
      [ Impact: cleanup, rq->*nr_sectors always updated after req completion ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reviewed-by: NBoaz Harrosh <bharrosh@panasas.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      2e60e022
    • T
      block: kill blk_end_request_callback() · 0b302d5a
      Tejun Heo 提交于
      With recent IDE updates, blk_end_request_callback() doesn't have any
      user now.  Kill it.
      
      [ Impact: removal of unused convoluted interface ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      0b302d5a
    • T
      block: reorder request completion functions · 5efccd17
      Tejun Heo 提交于
      Reorder request completion functions such that
      
      * All request completion functions are located together.
      
      * Functions which are used by only one caller is put right above the
        caller.
      
      * end_request() is put after other completion functions but before
        blk_update_request().
      
      This change is for completion function cleanup which will follow.
      
      [ Impact: cleanup, code reorganization ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      5efccd17
    • T
      block: kill blk_start_queueing() · a7f55792
      Tejun Heo 提交于
      blk_start_queueing() is identical to __blk_run_queue() except that it
      doesn't check for recursion.  None of the current users depends on
      blk_start_queueing() running request_fn directly.  Replace usages of
      blk_start_queueing() with [__]blk_run_queue() and kill it.
      
      [ Impact: removal of mostly duplicate interface function ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      a7f55792
    • T
      ide-atapi: kill unused fields and callbacks · 29d1a437
      Tejun Heo 提交于
      Impact: remove fields and code paths which are no longer necessary
      
      Now that ide-tape uses standard mechanisms to transfer data, special
      case handling for bh handling can be dropped from ide-atapi.  Drop the
      followings.
      
      * pc->cur_pos, b_count, bh and b_data
      * drive->pc_update_buffers() and pc_io_buffers().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      29d1a437
    • T
      ide-cd,atapi: use bio for internal commands · 02e7cf8f
      Tejun Heo 提交于
      Impact: unify request data buffer handling
      
      rq->data is used mostly to pass kernel buffer through request queue
      without using bio.  There are only a couple of places which still do
      this in kernel and converting to bio isn't difficult.
      
      This patch converts ide-cd and atapi to use bio instead of rq->data
      for request sense and internal pc commands.  With previous change to
      unify sense request handling, this is relatively easily achieved by
      adding blk_rq_map_kern() during sense_rq prep and PC issue.
      
      If blk_rq_map_kern() fails for sense, the error is deferred till sense
      issue and aborts the failed command which triggered the sense.  Note
      that this is a slim possibility as sense prep is done on each command
      issue, so for the above condition to actually trigger, all preps since
      the last sense issue till the issue of the request which would require
      a sense should fail.
      
      * do_request functions might sleep now.  This should be okay as ide
        request_fn - do_ide_request() - is invoked only from make_request
        and plug work.  Make sure this is the case by adding might_sleep()
        to do_ide_request().
      
      * Functions which access the read sense data before the sense request
        is complete now should access bio_data(sense_rq->bio) as the sense
        buffer might have been copied during blk_rq_map_kern().
      
      * ide-tape updated to map sg.
      
      * cdrom_do_block_pc() now doesn't have to deal with REQ_TYPE_ATA_PC
        special case.  Simplified.
      
      * tp_ops->output/input_data path dropped from ide_pc_intr().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      02e7cf8f
    • B
      ide-atapi: convert ide-{floppy,tape} to using preallocated sense buffer · 06875320
      Borislav Petkov 提交于
      Since we're issuing REQ_TYPE_SENSE now we need to allow those types of
      rqs in the ->do_request callbacks. As a future improvement, sense_len
      assignment might be unified across all ATAPI devices. Borislav to
      check with specs and test.
      
      As a result, get rid of ide_queue_pc_head() and
      drive->request_sense_rq.
      
      tj: * Init request sense ide_atapi_pc from sense request.  In the
            longer timer, it would probably better to fold
            ide_create_request_sense_cmd() into its only current user -
            ide_floppy_get_format_progress().
      
          * ide_retry_pc() no longer takes @disk.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      06875320
    • B
      ide: add helpers for preparing sense requests · e69d800f
      Borislav Petkov 提交于
      This is in preparation of removing the queueing of a sense request out
      of the IRQ handler path.
      
      Use struct request_sense as a general sense buffer for all ATAPI
      devices ide-{floppy,tape,cd}.
      
      tj: * blk_get_request(__GFP_WAIT) can't be called from do_request() as
            it can cause deadlock.  Converted to use inline struct request
            and blk_rq_init().
      
          * Added xfer / cdb len selection depending on device type.
      
          * All sense prep logics folded into ide_prep_sense() which never
            fails.
      
          * hwif->rq clearing and sense_rq used handling moved into
            ide_queue_sense_rq().
      
          * blk_rq_map_kern() conversion is moved to later patch.
      
      CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      CC: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      e69d800f
    • T
      ide kill unused ide_cmd->special · 214ae191
      Tejun Heo 提交于
      Impact: removal of unused field
      
      No one uses ide_cmd->special anymore.  Kill it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      214ae191
    • A
      loop: use BIO list management functions · e686307f
      Akinobu Mita 提交于
      Now that the bio list management stuff is generic, convert loop to use
      bio lists instead of its own private bio list implementation.
      
      Cc:  Jens Axboe <axboe@kernel.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e686307f
  2. 27 4月, 2009 1 次提交
    • T
      Add new HEAD_TEXT_SECTION macro. · c80d471a
      Tim Abbott 提交于
      This patch is preparation for replacing all uses of ".head.text" or
      ".text.head" in the kernel with macros, so that the section name can
      later be changed without having to touch a lot of the kernel.
      
      Since some linker scripts do more complex things than referencing
      HEAD_TEXT, we add a HEAD_TEXT_SECTION macro that just contains the
      actual name.
      
      I've defined HEAD_TEXT_SECTION in a new header,
      include/linux/section-names.h, so that this section name only needs to
      appear in one place.  I anticipate creating similar macro structures
      for a number of other section names.
      
      The long-term goal here is to be able to change the kernel's magic
      section names to those that are compatible with -ffunction-sections
      -fdata-sections.  This requires renaming all magic sections with names
      of the form ".text.foo".
      Signed-off-by: NTim Abbott <tabbott@mit.edu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c80d471a
  3. 24 4月, 2009 3 次提交
  4. 23 4月, 2009 2 次提交
  5. 22 4月, 2009 13 次提交
  6. 21 4月, 2009 6 次提交