mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Remove #ifdef code to support FreeBSD versions that haven't been
supported in years. A number of changes have been made to the driver that likely wouldn't work on those older versions that aren't properly ifdef'd and it's project policy to GC such code once it is stale.
This commit is contained in:
parent
709958c070
commit
d706306d49
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344640
@ -349,11 +349,6 @@ struct nvme_controller {
|
||||
(val & 0xFFFFFFFF00000000ULL) >> 32); \
|
||||
} while (0);
|
||||
|
||||
#if __FreeBSD_version < 800054
|
||||
#define wmb() __asm volatile("sfence" ::: "memory")
|
||||
#define mb() __asm volatile("mfence" ::: "memory")
|
||||
#endif
|
||||
|
||||
#define nvme_printf(ctrlr, fmt, args...) \
|
||||
device_printf(ctrlr->dev, fmt, ##args)
|
||||
|
||||
|
@ -823,13 +823,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr)
|
||||
ctrlr = qpair->ctrlr;
|
||||
|
||||
if (req->timeout)
|
||||
#if __FreeBSD_version >= 800030
|
||||
callout_reset_curcpu(&tr->timer, ctrlr->timeout_period * hz,
|
||||
nvme_timeout, tr);
|
||||
#else
|
||||
callout_reset(&tr->timer, ctrlr->timeout_period * hz,
|
||||
nvme_timeout, tr);
|
||||
#endif
|
||||
|
||||
/* Copy the command from the tracker to the submission queue. */
|
||||
memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd));
|
||||
|
@ -94,9 +94,7 @@ nvme_ns_bio_test(void *arg)
|
||||
struct timeval t;
|
||||
uint64_t io_completed = 0, offset;
|
||||
uint32_t idx;
|
||||
#if __FreeBSD_version >= 900017
|
||||
int ref;
|
||||
#endif
|
||||
|
||||
buf = malloc(io_test->size, M_NVME, M_WAITOK);
|
||||
idx = atomic_fetchadd_int(&io_test->td_idx, 1);
|
||||
@ -118,11 +116,7 @@ nvme_ns_bio_test(void *arg)
|
||||
bio->bio_bcount = io_test->size;
|
||||
|
||||
if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
|
||||
#if __FreeBSD_version >= 900017
|
||||
csw = dev_refthread(dev, &ref);
|
||||
#else
|
||||
csw = dev_refthread(dev);
|
||||
#endif
|
||||
} else
|
||||
csw = dev->si_devsw;
|
||||
|
||||
@ -133,11 +127,7 @@ nvme_ns_bio_test(void *arg)
|
||||
mtx_unlock(mtx);
|
||||
|
||||
if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
|
||||
#if __FreeBSD_version >= 900017
|
||||
dev_relthread(dev, ref);
|
||||
#else
|
||||
dev_relthread(dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((bio->bio_flags & BIO_ERROR) || (bio->bio_resid > 0))
|
||||
@ -166,11 +156,7 @@ nvme_ns_bio_test(void *arg)
|
||||
atomic_subtract_int(&io_test->td_active, 1);
|
||||
mb();
|
||||
|
||||
#if __FreeBSD_version >= 800000
|
||||
kthread_exit();
|
||||
#else
|
||||
kthread_exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@ -246,11 +232,7 @@ nvme_ns_io_test(void *arg)
|
||||
atomic_subtract_int(&io_test->td_active, 1);
|
||||
mb();
|
||||
|
||||
#if __FreeBSD_version >= 800004
|
||||
kthread_exit();
|
||||
#else
|
||||
kthread_exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@ -287,13 +269,8 @@ nvme_ns_test(struct nvme_namespace *ns, u_long cmd, caddr_t arg)
|
||||
getmicrouptime(&io_test_internal->start);
|
||||
|
||||
for (i = 0; i < io_test->num_threads; i++)
|
||||
#if __FreeBSD_version >= 800004
|
||||
kthread_add(fn, io_test_internal,
|
||||
NULL, NULL, 0, 0, "nvme_io_test[%d]", i);
|
||||
#else
|
||||
kthread_create(fn, io_test_internal,
|
||||
NULL, 0, 0, "nvme_io_test[%d]", i);
|
||||
#endif
|
||||
|
||||
tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user