03 Aug, 2018

2 commits

  • There is a lot of needless struct request_sense usage in the CDROM
    code. These can all be struct scsi_sense_hdr instead, to avoid any
    confusion over their respective structure sizes. This patch is a lot
    of noise changing "sense" to "sshdr", but the final code is more
    readable to distinguish between "sense" meaning "struct request_sense"
    and "sshdr" meaning "struct scsi_sense_hdr".

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Kees Cook
    Signed-off-by: Jens Axboe

    Kees Cook
     
  • This drops unused sense buffers from:

    cdrom_eject()
    cdrom_read_capacity()
    cdrom_read_tocentry()
    ide_cd_lockdoor()
    ide_cd_read_toc()

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

    Kees Cook
     

18 Mar, 2018

1 commit

  • It happens often while I'm preparing a patch for a block driver that
    I'm wondering: is a definition of SECTOR_SIZE and/or SECTOR_SHIFT
    available for this driver? Do I have to introduce definitions of these
    constants before I can use these constants? To avoid this confusion,
    move the existing definitions of SECTOR_SIZE and SECTOR_SHIFT into the
    header file such that these become available for all
    block drivers. Make the SECTOR_SIZE definition in the uapi msdos_fs.h
    header file conditional to avoid that including that header file after
    causes the compiler to complain about a SECTOR_SIZE
    redefinition.

    Note: the SECTOR_SIZE / SECTOR_SHIFT / SECTOR_BITS definitions have
    not been removed from uapi header files nor from NAND drivers in
    which these constants are used for another purpose than converting
    block layer offsets and sizes into a number of sectors.

    Cc: David S. Miller
    Cc: Mike Snitzer
    Cc: Dan Williams
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Reviewed-by: Sergey Senozhatsky
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Martin K. Petersen
    Signed-off-by: Bart Van Assche
    Signed-off-by: Jens Axboe

    Bart Van Assche
     

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
     

28 Oct, 2016

1 commit

  • A lot of the REQ_* flags are only used on struct requests, and only of
    use to the block layer and a few drivers that dig into struct request
    internals.

    This patch adds a new req_flags_t rq_flags field to struct request for
    them, and thus dramatically shrinks the number of common requests. It
    also removes the unfortunate situation where we have to fit the fields
    from the same enum into 32 bits for struct bio and 64 bits for
    struct request.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Shaun Tancheff
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

10 Mar, 2011

1 commit

  • Convert ->media_changed() to the new ->check_events() method. The
    conversion is mostly mechanical. The only notable change is that
    cdrom now doesn't generate any event if @slot_nr isn't CDSL_CURRENT.
    It used to return -EINVAL which would be treated as media changed. As
    media changer isn't supported anyway, this doesn't make any
    difference.

    This makes ide emit the standard disk events and allows kernel event
    polling. Currently, only MEDIA_CHANGE event is implemented. Adding
    support for EJECT_REQUEST shouldn't be difficult; however, given that
    ide driver is already deprecated, it probably is best to leave it
    alone.

    Signed-off-by: Tejun Heo
    Acked-by: Jens Axboe
    Cc: Kay Sievers
    Cc: "David S. Miller"
    Cc: linux-ide@vger.kernel.org

    Tejun Heo
     

19 Apr, 2009

1 commit

  • Preallocate a sense request in the ->do_request method and reinitialize
    it only on demand, in case it's been consumed in the IRQ handler path.
    The reason for this is that we don't want to be mapping rq to bio in
    the IRQ path and introduce all kinds of unnecessary hacks to the block
    layer.

    tj: * Both user and kernel PC requests expect sense data to be stored
    in separate storage other than drive->sense_data. Copy sense
    data to rq->sense on completion if rq->sense is not NULL. This
    fixes bogus sense data on PC requests.

    As a result, remove cdrom_queue_request_sense.

    CC: Bartlomiej Zolnierkiewicz
    CC: FUJITA Tomonori
    Signed-off-by: Borislav Petkov
    Signed-off-by: Tejun Heo

    Borislav Petkov
     

27 Mar, 2009

2 commits


26 Feb, 2009

1 commit

  • During host driver module removal del_gendisk() results in a final
    put on drive->gendev and freeing the drive by drive_release_dev().

    Convert device drivers from using struct kref to use struct device
    so device driver's object holds reference on ->gendev and prevents
    drive from prematurely going away.

    Also fix ->remove methods to not erroneously drop reference on a
    host driver by using only put_device() instead of ide*_put().

    Reported-by: Stanislaw Gruszka
    Tested-by: Stanislaw Gruszka
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

07 Jan, 2009

2 commits


02 Jan, 2009

2 commits


30 Dec, 2008

1 commit


14 Oct, 2008

1 commit


24 Jul, 2008

1 commit


16 Jul, 2008

2 commits

  • ide_cd_init_rq is not used by ide-cd_ioctl any more. Only
    cdrom_queue_request_sense use it. This converts
    cdrom_queue_request_sense to use blk_rq_init directly and removes
    ide_cd_init_rq.

    Signed-off-by: FUJITA Tomonori
    Cc: Borislav Petkov
    Cc: Jens Axboe
    Signed-off-by: Bartlomiej Zolnierkiewicz

    FUJITA Tomonori
     
  • This converts ide_cd_queue_pc to use blk_execute_rq, necessitating
    changing the ide_cd_queue_pc prototype into a form that doesn't takes
    a pointer to request struct. ide_cd_queue_pc works like scsi_execute.

    Signed-off-by: FUJITA Tomonori
    Cc: Borislav Petkov
    Cc: Jens Axboe
    Signed-off-by: Bartlomiej Zolnierkiewicz

    FUJITA Tomonori
     

26 Apr, 2008

1 commit

  • This removes the internal ide-cd buffer and falls back to read-ahead block layer
    capabilities. Thorough testing (cd burning, dvd read, raw read) gives with the
    bufferless mode marginally better performance in addition to simplified code.

    bufferless:

    dd: reading `/dev/hdc': Input/output error
    6238+0 records in
    6238+0 records out
    204406784 bytes (204 MB) copied, 259.891 s, 787 kB/s

    real 4m21.598s
    user 0m0.014s
    sys 0m0.744s

    with the old buffer (2.6.25-rc1):

    dd: reading `/dev/hdc': Input/output error
    6238+0 records in
    6238+0 records out
    204406784 bytes (204 MB) copied, 262.893 s, 778 kB/s

    real 4m22.938s
    user 0m0.009s
    sys 0m0.771s

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

    Borislav Petkov
     

02 Feb, 2008

18 commits


24 Dec, 2007

1 commit


10 Jul, 2007

1 commit