• Borislav Petkov's avatar
    ide: add helpers for preparing sense requests · a1df5169
    Borislav Petkov authored
    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: default avatarBorislav Petkov <petkovbb@gmail.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    a1df5169
ide-atapi.c 17 KB