02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Aug, 2017

1 commit


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

  • This passes on the scsi_cmnd result field to users of passthrough
    requests. Currently we abuse req->errors for this purpose, but that
    field will go away in its current form.

    Note that the old IDE code abuses the errors field in very creative
    ways and stores all kinds of different values in it. I didn't dare
    to touch this magic, so the abuses are brought forward 1:1.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Bart Van Assche
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

01 Feb, 2017

2 commits

  • Instead of keeping two levels of indirection for requests types, fold it
    all into the operations. The little caveat here is that previously
    cmd_type only applied to struct request, while the request and bio op
    fields were set to plain REQ_OP_READ/WRITE even for passthrough
    operations.

    Instead this patch adds new REQ_OP_* for SCSI passthrough and driver
    private requests, althought it has to add two for each so that we
    can communicate the data in/out nature of the request.

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

    Christoph Hellwig
     
  • Currently the legacy ide driver defines several request types of it's own,
    which is in the way of removing that field entirely.

    Instead add a type field to struct ide_request and use that to distinguish
    the different types of IDE-internal requests.

    It's a bit of a mess, but so is the surrounding code..

    Signed-off-by: Christoph Hellwig
    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

28 Jan, 2017

1 commit

  • And require all drivers that want to support BLOCK_PC to allocate it
    as the first thing of their private data. To support this the legacy
    IDE and BSG code is switched to set cmd_size on their queues to let
    the block layer allocate the additional space.

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

    Christoph Hellwig
     

08 Jun, 2016

1 commit

  • The req operation REQ_OP is separated from the rq_flag_bits
    definition. This converts the block layer drivers to
    use req_op to get the op from the request struct.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     

06 May, 2015

2 commits


13 Dec, 2014

1 commit


09 Nov, 2011

1 commit

  • The top of has this comment:

    * Please do not include this file in generic code. There is currently
    * no requirement for any architecture to implement anything held
    * within this file.
    *
    * Thanks. --rmk

    Remove inclusion of , to prevent the following compile error
    from happening soon:

    | include/linux/irq.h:132: error: redefinition of ‘struct irq_data’
    | include/linux/irq.h:286: error: redefinition of ‘struct irq_chip’

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Thomas Gleixner
    Acked-by: Borislav Petkov
    Cc: linux-ide@vger.kernel.org

    Geert Uytterhoeven
     

23 May, 2011

1 commit


31 Mar, 2011

1 commit


23 Nov, 2010

1 commit


08 Aug, 2010

2 commits

  • 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: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
    struct requests. This allows much easier grepping for different request
    types instead of unwinding through macros.

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

    Christoph Hellwig
     

30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

26 Feb, 2010

1 commit

  • The block layer calling convention is blk_queue_.
    blk_queue_max_sectors predates this practice, leading to some confusion.
    Rename the function to appropriately reflect that its intended use is to
    set max_hw_sectors.

    Also introduce a temporary wrapper for backwards compability. This can
    be removed after the merge window is closed.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

26 Jun, 2009

1 commit

  • * Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_kill_rq()
    and ide_floppy_do_request() for failed requests.
    [ bugfix part ]

    * Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_do_devset()
    and ide_complete_drive_reset(). Then remove ide_rq_bytes().
    [ cleanup part ]

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

16 Jun, 2009

1 commit


15 May, 2009

6 commits


11 May, 2009

2 commits

  • With recent unification of fields, it's now guaranteed that
    rq->data_len always equals blk_rq_bytes(). Convert all direct users
    to accessors.

    [ Impact: convert direct rq->data_len usages to blk_rq_bytes() ]

    Signed-off-by: Tejun Heo
    Acked-by: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • ide doesn't manipulate request fields anymore and thus all hard and
    their soft equivalents are always equal. Convert all references to
    accessors.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Signed-off-by: Jens Axboe

    Tejun Heo
     

28 Apr, 2009

5 commits

  • Impact: allow residual count implementation in ->pc_callback()

    rq->data_len has two duties - carrying the number of input bytes on
    issue and carrying residual count back to the issuer on completion.
    ide-atapi completion callback ->pc_callback() is the right place to do
    this but currently ide-atapi depends on rq->data_len carrying the
    original request size after calling ->pc_callback() to complete the pc
    request.

    This patch makes ide_pc_intr(), ide_tape_issue_pc() and
    ide_floppy_issue_pc() cache length to complete before calling
    ->pc_callback() so that it can modify rq->data_len as necessary.

    Note: As using rq->data_len for two purposes can make cases like this
    incorrect in subtle ways, future changes will introduce separate
    field for residual count.

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

    Tejun Heo
     
  • Impact: fix infinite retry loop

    After a command failed, ide-tape and floppy inserts REQUEST_SENSE in
    front of the failed command and according to the result, sets
    pc->retries, flags and errors. After REQUEST_SENSE is complete, the
    failed command is again at the front of the queue and if the verdict
    was to terminate the request, the issue functions tries to complete it
    directly by calling drive->pc_callback() and returning ide_stopped.

    However, drive->pc_callback() doesn't complete a request. It only
    prepares for completion of the request. As a result, this creates an
    infinite loop where the failed request is retried perpetually.

    Fix it by actually ending the request by calling ide_complete_rq().

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • 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
    CC: FUJITA Tomonori
    Signed-off-by: Borislav Petkov
    Signed-off-by: Tejun Heo

    Borislav Petkov
     
  • Impact: rq->buffer usage cleanup

    ide-atapi uses rq->buffer as private opaque value for internal special
    requests. rq->special isn't used for these cases (the only case where
    rq->special is used is for ide-tape rw requests). Use rq->special
    instead.

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

    Tejun Heo
     
  • Impact: remove unnecessary code path

    Block pc requests always use bio and rq->data is always NULL. No need
    to worry about !rq->bio cases in idefloppy_block_pc_cmd(). Note that
    ide-atapi uses ide_pio_bytes() for bio PIO transfer which handle sg
    fine.

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

    Tejun Heo
     

01 Apr, 2009

2 commits

  • * Fix ide_init_sg_cmd() setup for non-fs requests.

    * Convert ide_pc_intr() to use ide_pio_bytes() for floppy media.

    * Remove no longer needed ide_io_buffers() and sg/sg_cnt fields
    from struct ide_atapi_pc.

    * Remove partial completions; kill idefloppy_update_buffers(), as a
    result.

    * Add some more debugging statements.

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • struct ide_atapi_pc is often allocated on the stack and size of ->pc_buf
    size is 256 bytes. However since only ide_floppy_create_read_capacity_cmd()
    and idetape_create_inquiry_cmd() require such size allocate buffers for
    these pc-s explicitely and decrease ->pc_buf size to 64 bytes.

    Cc: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

27 Mar, 2009

4 commits

  • * Pass number of bytes instead of sectors to ide_init_sg_cmd().

    * Pass number of bytes to process to ide_pio_sector() and rename
    it to ide_pio_bytes().

    * Rename ->nsect field to ->nbytes in struct ide_cmd and use
    ->nbytes, ->nleft and ->cursg_ofs to keep track of number of
    bytes instead of sectors.

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Pass command to ide_issue_pc() and update ->do_request methods
    in ide-{cd,floppy,tape}.c accordingly.

    * Convert ide_pktcmd_tf_load() to ide_init_packet_cmd() which
    just initializes command structure and use do_rw_taskfile()
    to load ATA_CMD_PACKET commands.

    While at it:

    * Rename ide{floppy,tape}_issue_pc() to ide_{floppy,tape}_issue_pc().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Set IDE_TFLAG_WRITE flag and ->rq also for ATA_CMD_PACKET
    commands.

    * Pass command to ->dma_setup method and update all its
    implementations accordingly.

    * Pass command instead of request to ide_build_sglist(),
    *_build_dmatable() and ide_map_sg().

    While at it:

    * Fix scc_dma_setup() documentation + use ATA_DMA_WR define.

    * Rename sgiioc4_build_dma_table() to sgiioc4_build_dmatable(),
    change return value type to 'int' and drop unused 'ddir'
    argument.

    * Do some minor cleanups in [tx4939]ide_dma_setup().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ide_rq_bytes() helper.

    * Add blk_noretry_request() quirk to ide_complete_rq() (currently only fs
    requests can be marked as "noretry" so there is no change in behavior).

    * Switch current ide_end_request() users to use ide_complete_rq().

    [ No need to check for rq->nr_sectors == 0 in {ide_dma,task_pio}_intr(),
    nsectors == 0 in cdrom_end_request() and err == 0 in ide_do_devset(). ]

    * Remove no longer needed ide_end_request().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz