summaryrefslogtreecommitdiff
path: root/include/scsi/scsi_tcq.h
blob: 4416b1026189c182bb75fbc5f677f587007522a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _SCSI_SCSI_TCQ_H
#define _SCSI_SCSI_TCQ_H

#include <linux/blkdev.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>

#define SCSI_NO_TAG	(-1)    /* identify no tag in use */


#ifdef CONFIG_BLOCK
/**
 * scsi_host_find_tag - find the tagged command by host
 * @shost:	pointer to scsi_host
 * @tag:	tag
 *
 * Note: for devices using multiple hardware queues tag must have been
 * generated by blk_mq_unique_tag().
 **/
static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost,
		int tag)
{
	struct request *req = NULL;

	if (tag == SCSI_NO_TAG)
		return NULL;

	if (shost_use_blk_mq(shost)) {
		u16 hwq = blk_mq_unique_tag_to_hwq(tag);

		if (hwq < shost->tag_set.nr_hw_queues) {
			req = blk_mq_tag_to_rq(shost->tag_set.tags[hwq],
				blk_mq_unique_tag_to_tag(tag));
		}
	} else {
		req = blk_map_queue_find_tag(shost->bqt, tag);
	}

	if (!req)
		return NULL;
	return req->special;
}

#endif /* CONFIG_BLOCK */
#endif /* _SCSI_SCSI_TCQ_H */
985e80c914621a&id2=586655d278ba08af7b198b93217746f9a506ee8a'>diff)
Merge tag 'rtc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC fix from Alexandre Belloni: "A single fix for this cycle. It is worth taking it for 4.10 so that distributions will not have CONFIG_RTC_DRV_JZ4740 switching from m to y in their config. Summary: - Allow jz4740 to build as a module again by using kernel_halt()" * tag 'rtc-4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: jz4740: make the driver buildable as a module again
Diffstat (limited to 'include/memory')