diff --git a/config/kernel-blk-end-request.m4 b/config/kernel-blk-end-request.m4 deleted file mode 100644 index c2980e593..000000000 --- a/config/kernel-blk-end-request.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl # -dnl # 2.6.31 API change -dnl # In 2.6.29 kernels blk_end_request() was a GPL-only symbol, this was -dnl # changed in 2.6.31 so it may be used by non-GPL modules. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_BLK_END_REQUEST], [ - AC_MSG_CHECKING([whether blk_end_request() is available]) - tmp_flags="$EXTRA_KCFLAGS" - EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}" - ZFS_LINUX_TRY_COMPILE([ - #include - ],[ - struct request *req = NULL; - (void) blk_end_request(req, 0, 0); - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_END_REQUEST, 1, - [blk_end_request() is available]) - ],[ - AC_MSG_RESULT(no) - ]) - - AC_MSG_CHECKING([whether blk_end_request() is GPL-only]) - ZFS_LINUX_TRY_COMPILE([ - #include - #include - - MODULE_LICENSE("$ZFS_META_LICENSE"); - ],[ - struct request *req = NULL; - (void) blk_end_request(req, 0, 0); - ],[ - AC_MSG_RESULT(no) - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_END_REQUEST_GPL_ONLY, 1, - [blk_end_request() is GPL-only]) - ]) - EXTRA_KCFLAGS="$tmp_flags" -]) diff --git a/config/kernel.m4 b/config/kernel.m4 index b06cdfa59..dfaa4c64a 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -28,7 +28,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_BIO_RW_SYNC ZFS_AC_KERNEL_BIO_RW_SYNCIO ZFS_AC_KERNEL_REQ_SYNC - ZFS_AC_KERNEL_BLK_END_REQUEST ZFS_AC_KERNEL_BLK_QUEUE_FLUSH ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index 2dbf87ca6..a8a2700af 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -58,80 +58,6 @@ blk_requeue_request(request_queue_t *q, struct request *req) } #endif /* HAVE_BLK_REQUEUE_REQUEST */ -#ifndef HAVE_BLK_END_REQUEST -static inline bool -__blk_end_request(struct request *req, int error, unsigned int nr_bytes) -{ - LIST_HEAD(list); - - /* - * Request has already been dequeued but 2.6.18 version of - * end_request() unconditionally dequeues the request so we - * add it to a local list to prevent hitting the BUG_ON. - */ - list_add(&req->queuelist, &list); - - /* - * The old API required the driver to end each segment and not - * the entire request. In our case we always need to end the - * entire request partial requests are not supported. - */ - req->hard_cur_sectors = nr_bytes >> 9; - end_request(req, ((error == 0) ? 1 : error)); - - return (0); -} - -static inline bool -blk_end_request(struct request *req, int error, unsigned int nr_bytes) -{ - struct request_queue *q = req->q; - bool rc; - - spin_lock_irq(q->queue_lock); - rc = __blk_end_request(req, error, nr_bytes); - spin_unlock_irq(q->queue_lock); - - return (rc); -} -#else -#ifdef HAVE_BLK_END_REQUEST_GPL_ONLY -/* - * Define required to avoid conflicting 2.6.29 non-static prototype for a - * GPL-only version of the helper. As of 2.6.31 the helper is available - * to non-GPL modules and is not explicitly exported GPL-only. - */ -#define __blk_end_request __blk_end_request_x -#define blk_end_request blk_end_request_x - -static inline bool -__blk_end_request_x(struct request *req, int error, unsigned int nr_bytes) -{ - /* - * The old API required the driver to end each segment and not - * the entire request. In our case we always need to end the - * entire request partial requests are not supported. - */ - req->hard_cur_sectors = nr_bytes >> 9; - end_request(req, ((error == 0) ? 1 : error)); - - return (0); -} -static inline bool -blk_end_request_x(struct request *req, int error, unsigned int nr_bytes) -{ - struct request_queue *q = req->q; - bool rc; - - spin_lock_irq(q->queue_lock); - rc = __blk_end_request_x(req, error, nr_bytes); - spin_unlock_irq(q->queue_lock); - - return (rc); -} -#endif /* HAVE_BLK_END_REQUEST_GPL_ONLY */ -#endif /* HAVE_BLK_END_REQUEST */ - /* * 2.6.36 API change, * The blk_queue_flush() interface has replaced blk_queue_ordered()