tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   98ac9a608dc79ba8a20cee77fe959a6dfccdaa63
commit: aa71987472a974f4f6dc4be377720564079ef42e nvme: fabrics drivers don't 
need the nvme-pci driver
date:   3 weeks ago
config: x86_64-randconfig-b0-09110627 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        git checkout aa71987472a974f4f6dc4be377720564079ef42e
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from drivers/nvme/host/core.c:16:0:
>> include/linux/blk-mq.h:61:18: error: field 'kobj' has incomplete type
     struct kobject  kobj;
                     ^~~~
>> include/linux/blk-mq.h:128:2: error: unknown type name 'softirq_done_fn'
     softirq_done_fn  *complete;
     ^~~~~~~~~~~~~~~
   include/linux/blk-mq.h:181:33: warning: 'struct gendisk' declared inside 
parameter list will not be visible outside of this definition or declaration
    int blk_mq_register_disk(struct gendisk *);
                                    ^~~~~~~
   include/linux/blk-mq.h:182:36: warning: 'struct gendisk' declared inside 
parameter list will not be visible outside of this definition or declaration
    void blk_mq_unregister_disk(struct gendisk *);
                                       ^~~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
>> include/linux/blk-mq.h:260:22: error: invalid application of 'sizeof' to 
>> incomplete type 'struct request'
     return pdu - sizeof(struct request);
                         ^~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
>> include/linux/blk-mq.h:264:2: error: invalid use of undefined type 'struct 
>> request'
     return rq + 1;
     ^~~~~~
   In file included from drivers/nvme/host/core.c:32:0:
   drivers/nvme/host/nvme.h: In function 'nvme_map_len':
>> drivers/nvme/host/nvme.h:217:6: error: implicit declaration of function 
>> 'req_op' [-Werror=implicit-function-declaration]
     if (req_op(rq) == REQ_OP_DISCARD)
         ^~~~~~
>> drivers/nvme/host/nvme.h:220:10: error: implicit declaration of function 
>> 'blk_rq_bytes' [-Werror=implicit-function-declaration]
      return blk_rq_bytes(rq);
             ^~~~~~~~~~~~
   drivers/nvme/host/nvme.h: In function 'nvme_cleanup_cmd':
>> drivers/nvme/host/nvme.h:226:12: error: dereferencing pointer to incomplete 
>> type 'struct request'
      kfree(req->completion_data);
               ^~
   drivers/nvme/host/nvme.h: In function 'nvme_req_needs_retry':
>> drivers/nvme/host/nvme.h:243:35: error: implicit declaration of function 
>> 'blk_noretry_request' [-Werror=implicit-function-declaration]
     return !(status & NVME_SC_DNR || blk_noretry_request(req)) &&
                                      ^~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function 'nvme_cancel_request':
>> drivers/nvme/host/core.c:75:6: error: implicit declaration of function 
>> 'blk_queue_dying' [-Werror=implicit-function-declaration]
     if (blk_queue_dying(req->q))
         ^~~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function 'nvme_free_ns':
>> drivers/nvme/host/core.c:157:42: error: dereferencing pointer to incomplete 
>> type 'struct gendisk'
      nvme_nvm_unregister(ns->queue, ns->disk->disk_name);
                                             ^~
>> drivers/nvme/host/core.c:163:2: error: implicit declaration of function 
>> 'put_disk' [-Werror=implicit-function-declaration]
     put_disk(ns->disk);
     ^~~~~~~~
   drivers/nvme/host/core.c: In function 'nvme_requeue_req':
>> drivers/nvme/host/core.c:203:7: error: implicit declaration of function 
>> 'blk_queue_stopped' [-Werror=implicit-function-declaration]
     if (!blk_queue_stopped(req->q))
          ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function 'nvme_alloc_request':
>> drivers/nvme/host/core.c:223:18: error: 'REQ_TYPE_DRV_PRIV' undeclared 
>> (first use in this function)
     req->cmd_type = REQ_TYPE_DRV_PRIV;
                     ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/core.c:223:18: note: each undeclared identifier is 
reported only once for each function it appears in
   In file included from include/linux/byteorder/little_endian.h:4:0,
                    from arch/x86/include/uapi/asm/byteorder.h:4,
                    from include/asm-generic/bitops/le.h:5,
                    from arch/x86/include/asm/bitops.h:504,
                    from include/linux/bitops.h:36,
                    from include/linux/kernel.h:10,
                    from include/linux/sched.h:17,
                    from include/linux/blkdev.h:4,
                    from drivers/nvme/host/core.c:15:
   drivers/nvme/host/core.c: In function 'nvme_setup_discard':
>> drivers/nvme/host/core.c:254:46: error: implicit declaration of function 
>> 'blk_rq_pos' [-Werror=implicit-function-declaration]
     range->slba = cpu_to_le64(nvme_block_nr(ns, blk_rq_pos(req)));
                                                 ^
   include/uapi/linux/byteorder/little_endian.h:30:51: note: in definition of 
macro '__cpu_to_le64'
    #define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
                                                      ^
   drivers/nvme/host/core.c:254:16: note: in expansion of macro 'cpu_to_le64'
     range->slba = cpu_to_le64(nvme_block_nr(ns, blk_rq_pos(req)));
                   ^~~~~~~~~~~
>> drivers/nvme/host/core.c:265:2: error: implicit declaration of function 
>> 'blk_add_request_payload' [-Werror=implicit-function-declaration]
     blk_add_request_payload(req, page, offset, sizeof(*range));
     ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function 'nvme_setup_rw':
>> drivers/nvme/host/core.c:292:21: error: implicit declaration of function 
>> 'rq_data_dir' [-Werror=implicit-function-declaration]
     cmnd->rw.opcode = (rq_data_dir(req) ? nvme_cmd_write : nvme_cmd_read);
                        ^~~~~~~~~~~
>> drivers/nvme/host/core.c:311:8: error: implicit declaration of function 
>> 'blk_integrity_rq' [-Werror=implicit-function-declaration]
      if (!blk_integrity_rq(req))
           ^~~~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function 'nvme_setup_cmd':
   drivers/nvme/host/core.c:324:23: error: 'REQ_TYPE_DRV_PRIV' undeclared 
(first use in this function)
     if (req->cmd_type == REQ_TYPE_DRV_PRIV)
                          ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function '__nvme_submit_sync_cmd':
>> drivers/nvme/host/core.c:356:9: error: implicit declaration of function 
>> 'blk_rq_map_kern' [-Werror=implicit-function-declaration]
      ret = blk_rq_map_kern(q, req, buffer, bufflen, GFP_KERNEL);
            ^~~~~~~~~~~~~~~
>> drivers/nvme/host/core.c:361:2: error: implicit declaration of function 
>> 'blk_execute_rq' [-Werror=implicit-function-declaration]
     blk_execute_rq(req->q, NULL, req, at_head);
     ^~~~~~~~~~~~~~
   drivers/nvme/host/core.c: In function '__nvme_submit_user_cmd':
>> drivers/nvme/host/core.c:384:24: error: dereferencing pointer to incomplete 
>> type 'struct request_queue'
     struct nvme_ns *ns = q->queuedata;
                           ^~
--
   In file included from drivers/nvme/host/nvme.h:20:0,
                    from drivers/nvme/host/scsi.c:47:
>> include/linux/blk-mq.h:128:2: error: unknown type name 'softirq_done_fn'
     softirq_done_fn  *complete;
     ^~~~~~~~~~~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
>> include/linux/blk-mq.h:260:22: error: invalid application of 'sizeof' to 
>> incomplete type 'struct request'
     return pdu - sizeof(struct request);
                         ^~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
>> include/linux/blk-mq.h:264:2: error: invalid use of undefined type 'struct 
>> request'
     return rq + 1;
     ^~~~~~
   In file included from drivers/nvme/host/scsi.c:47:0:
   drivers/nvme/host/nvme.h: In function 'nvme_map_len':
>> drivers/nvme/host/nvme.h:217:6: error: implicit declaration of function 
>> 'req_op' [-Werror=implicit-function-declaration]
     if (req_op(rq) == REQ_OP_DISCARD)
         ^~~~~~
>> drivers/nvme/host/nvme.h:220:10: error: implicit declaration of function 
>> 'blk_rq_bytes' [-Werror=implicit-function-declaration]
      return blk_rq_bytes(rq);
             ^~~~~~~~~~~~
   drivers/nvme/host/nvme.h: In function 'nvme_cleanup_cmd':
>> drivers/nvme/host/nvme.h:226:12: error: dereferencing pointer to incomplete 
>> type 'struct request'
      kfree(req->completion_data);
               ^~
   drivers/nvme/host/nvme.h: In function 'nvme_req_needs_retry':
>> drivers/nvme/host/nvme.h:243:35: error: implicit declaration of function 
>> 'blk_noretry_request' [-Werror=implicit-function-declaration]
     return !(status & NVME_SC_DNR || blk_noretry_request(req)) &&
                                      ^~~~~~~~~~~~~~~~~~~
   In file included from include/linux/swab.h:4:0,
                    from include/uapi/linux/byteorder/little_endian.h:12,
                    from include/linux/byteorder/little_endian.h:4,
                    from arch/x86/include/uapi/asm/byteorder.h:4,
                    from include/asm-generic/bitops/le.h:5,
                    from arch/x86/include/asm/bitops.h:504,
                    from include/linux/bitops.h:36,
                    from include/linux/kernel.h:10,
                    from include/linux/list.h:8,
                    from include/linux/wait.h:6,
                    from include/linux/fs.h:5,
                    from include/linux/highmem.h:4,
                    from include/linux/bio.h:23,
                    from drivers/nvme/host/scsi.c:20:
   drivers/nvme/host/scsi.c: In function 'nvme_trans_bdev_limits_page':
>> drivers/nvme/host/scsi.c:769:21: error: implicit declaration of function 
>> 'queue_max_hw_sectors' [-Werror=implicit-function-declaration]
      nvme_block_nr(ns, queue_max_hw_sectors(ns->queue)));
                        ^
   include/uapi/linux/swab.h:113:54: note: in definition of macro '__swab32'
    #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                         ^
   include/linux/byteorder/generic.h:93:21: note: in expansion of macro 
'__cpu_to_be32'
    #define cpu_to_be32 __cpu_to_be32
                        ^~~~~~~~~~~~~
   drivers/nvme/host/scsi.c:768:23: note: in expansion of macro 'cpu_to_be32'
     __be32 max_sectors = cpu_to_be32(
                          ^~~~~~~~~~~
>> drivers/nvme/host/scsi.c:770:44: error: dereferencing pointer to incomplete 
>> type 'struct request_queue'
     __be32 max_discard = cpu_to_be32(ns->queue->limits.max_discard_sectors);
                                               ^
   include/uapi/linux/swab.h:113:54: note: in definition of macro '__swab32'
    #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                         ^
   include/linux/byteorder/generic.h:93:21: note: in expansion of macro 
'__cpu_to_be32'
    #define cpu_to_be32 __cpu_to_be32
                        ^~~~~~~~~~~~~
   drivers/nvme/host/scsi.c:770:23: note: in expansion of macro 'cpu_to_be32'
     __be32 max_discard = cpu_to_be32(ns->queue->limits.max_discard_sectors);
                          ^~~~~~~~~~~
   drivers/nvme/host/scsi.c: In function 'nvme_trans_do_nvme_io':
>> drivers/nvme/host/scsi.c:1724:7: error: implicit declaration of function 
>> 'get_capacity' [-Werror=implicit-function-declaration]
      if (get_capacity(ns->disk) - unit_num_blocks <
          ^~~~~~~~~~~~
   drivers/nvme/host/scsi.c: In function 'nvme_scsi_translate':
>> drivers/nvme/host/scsi.c:2449:9: error: 'BLK_MAX_CDB' undeclared (first use 
>> in this function)
     u8 cmd[BLK_MAX_CDB];
            ^~~~~~~~~~~
   drivers/nvme/host/scsi.c:2449:9: note: each undeclared identifier is 
reported only once for each function it appears in
   drivers/nvme/host/scsi.c:2449:5: warning: unused variable 'cmd' 
[-Wunused-variable]
     u8 cmd[BLK_MAX_CDB];
        ^~~
   drivers/nvme/host/scsi.c: In function 'nvme_sg_io':
   drivers/nvme/host/scsi.c:2556:20: error: 'BLK_MAX_CDB' undeclared (first use 
in this function)
     if (hdr.cmd_len > BLK_MAX_CDB)
                       ^~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from drivers/nvme/host/nvme.h:20:0,
                    from drivers/nvme/host/fabrics.c:21:
>> include/linux/blk-mq.h:128:2: error: unknown type name 'softirq_done_fn'
     softirq_done_fn  *complete;
     ^~~~~~~~~~~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
>> include/linux/blk-mq.h:260:22: error: invalid application of 'sizeof' to 
>> incomplete type 'struct request'
     return pdu - sizeof(struct request);
                         ^~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
>> include/linux/blk-mq.h:264:2: error: invalid use of undefined type 'struct 
>> request'
     return rq + 1;
     ^~~~~~
   In file included from drivers/nvme/host/fabrics.c:21:0:
   drivers/nvme/host/nvme.h: In function 'nvme_map_len':
>> drivers/nvme/host/nvme.h:217:6: error: implicit declaration of function 
>> 'req_op' [-Werror=implicit-function-declaration]
     if (req_op(rq) == REQ_OP_DISCARD)
         ^~~~~~
>> drivers/nvme/host/nvme.h:220:10: error: implicit declaration of function 
>> 'blk_rq_bytes' [-Werror=implicit-function-declaration]
      return blk_rq_bytes(rq);
             ^~~~~~~~~~~~
   drivers/nvme/host/nvme.h: In function 'nvme_cleanup_cmd':
>> drivers/nvme/host/nvme.h:226:12: error: dereferencing pointer to incomplete 
>> type 'struct request'
      kfree(req->completion_data);
               ^~
   drivers/nvme/host/nvme.h: In function 'nvme_req_needs_retry':
>> drivers/nvme/host/nvme.h:243:35: error: implicit declaration of function 
>> 'blk_noretry_request' [-Werror=implicit-function-declaration]
     return !(status & NVME_SC_DNR || blk_noretry_request(req)) &&
                                      ^~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from drivers/nvme/host/rdma.c:21:0:
>> include/linux/blk-mq.h:128:2: error: unknown type name 'softirq_done_fn'
     softirq_done_fn  *complete;
     ^~~~~~~~~~~~~~~
   include/linux/blk-mq.h:181:33: warning: 'struct gendisk' declared inside 
parameter list will not be visible outside of this definition or declaration
    int blk_mq_register_disk(struct gendisk *);
                                    ^~~~~~~
   include/linux/blk-mq.h:182:36: warning: 'struct gendisk' declared inside 
parameter list will not be visible outside of this definition or declaration
    void blk_mq_unregister_disk(struct gendisk *);
                                       ^~~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
>> include/linux/blk-mq.h:260:22: error: invalid application of 'sizeof' to 
>> incomplete type 'struct request'
     return pdu - sizeof(struct request);
                         ^~~~~~
   include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
>> include/linux/blk-mq.h:264:2: error: invalid use of undefined type 'struct 
>> request'
     return rq + 1;
     ^~~~~~
   In file included from drivers/nvme/host/rdma.c:34:0:
   drivers/nvme/host/nvme.h: In function 'nvme_map_len':
>> drivers/nvme/host/nvme.h:217:6: error: implicit declaration of function 
>> 'req_op' [-Werror=implicit-function-declaration]
     if (req_op(rq) == REQ_OP_DISCARD)
         ^~~~~~
>> drivers/nvme/host/nvme.h:220:10: error: implicit declaration of function 
>> 'blk_rq_bytes' [-Werror=implicit-function-declaration]
      return blk_rq_bytes(rq);
             ^~~~~~~~~~~~
   drivers/nvme/host/nvme.h: In function 'nvme_cleanup_cmd':
>> drivers/nvme/host/nvme.h:226:12: error: dereferencing pointer to incomplete 
>> type 'struct request'
      kfree(req->completion_data);
               ^~
   drivers/nvme/host/nvme.h: In function 'nvme_req_needs_retry':
>> drivers/nvme/host/nvme.h:243:35: error: implicit declaration of function 
>> 'blk_noretry_request' [-Werror=implicit-function-declaration]
     return !(status & NVME_SC_DNR || blk_noretry_request(req)) &&
                                      ^~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_destroy_admin_queue':
>> drivers/nvme/host/rdma.c:671:2: error: implicit declaration of function 
>> 'blk_cleanup_queue' [-Werror=implicit-function-declaration]
     blk_cleanup_queue(ctrl->ctrl.admin_q);
     ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_unmap_data':
>> drivers/nvme/host/rdma.c:864:16: error: implicit declaration of function 
>> 'rq_data_dir' [-Werror=implicit-function-declaration]
       req->nents, rq_data_dir(rq) ==
                   ^~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_map_data':
>> drivers/nvme/host/rdma.c:975:10: error: implicit declaration of function 
>> 'blk_rq_map_sg' [-Werror=implicit-function-declaration]
     nents = blk_rq_map_sg(rq->q, rq, req->sg_table.sgl);
             ^~~~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_process_nvme_rsp':
>> drivers/nvme/host/rdma.c:1141:22: error: 'REQ_TYPE_DRV_PRIV' undeclared 
>> (first use in this function)
     if (rq->cmd_type == REQ_TYPE_DRV_PRIV && rq->special)
                         ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c:1141:22: note: each undeclared identifier is 
reported only once for each function it appears in
   drivers/nvme/host/rdma.c: At top level:
>> drivers/nvme/host/rdma.c:1424:1: error: return type is an incomplete type
    nvme_rdma_timeout(struct request *rq, bool reserved)
    ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_timeout':
>> drivers/nvme/host/rdma.c:1434:9: error: 'BLK_EH_HANDLED' undeclared (first 
>> use in this function)
     return BLK_EH_HANDLED;
            ^~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c:1434:9: warning: 'return' with a value, in function 
returning void
   drivers/nvme/host/rdma.c:1424:1: note: declared here
    nvme_rdma_timeout(struct request *rq, bool reserved)
    ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_queue_rq':
>> drivers/nvme/host/rdma.c:1440:34: error: dereferencing pointer to incomplete 
>> type 'struct request_queue'
     struct nvme_ns *ns = hctx->queue->queuedata;
                                     ^~
>> drivers/nvme/host/rdma.c:1476:22: error: 'REQ_TYPE_FS' undeclared (first use 
>> in this function)
     if (rq->cmd_type == REQ_TYPE_FS && req_op(rq) == REQ_OP_FLUSH)
                         ^~~~~~~~~~~
   drivers/nvme/host/rdma.c: In function 'nvme_rdma_complete_rq':
   drivers/nvme/host/rdma.c:1527:23: error: 'REQ_TYPE_DRV_PRIV' undeclared 
(first use in this function)
      if (rq->cmd_type == REQ_TYPE_DRV_PRIV)
                          ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c: At top level:
>> drivers/nvme/host/rdma.c:1538:14: error: initialization from incompatible 
>> pointer type [-Werror=incompatible-pointer-types]
     .complete = nvme_rdma_complete_rq,
                 ^~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c:1538:14: note: (near initialization for 
'nvme_rdma_mq_ops.complete')
   drivers/nvme/host/rdma.c:1545:13: error: initialization from incompatible 
pointer type [-Werror=incompatible-pointer-types]
     .timeout = nvme_rdma_timeout,
                ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c:1545:13: note: (near initialization for 
'nvme_rdma_mq_ops.timeout')
   drivers/nvme/host/rdma.c:1550:14: error: initialization from incompatible 
pointer type [-Werror=incompatible-pointer-types]
     .complete = nvme_rdma_complete_rq,
                 ^~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c:1550:14: note: (near initialization for 
'nvme_rdma_admin_mq_ops.complete')
   drivers/nvme/host/rdma.c:1556:13: error: initialization from incompatible 
pointer type [-Werror=incompatible-pointer-types]
     .timeout = nvme_rdma_timeout,
                ^~~~~~~~~~~~~~~~~
   drivers/nvme/host/rdma.c:1556:13: note: (near initialization for 
'nvme_rdma_admin_mq_ops.timeout')
   cc1: some warnings being treated as errors

vim +/kobj +61 include/linux/blk-mq.h

320ae51f Jens Axboe        2013-10-24   55      unsigned int            
numa_node;
17ded320 Jens Axboe        2015-01-07   56      unsigned int            
queue_num;
320ae51f Jens Axboe        2013-10-24   57  
0d2602ca Jens Axboe        2014-05-13   58      atomic_t                
nr_active;
0d2602ca Jens Axboe        2014-05-13   59  
320ae51f Jens Axboe        2013-10-24   60      struct blk_mq_cpu_notifier      
cpu_notifier;
320ae51f Jens Axboe        2013-10-24  @61      struct kobject          kobj;
05229bee Jens Axboe        2015-11-05   62  
05229bee Jens Axboe        2015-11-05   63      unsigned long           
poll_invoked;
05229bee Jens Axboe        2015-11-05   64      unsigned long           
poll_success;
320ae51f Jens Axboe        2013-10-24   65  };
320ae51f Jens Axboe        2013-10-24   66  
24d2f903 Christoph Hellwig 2014-04-15   67  struct blk_mq_tag_set {
320ae51f Jens Axboe        2013-10-24   68      struct blk_mq_ops       *ops;
320ae51f Jens Axboe        2013-10-24   69      unsigned int            
nr_hw_queues;
e3a2b3f9 Jens Axboe        2014-05-20   70      unsigned int            
queue_depth;    /* max hw supported */
320ae51f Jens Axboe        2013-10-24   71      unsigned int            
reserved_tags;
320ae51f Jens Axboe        2013-10-24   72      unsigned int            
cmd_size;       /* per-request extra data */
320ae51f Jens Axboe        2013-10-24   73      int                     
numa_node;
320ae51f Jens Axboe        2013-10-24   74      unsigned int            timeout;
320ae51f Jens Axboe        2013-10-24   75      unsigned int            flags;  
        /* BLK_MQ_F_* */
24d2f903 Christoph Hellwig 2014-04-15   76      void                    
*driver_data;
24d2f903 Christoph Hellwig 2014-04-15   77  
24d2f903 Christoph Hellwig 2014-04-15   78      struct blk_mq_tags      **tags;
0d2602ca Jens Axboe        2014-05-13   79  
0d2602ca Jens Axboe        2014-05-13   80      struct mutex            
tag_list_lock;
0d2602ca Jens Axboe        2014-05-13   81      struct list_head        
tag_list;
320ae51f Jens Axboe        2013-10-24   82  };
320ae51f Jens Axboe        2013-10-24   83  
74c45052 Jens Axboe        2014-10-29   84  struct blk_mq_queue_data {
74c45052 Jens Axboe        2014-10-29   85      struct request *rq;
74c45052 Jens Axboe        2014-10-29   86      struct list_head *list;
74c45052 Jens Axboe        2014-10-29   87      bool last;
74c45052 Jens Axboe        2014-10-29   88  };
74c45052 Jens Axboe        2014-10-29   89  
74c45052 Jens Axboe        2014-10-29   90  typedef int (queue_rq_fn)(struct 
blk_mq_hw_ctx *, const struct blk_mq_queue_data *);
320ae51f Jens Axboe        2013-10-24   91  typedef struct blk_mq_hw_ctx 
*(map_queue_fn)(struct request_queue *, const int);
0152fb6b Christoph Hellwig 2014-09-13   92  typedef enum blk_eh_timer_return 
(timeout_fn)(struct request *, bool);
320ae51f Jens Axboe        2013-10-24   93  typedef int (init_hctx_fn)(struct 
blk_mq_hw_ctx *, void *, unsigned int);
320ae51f Jens Axboe        2013-10-24   94  typedef void (exit_hctx_fn)(struct 
blk_mq_hw_ctx *, unsigned int);
24d2f903 Christoph Hellwig 2014-04-15   95  typedef int (init_request_fn)(void 
*, struct request *, unsigned int,
24d2f903 Christoph Hellwig 2014-04-15   96              unsigned int, unsigned 
int);
24d2f903 Christoph Hellwig 2014-04-15   97  typedef void (exit_request_fn)(void 
*, struct request *, unsigned int,
24d2f903 Christoph Hellwig 2014-04-15   98              unsigned int);
486cf989 Sagi Grimberg     2016-07-06   99  typedef int 
(reinit_request_fn)(void *, struct request *);
320ae51f Jens Axboe        2013-10-24  100  
81481eb4 Christoph Hellwig 2014-09-13  101  typedef void (busy_iter_fn)(struct 
blk_mq_hw_ctx *, struct request *, void *,
81481eb4 Christoph Hellwig 2014-09-13  102              bool);
f26cdc85 Keith Busch       2015-06-01  103  typedef void 
(busy_tag_iter_fn)(struct request *, void *, bool);
05229bee Jens Axboe        2015-11-05  104  typedef int (poll_fn)(struct 
blk_mq_hw_ctx *, unsigned int);
05229bee Jens Axboe        2015-11-05  105  
81481eb4 Christoph Hellwig 2014-09-13  106  
320ae51f Jens Axboe        2013-10-24  107  struct blk_mq_ops {
320ae51f Jens Axboe        2013-10-24  108      /*
320ae51f Jens Axboe        2013-10-24  109       * Queue request
320ae51f Jens Axboe        2013-10-24  110       */
320ae51f Jens Axboe        2013-10-24  111      queue_rq_fn             
*queue_rq;
320ae51f Jens Axboe        2013-10-24  112  
320ae51f Jens Axboe        2013-10-24  113      /*
320ae51f Jens Axboe        2013-10-24  114       * Map to specific hardware 
queue
320ae51f Jens Axboe        2013-10-24  115       */
320ae51f Jens Axboe        2013-10-24  116      map_queue_fn            
*map_queue;
320ae51f Jens Axboe        2013-10-24  117  
320ae51f Jens Axboe        2013-10-24  118      /*
320ae51f Jens Axboe        2013-10-24  119       * Called on request timeout
320ae51f Jens Axboe        2013-10-24  120       */
0152fb6b Christoph Hellwig 2014-09-13  121      timeout_fn              
*timeout;
320ae51f Jens Axboe        2013-10-24  122  
05229bee Jens Axboe        2015-11-05  123      /*
05229bee Jens Axboe        2015-11-05  124       * Called to poll for 
completion of a specific tag.
05229bee Jens Axboe        2015-11-05  125       */
05229bee Jens Axboe        2015-11-05  126      poll_fn                 *poll;
05229bee Jens Axboe        2015-11-05  127  
30a91cb4 Christoph Hellwig 2014-02-10 @128      softirq_done_fn         
*complete;
30a91cb4 Christoph Hellwig 2014-02-10  129  
320ae51f Jens Axboe        2013-10-24  130      /*
320ae51f Jens Axboe        2013-10-24  131       * Called when the block layer 
side of a hardware queue has been
320ae51f Jens Axboe        2013-10-24  132       * set up, allowing the driver 
to allocate/init matching structures.
320ae51f Jens Axboe        2013-10-24  133       * Ditto for exit/teardown.
320ae51f Jens Axboe        2013-10-24  134       */
320ae51f Jens Axboe        2013-10-24  135      init_hctx_fn            
*init_hctx;
320ae51f Jens Axboe        2013-10-24  136      exit_hctx_fn            
*exit_hctx;
e9b267d9 Christoph Hellwig 2014-04-15  137  
e9b267d9 Christoph Hellwig 2014-04-15  138      /*
e9b267d9 Christoph Hellwig 2014-04-15  139       * Called for every command 
allocated by the block layer to allow
e9b267d9 Christoph Hellwig 2014-04-15  140       * the driver to set up driver 
specific data.
f70ced09 Ming Lei          2014-09-25  141       *
f70ced09 Ming Lei          2014-09-25  142       * Tag greater than or equal to 
queue_depth is for setting up
f70ced09 Ming Lei          2014-09-25  143       * flush request.
f70ced09 Ming Lei          2014-09-25  144       *
e9b267d9 Christoph Hellwig 2014-04-15  145       * Ditto for exit/teardown.
e9b267d9 Christoph Hellwig 2014-04-15  146       */
e9b267d9 Christoph Hellwig 2014-04-15  147      init_request_fn         
*init_request;
e9b267d9 Christoph Hellwig 2014-04-15  148      exit_request_fn         
*exit_request;
486cf989 Sagi Grimberg     2016-07-06  149      reinit_request_fn       
*reinit_request;
320ae51f Jens Axboe        2013-10-24  150  };
320ae51f Jens Axboe        2013-10-24  151  
320ae51f Jens Axboe        2013-10-24  152  enum {
320ae51f Jens Axboe        2013-10-24  153      BLK_MQ_RQ_QUEUE_OK      = 0,    
/* queued fine */
320ae51f Jens Axboe        2013-10-24  154      BLK_MQ_RQ_QUEUE_BUSY    = 1,    
/* requeue IO for later */
320ae51f Jens Axboe        2013-10-24  155      BLK_MQ_RQ_QUEUE_ERROR   = 2,    
/* end IO with error */
320ae51f Jens Axboe        2013-10-24  156  
320ae51f Jens Axboe        2013-10-24  157      BLK_MQ_F_SHOULD_MERGE   = 1 << 
0,
8a58d1f1 Jens Axboe        2014-08-15  158      BLK_MQ_F_TAG_SHARED     = 1 << 
1,
8a58d1f1 Jens Axboe        2014-08-15  159      BLK_MQ_F_SG_MERGE       = 1 << 
2,
e167dfb5 Jens Axboe        2014-10-29  160      BLK_MQ_F_DEFER_ISSUE    = 1 << 
4,
24391c0d Shaohua Li        2015-01-23  161      BLK_MQ_F_ALLOC_POLICY_START_BIT 
= 8,
24391c0d Shaohua Li        2015-01-23  162      BLK_MQ_F_ALLOC_POLICY_BITS = 1,
320ae51f Jens Axboe        2013-10-24  163  
5d12f905 Jens Axboe        2014-03-19  164      BLK_MQ_S_STOPPED        = 0,
0d2602ca Jens Axboe        2014-05-13  165      BLK_MQ_S_TAG_ACTIVE     = 1,
320ae51f Jens Axboe        2013-10-24  166  
a4391c64 Jens Axboe        2014-06-05  167      BLK_MQ_MAX_DEPTH        = 10240,
506e931f Jens Axboe        2014-05-07  168  
506e931f Jens Axboe        2014-05-07  169      BLK_MQ_CPU_WORK_BATCH   = 8,
320ae51f Jens Axboe        2013-10-24  170  };
24391c0d Shaohua Li        2015-01-23  171  #define 
BLK_MQ_FLAG_TO_ALLOC_POLICY(flags) \
24391c0d Shaohua Li        2015-01-23  172      ((flags >> 
BLK_MQ_F_ALLOC_POLICY_START_BIT) & \
24391c0d Shaohua Li        2015-01-23  173              ((1 << 
BLK_MQ_F_ALLOC_POLICY_BITS) - 1))
24391c0d Shaohua Li        2015-01-23  174  #define 
BLK_ALLOC_POLICY_TO_MQ_FLAG(policy) \
24391c0d Shaohua Li        2015-01-23  175      ((policy & ((1 << 
BLK_MQ_F_ALLOC_POLICY_BITS) - 1)) \
24391c0d Shaohua Li        2015-01-23  176              << 
BLK_MQ_F_ALLOC_POLICY_START_BIT)
320ae51f Jens Axboe        2013-10-24  177  
24d2f903 Christoph Hellwig 2014-04-15  178  struct request_queue 
*blk_mq_init_queue(struct blk_mq_tag_set *);
b62c21b7 Mike Snitzer      2015-03-12  179  struct request_queue 
*blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
b62c21b7 Mike Snitzer      2015-03-12  180                                      
          struct request_queue *q);
320ae51f Jens Axboe        2013-10-24 @181  int blk_mq_register_disk(struct 
gendisk *);
320ae51f Jens Axboe        2013-10-24 @182  void blk_mq_unregister_disk(struct 
gendisk *);
320ae51f Jens Axboe        2013-10-24  183  
24d2f903 Christoph Hellwig 2014-04-15  184  int blk_mq_alloc_tag_set(struct 
blk_mq_tag_set *set);
24d2f903 Christoph Hellwig 2014-04-15  185  void blk_mq_free_tag_set(struct 
blk_mq_tag_set *set);
24d2f903 Christoph Hellwig 2014-04-15  186  
320ae51f Jens Axboe        2013-10-24  187  void blk_mq_flush_plug_list(struct 
blk_plug *plug, bool from_schedule);
320ae51f Jens Axboe        2013-10-24  188  
feb71dae Christoph Hellwig 2014-02-20  189  void blk_mq_insert_request(struct 
request *, bool, bool, bool);
320ae51f Jens Axboe        2013-10-24  190  void blk_mq_free_request(struct 
request *rq);
7c7f2f2b Jens Axboe        2014-11-17  191  void 
blk_mq_free_hctx_request(struct blk_mq_hw_ctx *, struct request *rq);
320ae51f Jens Axboe        2013-10-24  192  bool blk_mq_can_queue(struct 
blk_mq_hw_ctx *);
6f3b0e8b Christoph Hellwig 2015-11-26  193  
6f3b0e8b Christoph Hellwig 2015-11-26  194  enum {
6f3b0e8b Christoph Hellwig 2015-11-26  195      BLK_MQ_REQ_NOWAIT       = (1 << 
0), /* return when out of requests */
6f3b0e8b Christoph Hellwig 2015-11-26  196      BLK_MQ_REQ_RESERVED     = (1 << 
1), /* allocate from reserved pool */
6f3b0e8b Christoph Hellwig 2015-11-26  197  };
6f3b0e8b Christoph Hellwig 2015-11-26  198  
4ce01dd1 Christoph Hellwig 2014-05-27  199  struct request 
*blk_mq_alloc_request(struct request_queue *q, int rw,
6f3b0e8b Christoph Hellwig 2015-11-26  200              unsigned int flags);
1f5bd336 Ming Lin          2016-06-13  201  struct request 
*blk_mq_alloc_request_hctx(struct request_queue *q, int op,
1f5bd336 Ming Lin          2016-06-13  202              unsigned int flags, 
unsigned int hctx_idx);
0e62f51f Jens Axboe        2014-06-04  203  struct request 
*blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag);
f26cdc85 Keith Busch       2015-06-01  204  struct cpumask 
*blk_mq_tags_cpumask(struct blk_mq_tags *tags);
320ae51f Jens Axboe        2013-10-24  205  
205fb5f5 Bart Van Assche   2014-10-30  206  enum {
205fb5f5 Bart Van Assche   2014-10-30  207      BLK_MQ_UNIQUE_TAG_BITS = 16,
205fb5f5 Bart Van Assche   2014-10-30  208      BLK_MQ_UNIQUE_TAG_MASK = (1 << 
BLK_MQ_UNIQUE_TAG_BITS) - 1,
205fb5f5 Bart Van Assche   2014-10-30  209  };
205fb5f5 Bart Van Assche   2014-10-30  210  
205fb5f5 Bart Van Assche   2014-10-30  211  u32 blk_mq_unique_tag(struct 
request *rq);
205fb5f5 Bart Van Assche   2014-10-30  212  
205fb5f5 Bart Van Assche   2014-10-30  213  static inline u16 
blk_mq_unique_tag_to_hwq(u32 unique_tag)
205fb5f5 Bart Van Assche   2014-10-30  214  {
205fb5f5 Bart Van Assche   2014-10-30  215      return unique_tag >> 
BLK_MQ_UNIQUE_TAG_BITS;
205fb5f5 Bart Van Assche   2014-10-30  216  }
205fb5f5 Bart Van Assche   2014-10-30  217  
205fb5f5 Bart Van Assche   2014-10-30  218  static inline u16 
blk_mq_unique_tag_to_tag(u32 unique_tag)
205fb5f5 Bart Van Assche   2014-10-30  219  {
205fb5f5 Bart Van Assche   2014-10-30  220      return unique_tag & 
BLK_MQ_UNIQUE_TAG_MASK;
205fb5f5 Bart Van Assche   2014-10-30  221  }
205fb5f5 Bart Van Assche   2014-10-30  222  
320ae51f Jens Axboe        2013-10-24  223  struct blk_mq_hw_ctx 
*blk_mq_map_queue(struct request_queue *, const int ctx_index);
f14bbe77 Jens Axboe        2014-05-27  224  struct blk_mq_hw_ctx 
*blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int);
320ae51f Jens Axboe        2013-10-24  225  
973c0191 Keith Busch       2015-01-07  226  int blk_mq_request_started(struct 
request *rq);
e2490073 Christoph Hellwig 2014-09-13  227  void blk_mq_start_request(struct 
request *rq);
c8a446ad Christoph Hellwig 2014-09-13  228  void blk_mq_end_request(struct 
request *rq, int error);
c8a446ad Christoph Hellwig 2014-09-13  229  void __blk_mq_end_request(struct 
request *rq, int error);
320ae51f Jens Axboe        2013-10-24  230  
ed0791b2 Christoph Hellwig 2014-04-16  231  void blk_mq_requeue_request(struct 
request *rq);
6fca6a61 Christoph Hellwig 2014-05-28  232  void 
blk_mq_add_to_requeue_list(struct request *rq, bool at_head);
c68ed59f Keith Busch       2015-01-07  233  void 
blk_mq_cancel_requeue_work(struct request_queue *q);
6fca6a61 Christoph Hellwig 2014-05-28  234  void 
blk_mq_kick_requeue_list(struct request_queue *q);
1885b24d Jens Axboe        2015-01-07  235  void 
blk_mq_abort_requeue_list(struct request_queue *q);
f4829a9b Christoph Hellwig 2015-09-27  236  void blk_mq_complete_request(struct 
request *rq, int error);
30a91cb4 Christoph Hellwig 2014-02-10  237  
320ae51f Jens Axboe        2013-10-24  238  void blk_mq_stop_hw_queue(struct 
blk_mq_hw_ctx *hctx);
320ae51f Jens Axboe        2013-10-24  239  void blk_mq_start_hw_queue(struct 
blk_mq_hw_ctx *hctx);
280d45f6 Christoph Hellwig 2013-10-25  240  void blk_mq_stop_hw_queues(struct 
request_queue *q);
2f268556 Christoph Hellwig 2014-04-16  241  void blk_mq_start_hw_queues(struct 
request_queue *q);
1b4a3258 Christoph Hellwig 2014-04-16  242  void 
blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
b94ec296 Mike Snitzer      2015-03-11  243  void blk_mq_run_hw_queues(struct 
request_queue *q, bool async);
70f4db63 Christoph Hellwig 2014-04-16  244  void blk_mq_delay_queue(struct 
blk_mq_hw_ctx *hctx, unsigned long msecs);
e0489487 Sagi Grimberg     2016-03-10  245  void blk_mq_tagset_busy_iter(struct 
blk_mq_tag_set *tagset,
e0489487 Sagi Grimberg     2016-03-10  246              busy_tag_iter_fn *fn, 
void *priv);
c761d96b Jens Axboe        2015-01-02  247  void blk_mq_freeze_queue(struct 
request_queue *q);
b4c6a028 Keith Busch       2014-12-19  248  void blk_mq_unfreeze_queue(struct 
request_queue *q);
b4c6a028 Keith Busch       2014-12-19  249  void 
blk_mq_freeze_queue_start(struct request_queue *q);
486cf989 Sagi Grimberg     2016-07-06  250  int blk_mq_reinit_tagset(struct 
blk_mq_tag_set *set);
320ae51f Jens Axboe        2013-10-24  251  
868f2f0b Keith Busch       2015-12-17  252  void 
blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues);
868f2f0b Keith Busch       2015-12-17  253  
320ae51f Jens Axboe        2013-10-24  254  /*
320ae51f Jens Axboe        2013-10-24  255   * Driver command data is 
immediately after the request. So subtract request
2963e3f7 Jens Axboe        2015-04-09  256   * size to get back to the original 
request, add request size to get the PDU.
320ae51f Jens Axboe        2013-10-24  257   */
320ae51f Jens Axboe        2013-10-24  258  static inline struct request 
*blk_mq_rq_from_pdu(void *pdu)
320ae51f Jens Axboe        2013-10-24  259  {
320ae51f Jens Axboe        2013-10-24 @260      return pdu - sizeof(struct 
request);
320ae51f Jens Axboe        2013-10-24  261  }
320ae51f Jens Axboe        2013-10-24  262  static inline void 
*blk_mq_rq_to_pdu(struct request *rq)
320ae51f Jens Axboe        2013-10-24  263  {

:::::: The code at line 61 was first introduced by commit
:::::: 320ae51feed5c2f13664aa05a76bec198967e04d blk-mq: new multi-queue block 
IO queueing mechanism

:::::: TO: Jens Axboe <ax...@kernel.dk>
:::::: CC: Jens Axboe <ax...@kernel.dk>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data

Reply via email to