09 Oct, 2008

4 commits

  • Two mods to blkdev_issue_discard(), thinking ahead to its use on swap:

    1. Add gfp_mask argument, so swap allocation can use it where GFP_KERNEL
    might deadlock but GFP_NOIO is safe.

    2. Enlarge nr_sects argument from unsigned to sector_t: unsigned long is
    enough to cover a whole swap area, but sector_t suits any partition.

    Change sb_issue_discard()'s nr_blocks to sector_t too; but no need seen
    for a gfp_mask there, just pass GFP_KERNEL down to blkdev_issue_discard().

    Signed-off-by: Hugh Dickins
    Signed-off-by: Jens Axboe

    Hugh Dickins
     
  • But blkdev_issue_discard() still emits requests which are interpreted as
    soft barriers, because naïve callers might otherwise issue subsequent
    writes to those same sectors, which might cross on the queue (if they're
    reallocated quickly enough).

    Callers still _can_ issue non-barrier discard requests, but they have to
    take care of queue ordering for themselves.

    Signed-off-by: David Woodhouse
    Signed-off-by: Jens Axboe

    David Woodhouse
     
  • Barriers should be submitted with the WRITE flag set.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: David Woodhouse
    Signed-off-by: Jens Axboe

    OGAWA Hirofumi
     
  • Some block devices benefit from a hint that they can forget the contents
    of certain sectors. Add basic support for this to the block core, along
    with a 'blkdev_issue_discard()' helper function which issues such
    requests.

    The caller doesn't get to provide an end_io functio, since
    blkdev_issue_discard() will automatically split the request up into
    multiple bios if appropriate. Neither does the function wait for
    completion -- it's expected that callers won't care about when, or even
    _if_, the request completes. It's only a hint to the device anyway. By
    definition, the file system doesn't _care_ about these sectors any more.

    [With feedback from OGAWA Hirofumi and
    Jens Axboe
    Signed-off-by: Jens Axboe

    David Woodhouse
     

01 May, 2008

1 commit


29 Apr, 2008

3 commits

  • This rename rq_init() blk_rq_init() and export it. Any path that hands
    the request to the block layer needs to call it to initialize the
    request.

    This is a preparation for large command support, which needs to
    initialize the request in a proper way (that is, just doing a memset()
    will not work).

    Signed-off-by: FUJITA Tomonori
    Cc: Jens Axboe
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     
  • This patch fixes the following build error with UML and gcc 4.3:

    ...
    CC block/blk-barrier.o
    /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c: In function ‘blk_do_ordered’:
    /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ‘blk_ordered_cur_seq’: function body not available
    /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:252: sorry, unimplemented: called from here
    /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:57: sorry, unimplemented: inlining failed in call to ‘blk_ordered_cur_seq’: function body not available
    /home/bunk/linux/kernel-2.6/git/linux-2.6/block/blk-barrier.c:253: sorry, unimplemented: called from here
    make[2]: *** [block/blk-barrier.o] Error 1

    Signed-off-by: Adrian Bunk
    Signed-off-by: Jens Axboe

    Adrian Bunk
     
  • This requires moving rq_init() from get_request() to blk_alloc_request().
    The upside is that we can now require an rq_init() from any path that
    wishes to hand the request to the block layer.

    rq_init() will be exported for the code that uses struct request
    without blk_get_request.

    This is a preparation for large command support, which needs to
    initialize struct request in a proper way (that is, just doing a
    memset() will not work).

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

04 Mar, 2008

1 commit


01 Feb, 2008

1 commit


30 Jan, 2008

1 commit