svn commit: r344640 - head/sys/dev/nvme

Warner Losh imp at FreeBSD.org
Wed Feb 27 22:05:03 UTC 2019


Author: imp
Date: Wed Feb 27 22:05:01 2019
New Revision: 344640
URL: https://svnweb.freebsd.org/changeset/base/344640

Log:
  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.

Modified:
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c
  head/sys/dev/nvme/nvme_test.c

Modified: head/sys/dev/nvme/nvme_private.h
==============================================================================
--- head/sys/dev/nvme/nvme_private.h	Wed Feb 27 22:02:46 2019	(r344639)
+++ head/sys/dev/nvme/nvme_private.h	Wed Feb 27 22:05:01 2019	(r344640)
@@ -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)
 

Modified: head/sys/dev/nvme/nvme_qpair.c
==============================================================================
--- head/sys/dev/nvme/nvme_qpair.c	Wed Feb 27 22:02:46 2019	(r344639)
+++ head/sys/dev/nvme/nvme_qpair.c	Wed Feb 27 22:05:01 2019	(r344640)
@@ -823,13 +823,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st
 	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));

Modified: head/sys/dev/nvme/nvme_test.c
==============================================================================
--- head/sys/dev/nvme/nvme_test.c	Wed Feb 27 22:02:46 2019	(r344639)
+++ head/sys/dev/nvme/nvme_test.c	Wed Feb 27 22:05:01 2019	(r344640)
@@ -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, ca
 	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);
 


More information about the svn-src-all mailing list