10 Sep, 2020

1 commit

  • Switch to use bdev_check_media_changed instead of check_disk_change and
    call floppy_revalidate manually. Given that floppy_revalidate only
    deals with media change events, the extra call into ->revalidate_disk
    from bdev_disk_changed is not required either, so stop wiring up the
    method.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

13 Apr, 2019

1 commit

  • This reverts commit 9fd097b14918875bd6f125ed699d7bbbba5893ee.

    Instead of leaving disk->events completely empty, we now export the
    supported events again, and tell the block layer not to forward events to
    user space by not setting DISK_EVENT_FLAG_UEVENT. This allows the block
    layer to distinguish between devices that for which events should be
    handled in kernel only, and devices which don't support any meda change
    events at all.

    Cc: Jiri Kosina
    Cc: Tim Waugh
    Cc: Michal Simek
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin Wilck
    Signed-off-by: Jens Axboe

    Martin Wilck
     

01 Jan, 2019

3 commits

  • As of v4.20, the swim3 driver crashes when loaded on a PowerBook G3
    (Wallstreet).

    MacIO PCI driver attached to Gatwick chipset
    MacIO PCI driver attached to Heathrow chipset
    swim3 0.00015000:floppy: [fd0] SWIM3 floppy controller in media bay
    0.00013020:ch-a: ttyS0 at MMIO 0xf3013020 (irq = 16, base_baud = 230400) is a Z85c30 ESCC - Serial port
    0.00013000:ch-b: ttyS1 at MMIO 0xf3013000 (irq = 17, base_baud = 230400) is a Z85c30 ESCC - Infrared port
    macio: fixed media-bay irq on gatwick
    macio: fixed left floppy irqs
    swim3 1.00015000:floppy: [fd1] Couldn't request interrupt
    Unable to handle kernel paging request for data at address 0x00000024
    Faulting instruction address: 0xc02652f8
    Oops: Kernel access of bad area, sig: 11 [#1]
    BE SMP NR_CPUS=2 PowerMac
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.20.0 #2
    NIP: c02652f8 LR: c026915c CTR: c0276d1c
    REGS: df43ba10 TRAP: 0300 Not tainted (4.20.0)
    MSR: 00009032 CR: 28228288 XER: 00000100
    DAR: 00000024 DSISR: 40000000
    GPR00: c026915c df43bac0 df439060 c0731524 df494700 00000000 c06e1c08 00000001
    GPR08: 00000001 00000000 df5ff220 00001032 28228282 00000000 c0004ca4 00000000
    GPR16: 00000000 00000000 00000000 c073144c dfffe064 c0731524 00000120 c0586108
    GPR24: c073132c c073143c c073143c 00000000 c0731524 df67cd70 df494700 00000001
    NIP [c02652f8] blk_mq_free_rqs+0x28/0xf8
    LR [c026915c] blk_mq_sched_tags_teardown+0x58/0x84
    Call Trace:
    [df43bac0] [c0045f50] flush_workqueue_prep_pwqs+0x178/0x1c4 (unreliable)
    [df43bae0] [c026915c] blk_mq_sched_tags_teardown+0x58/0x84
    [df43bb00] [c02697f0] blk_mq_exit_sched+0x9c/0xb8
    [df43bb20] [c0252794] elevator_exit+0x84/0xa4
    [df43bb40] [c0256538] blk_exit_queue+0x30/0x50
    [df43bb50] [c0256640] blk_cleanup_queue+0xe8/0x184
    [df43bb70] [c034732c] swim3_attach+0x330/0x5f0
    [df43bbb0] [c034fb24] macio_device_probe+0x58/0xec
    [df43bbd0] [c032ba88] really_probe+0x1e4/0x2f4
    [df43bc00] [c032bd28] driver_probe_device+0x64/0x204
    [df43bc20] [c0329ac4] bus_for_each_drv+0x60/0xac
    [df43bc50] [c032b824] __device_attach+0xe8/0x160
    [df43bc80] [c032ab38] bus_probe_device+0xa0/0xbc
    [df43bca0] [c0327338] device_add+0x3d8/0x630
    [df43bcf0] [c0350848] macio_add_one_device+0x444/0x48c
    [df43bd50] [c03509f8] macio_pci_add_devices+0x168/0x1bc
    [df43bd90] [c03500ec] macio_pci_probe+0xc0/0x10c
    [df43bda0] [c02ad884] pci_device_probe+0xd4/0x184
    [df43bdd0] [c032ba88] really_probe+0x1e4/0x2f4
    [df43be00] [c032bd28] driver_probe_device+0x64/0x204
    [df43be20] [c032bfcc] __driver_attach+0x104/0x108
    [df43be40] [c0329a00] bus_for_each_dev+0x64/0xb4
    [df43be70] [c032add8] bus_add_driver+0x154/0x238
    [df43be90] [c032ca24] driver_register+0x84/0x148
    [df43bea0] [c0004aa0] do_one_initcall+0x40/0x188
    [df43bf00] [c0690100] kernel_init_freeable+0x138/0x1d4
    [df43bf30] [c0004cbc] kernel_init+0x18/0x10c
    [df43bf40] [c00121e4] ret_from_kernel_thread+0x14/0x1c
    Instruction dump:
    5484d97e 4bfff4f4 9421ffe0 7c0802a6 bf410008 7c9e2378 90010024 8124005c
    2f890000 419e0078 81230004 7c7c1b78 2f890000 419e0064 81440000
    ---[ end trace 12025ab921a9784c ]---

    Reverting commit 8ccb8cb1892b ("swim3: convert to blk-mq") resolves the
    problem.

    That commit added a struct blk_mq_tag_set to struct floppy_state and
    initialized it with a blk_mq_init_sq_queue() call. Unfortunately, there
    is a memset() in swim3_add_device() that subsequently clears the
    floppy_state struct. That means fs->tag_set->ops is a NULL pointer, and
    it gets dereferenced by blk_mq_free_rqs() which gets called in the
    request_irq() error path. Move the memset() to fix this bug.

    BTW, the request_irq() failure for the left mediabay floppy (fd1) is not
    a regression. I don't know why it happens. The right media bay floppy
    (fd0) works fine however.

    Reported-and-tested-by: Stan Johnson
    Fixes: 8ccb8cb1892b ("swim3: convert to blk-mq")
    Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Finn Thain

    Signed-off-by: Jens Axboe

    Finn Thain
     
  • When the block device is opened with FMODE_EXCL, ref_count is set to -1.
    This value doesn't get reset when the device is closed which means the
    device cannot be opened again. Fix this by checking for refcount
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Finn Thain
    Signed-off-by: Jens Axboe

    Finn Thain
     
  • Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Finn Thain
    Signed-off-by: Jens Axboe

    Finn Thain
     

16 Oct, 2018

2 commits

  • Pretty simple conversion. grab_drive() could probably be replaced by
    some freeze/quiesce incantation, but I left it alone, and just used
    freeze/quiesce for eject. Compile-tested only.

    Cc: Benjamin Herrenschmidt
    Signed-off-by: Omar Sandoval

    Converted to blk_mq_init_sq_queue().

    Signed-off-by: Jens Axboe

    Omar Sandoval
     
  • The driver doesn't have support for removing a device that has already
    been configured, but with more careful ordering we can avoid the need
    for that and make sure that we don't leak generic resources.

    Signed-off-by: Omar Sandoval
    Signed-off-by: Jens Axboe

    Omar Sandoval
     

17 Apr, 2018

1 commit

  • The Sony drive status bits use active-low logic. The swim_readbit()
    function converts that to 'C' logic for readability. Hence, the
    sense of the names of the status bit macros should not be inverted.

    Mostly they are correct. However, the TWOMEG_DRIVE, MFM_MODE and
    TWOMEG_MEDIA macros have inverted sense (like MkLinux). Fix this
    inconsistency and make the following patches less confusing.

    The same problem affects swim3.c so fix that too.

    No functional change.

    The FDHD drive status bits are documented in sonydriv.cpp from MAME
    and in swimiii.h from MkLinux.

    Cc: Laurent Vivier
    Cc: Benjamin Herrenschmidt
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: Jens Axboe
    Cc: stable@vger.kernel.org # v4.14+
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Acked-by: Laurent Vivier
    Signed-off-by: Jens Axboe

    Finn Thain
     

22 Nov, 2017

1 commit

  • With all callbacks converted, and the timer callback prototype
    switched over, the TIMER_FUNC_TYPE cast is no longer needed,
    so remove it. Conversion was done with the following scripts:

    perl -pi -e 's|\(TIMER_FUNC_TYPE\)||g' \
    $(git grep TIMER_FUNC_TYPE | cut -d: -f1 | sort -u)

    perl -pi -e 's|\(TIMER_DATA_TYPE\)||g' \
    $(git grep TIMER_DATA_TYPE | cut -d: -f1 | sort -u)

    The now unused macros are also dropped from include/linux/timer.h.

    Signed-off-by: Kees Cook

    Kees Cook
     

15 Nov, 2017

1 commit

  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly.

    Cc: Jens Axboe
    Cc: Johannes Thumshirn
    Cc: Ingo Molnar
    Cc: Arvind Yadav
    Signed-off-by: Kees Cook
    Signed-off-by: Jens Axboe

    Kees Cook
     

28 Jun, 2017

1 commit


16 Jun, 2017

1 commit

  • of_device_ids are not supposed to change at runtime. All functions
    working with of_device_ids provided by work with const
    of_device_ids. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    8908 1096 624 10628 2984 drivers/block/swim3.o

    File size after constify swim3_match:
    text data bss dec hex filename
    9708 296 624 10628 2984 drivers/block/swim3.o

    Signed-off-by: Arvind Yadav
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Jens Axboe

    Arvind Yadav
     

09 Jun, 2017

1 commit

  • Currently we use nornal Linux errno values in the block layer, and while
    we accept any error a few have overloaded magic meanings. This patch
    instead introduces a new blk_status_t value that holds block layer specific
    status codes and explicitly explains their meaning. Helpers to convert from
    and to the previous special meanings are provided for now, but I suspect
    we want to get rid of them in the long run - those drivers that have a
    errno input (e.g. networking) usually get errnos that don't know about
    the special block layer overloads, and similarly returning them to userspace
    will usually return somethings that strictly speaking isn't correct
    for file system operations, but that's left as an exercise for later.

    For now the set of errors is a very limited set that closely corresponds
    to the previous overloaded errno values, but there is some low hanging
    fruite to improve it.

    blk_status_t (ab)uses the sparse __bitwise annotations to allow for sparse
    typechecking, so that we can easily catch places passing the wrong values.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

21 Apr, 2017

1 commit


02 Mar, 2017

1 commit


25 Dec, 2016

1 commit


23 Mar, 2015

1 commit

  • ppc has special instruction forms to efficiently load and store values
    in non-native endianness. These can be accessed via the arch-specific
    {ld,st}_le{16,32}() inlines in arch/powerpc/include/asm/swab.h.

    However, gcc is perfectly capable of generating the byte-reversing
    load/store instructions when using the normal, generic cpu_to_le*() and
    le*_to_cpu() functions eaning the arch-specific functions don't have much
    point.

    Worse the "le" in the names of the arch specific functions is now
    misleading, because they always generate byte-reversing forms, but some
    ppc machines can now run a little-endian kernel.

    To start getting rid of the arch-specific forms, this patch removes them
    from all the old Power Macintosh drivers, replacing them with the
    generic byteswappers.

    Signed-off-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    David Gibson
     

16 Apr, 2014

1 commit

  • This was used in the olden days, back when onions were proper
    yellow. Basically it mapped to the current buffer to be
    transferred. With highmem being added more than a decade ago,
    most drivers map pages out of a bio, and rq->buffer isn't
    pointing at anything valid.

    Convert old style drivers to just use bio_data().

    For the discard payload use case, just reference the page
    in the bio.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

14 Mar, 2014

1 commit

  • interruptible_sleep_on is racy and going away. This replaces the one
    caller in the swim3 driver with the equivalent race-free
    wait_event_interruptible call. Since we're here already, this
    also fixes the case where we get interrupted from atomic context,
    which used to just spin in the loop.

    Signed-off-by: Arnd Bergmann
    Cc: Jens Axboe
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     

07 May, 2013

1 commit


22 Feb, 2013

1 commit


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Mike Miller
    Cc: Chirag Kantharia
    Cc: Geoff Levand
    Cc: Jim Paris
    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: Grant Likely
    Cc: Matthew Wilcox
    Cc: Keith Busch
    Cc: "David S. Miller"
    Cc: Benjamin Herrenschmidt
    Cc: NeilBrown
    Cc: Jens Axboe
    Cc: Tao Guo
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

12 Dec, 2011

1 commit

  • The old PowerMac swim3 driver has some "interesting" locking issues,
    using a private lock and failing to lock the queue before completing
    requests, which triggered WARN_ONs among others.

    This rips out the private lock, makes everything operate under the
    block queue lock, and generally makes things simpler.

    We used to also share a queue between the two possible instances which
    was problematic since we might pick the wrong controller in some cases,
    so make the queue and the current request per-instance and use
    queuedata to point to our private data which is a lot cleaner.

    We still share the queue lock but then, it's nearly impossible to actually
    use 2 swim3's simultaneously: one would need to have a Wallstreet
    PowerBook, the only machine afaik with two of these on the motherboard,
    and populate both hotswap bays with a floppy drive (the machine ships
    only with one), so nobody cares...

    While at it, add a little fix to clear up stale interrupts when loading
    the driver or plugging a floppy drive in a bay.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Jens Axboe

    Benjamin Herrenschmidt
     

03 Aug, 2011

1 commit


22 Apr, 2011

1 commit

  • In-kernel disk event polling doesn't matter for legacy/fringe drivers
    and may lead to infinite event loop if ->check_events() implementation
    generates events on level condition instead of edge.

    Now that block layer supports suppressing exporting unlisted events,
    simply leaving disk->events cleared allows these drivers to keep the
    internal revalidation behavior intact while avoiding weird
    interactions with userland event handler.

    Signed-off-by: Tejun Heo
    Cc: Kay Sievers
    Signed-off-by: Jens Axboe

    Tejun Heo
     

10 Mar, 2011

1 commit

  • Convert from ->media_changed() to ->check_events().

    Both swim and swim3 buffer media changed state and clear it on
    revalidation. They will behave correctly with kernel event polling.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe
    Cc: Kay Sievers
    Cc: Laurent Vivier
    Cc: Benjamin Herrenschmidt

    Tejun Heo
     

05 Oct, 2010

1 commit

  • The block device drivers have all gained new lock_kernel
    calls from a recent pushdown, and some of the drivers
    were already using the BKL before.

    This turns the BKL into a set of per-driver mutexes.
    Still need to check whether this is safe to do.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

08 Aug, 2010

2 commits

  • The open and release block_device_operations are currently
    called with the BKL held. In order to change that, we must
    first make sure that all drivers that currently rely
    on this have no regressions.

    This blindly pushes the BKL into all .open and .release
    operations for all block drivers to prepare for the
    next step. The drivers can subsequently replace the BKL
    with their own locks or remove it completely when it can
    be shown that it is not needed.

    The functions blkdev_get and blkdev_put are the only
    remaining users of the big kernel lock in the block
    layer, besides a few uses in the ioctl code, none
    of which need to serialize with blkdev_{get,put}.

    Most of these two functions is also under the protection
    of bdev->bd_mutex, including the actual calls to
    ->open and ->release, and the common code does not
    access any global data structures that need the BKL.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     
  • As a preparation for the removal of the big kernel
    lock in the block layer, this removes the BKL
    from the common ioctl handling code, moving it
    into every single driver still using it.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     

02 Jun, 2010

1 commit

  • Grant patches added an of mach table to struct device_driver. However,
    while he changed the macio device code to use that, he left the match
    table pointer in struct macio_driver and didn't update drivers to use
    the "new" one, thus breaking the probing.

    This completes the change by moving all drivers to setup the "new"
    one, removing all traces of the old one, and while at it (since it
    changes the exact same locations), I also remove two other duplicates
    from struct driver which are the name and owner fields.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

19 May, 2010

1 commit


09 Dec, 2009

1 commit

  • The hotplug mediabay has tendrils deep into drivers/ide code
    which makes a libata port reather difficult. In addition it's
    ugly and could be done better.

    This reworks the interface between the mediabay and the rest
    of the world so that:

    - Any macio_driver can now have a mediabay_event callback
    which will be called when that driver sits on a mediabay and
    it's been either plugged or unplugged. The device type is
    passed as an argument. We can now move all the IDE cruft
    into the IDE driver itself

    - A check_media_bay() function can be used to take a peek
    at the type of device currently in the bay if any, a cleaner
    variant of the previous function with the same name.

    - A pair of lock/unlock functions are exposed to allow the
    IDE driver to block the hotplug callbacks during the initial
    setup and probing of the bay in order to avoid nasty race
    conditions.

    - The mediabay code no longer needs to spin on the status
    register of the IDE interface when it detects an IDE device,
    this is done just fine by the IDE code itself

    Overall, less code, simpler, and allows for another driver
    than our old drivers/ide based one.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

22 Sep, 2009

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    trivial: fix typo in aic7xxx comment
    trivial: fix comment typo in drivers/ata/pata_hpt37x.c
    trivial: typo in kernel-parameters.txt
    trivial: fix typo in tracing documentation
    trivial: add __init/__exit macros in drivers/gpio/bt8xxgpio.c
    trivial: add __init macro/ fix of __exit macro location in ipmi_poweroff.c
    trivial: remove unnecessary semicolons
    trivial: Fix duplicated word "options" in comment
    trivial: kbuild: remove extraneous blank line after declaration of usage()
    trivial: improve help text for mm debug config options
    trivial: doc: hpfall: accept disk device to unload as argument
    trivial: doc: hpfall: reduce risk that hpfall can do harm
    trivial: SubmittingPatches: Fix reference to renumbered step
    trivial: fix typos "man[ae]g?ment" -> "management"
    trivial: media/video/cx88: add __init/__exit macros to cx88 drivers
    trivial: fix typo in CONFIG_DEBUG_FS in gcov doc
    trivial: fix missing printk space in amd_k7_smp_check
    trivial: fix typo s/ketymap/keymap/ in comment
    trivial: fix typo "to to" in multiple files
    trivial: fix typos in comments s/DGBU/DBGU/
    ...

    Linus Torvalds
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

21 Sep, 2009

1 commit


11 May, 2009

3 commits

  • Till now block layer allowed two separate modes of request execution.
    A request is always acquired from the request queue via
    elv_next_request(). After that, drivers are free to either dequeue it
    or process it without dequeueing. Dequeue allows elv_next_request()
    to return the next request so that multiple requests can be in flight.

    Executing requests without dequeueing has its merits mostly in
    allowing drivers for simpler devices which can't do sg to deal with
    segments only without considering request boundary. However, the
    benefit this brings is dubious and declining while the cost of the API
    ambiguity is increasing. Segment based drivers are usually for very
    old or limited devices and as converting to dequeueing model isn't
    difficult, it doesn't justify the API overhead it puts on block layer
    and its more modern users.

    Previous patches converted all block low level drivers to dequeueing
    model. This patch completes the API transition by...

    * renaming elv_next_request() to blk_peek_request()

    * renaming blkdev_dequeue_request() to blk_start_request()

    * adding blk_fetch_request() which is combination of peek and start

    * disallowing completion of queued (not started) requests

    * applying new API to all LLDs

    Renamings are for consistency and to break out of tree code so that
    it's apparent that out of tree drivers need updating.

    [ Impact: block request issue API cleanup, no functional change ]

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: James Bottomley
    Cc: Mike Miller
    Cc: unsik Kim
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: Laurent Vivier
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Grant Likely
    Cc: Adrian McMenamin
    Cc: Stephen Rothwell
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Alex Dubov
    Cc: Pierre Ossman
    Cc: David Woodhouse
    Cc: Markus Lidel
    Cc: Stefan Weinhuber
    Cc: Martin Schwidefsky
    Cc: Pete Zaitcev
    Cc: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • swim3 has at most single request in flight and already tracks it using
    fd_req. Convert it to dequeuing model by updating request fetching
    and wrapping completion function.

    [ Impact: dequeue in-flight request ]

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With recent cleanups, there is no place where low level driver
    directly manipulates request fields. This means that the 'hard'
    request fields always equal the !hard fields. Convert all
    rq->sectors, nr_sectors and current_nr_sectors references to
    accessors.

    While at it, drop superflous blk_rq_pos() < 0 test in swim.c.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Geert Uytterhoeven
    Tested-by: Grant Likely
    Acked-by: Grant Likely
    Tested-by: Adrian McMenamin
    Acked-by: Adrian McMenamin
    Acked-by: Mike Miller
    Cc: James Bottomley
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Eric Moore
    Cc: Alan Stern
    Cc: FUJITA Tomonori
    Cc: Pete Zaitcev
    Cc: Stephen Rothwell
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Alex Dubov
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: Dario Ballabio
    Cc: David S. Miller
    Cc: Rusty Russell
    Cc: unsik Kim
    Cc: Laurent Vivier
    Signed-off-by: Jens Axboe

    Tejun Heo
     

28 Apr, 2009

1 commit

  • swim3 curiously tries to update request parameters before calling
    __blk_end_request() when __blk_end_request() will do it anyway, and it
    updates request for partial completion manually instead of using
    blk_update_request(). Also, it does some spurious checks on rq such
    as testing whether rq->sector is negative or current_nr_sectors is
    zero right after fetching.

    Drop unnecessary stuff and use standard block layer mechanisms.

    [ Impact: cleanup ]

    Signed-off-by: Tejun Heo
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Jens Axboe

    Tejun Heo