Remove blk_end_request() autotools check.
Signed-off-by: Richard Yao <ryao@gentoo.org>
This commit is contained in:
parent
65f340e725
commit
dd6f9fe61b
@ -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 <linux/blkdev.h>
|
|
||||||
],[
|
|
||||||
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 <linux/module.h>
|
|
||||||
#include <linux/blkdev.h>
|
|
||||||
|
|
||||||
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"
|
|
||||||
])
|
|
@ -28,7 +28,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||||||
ZFS_AC_KERNEL_BIO_RW_SYNC
|
ZFS_AC_KERNEL_BIO_RW_SYNC
|
||||||
ZFS_AC_KERNEL_BIO_RW_SYNCIO
|
ZFS_AC_KERNEL_BIO_RW_SYNCIO
|
||||||
ZFS_AC_KERNEL_REQ_SYNC
|
ZFS_AC_KERNEL_REQ_SYNC
|
||||||
ZFS_AC_KERNEL_BLK_END_REQUEST
|
|
||||||
ZFS_AC_KERNEL_BLK_QUEUE_FLUSH
|
ZFS_AC_KERNEL_BLK_QUEUE_FLUSH
|
||||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS
|
ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS
|
||||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS
|
ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS
|
||||||
|
@ -58,80 +58,6 @@ blk_requeue_request(request_queue_t *q, struct request *req)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_BLK_REQUEUE_REQUEST */
|
#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,
|
* 2.6.36 API change,
|
||||||
* The blk_queue_flush() interface has replaced blk_queue_ordered()
|
* The blk_queue_flush() interface has replaced blk_queue_ordered()
|
||||||
|
Loading…
Reference in New Issue
Block a user