From: James Simmons Date: Wed, 30 Oct 2013 13:04:18 +0000 (-0400) Subject: LU-2800 autoconf: remove bio_endio args test X-Git-Tag: 2.5.52~87 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=286f68d3859293b52917e74cb0dcc488c5649852 LU-2800 autoconf: remove bio_endio args test Since linux kernel version 2.6.24 the bio api has been taking one less argument than in previous versions. Since we no longer support kernels earlier than 2.6.32 we can drop this test and simplify the code using the bio api. Signed-off-by: James Simmons Change-Id: Ieedface5065d660284c5dfb9a61cb81e4174c61d Reviewed-on: http://review.whamcloud.com/8104 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Andreas Dilger --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 1cccf82..dbbfc71 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -356,24 +356,6 @@ AC_DEFUN([LC_CONFIG_GSS], fi ]) -# 2.6.24 - -# 2.6.24 has bio_endio with 2 args -AC_DEFUN([LC_BIO_ENDIO_2ARG], -[AC_MSG_CHECKING([if kernel has bio_endio with 2 args]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - bio_endio(NULL, 0); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1, - [kernel has bio_endio with 2 args]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # up to v2.6.27 had a 3 arg version (inode, mask, nameidata) # v2.6.27->v2.6.37 had a 2 arg version (inode, mask) # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata) @@ -1258,9 +1240,6 @@ AC_DEFUN([LC_PROG_LINUX], LC_CONFIG_RMTCLIENT LC_CONFIG_GSS - # 2.6.24 - LC_BIO_ENDIO_2ARG - # 2.6.32 LC_BLK_QUEUE_MAX_SEGMENTS diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 0366fff..3e52025 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -225,14 +225,6 @@ unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm) #define cfs_for_each_possible_cpu(cpu) for_each_cpu(cpu) #endif -#ifdef HAVE_BIO_ENDIO_2ARG -#define cfs_bio_io_error(a,b) bio_io_error((a)) -#define cfs_bio_endio(a,b,c) bio_endio((a),(c)) -#else -#define cfs_bio_io_error(a,b) bio_io_error((a),(b)) -#define cfs_bio_endio(a,b,c) bio_endio((a),(b),(c)) -#endif - #ifndef HAVE_SIMPLE_SETATTR #define simple_setattr(dentry, ops) inode_setattr((dentry)->d_inode, ops) #endif diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c index 30a55d6..1f5c6de 100644 --- a/lustre/llite/lloop.c +++ b/lustre/llite/lloop.c @@ -369,7 +369,7 @@ loop_make_request(struct request_queue *q, struct bio *old_bio) loop_add_bio(lo, old_bio); LL_MRF_RETURN(0); err: - cfs_bio_io_error(old_bio, old_bio->bi_size); + bio_io_error(old_bio); LL_MRF_RETURN(0); } @@ -393,7 +393,7 @@ static inline void loop_handle_bio(struct lloop_device *lo, struct bio *bio) while (bio) { struct bio *tmp = bio->bi_next; bio->bi_next = NULL; - cfs_bio_endio(bio, bio->bi_size, ret); + bio_endio(bio, ret); bio = tmp; } } diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index c407fb8..f7df35f 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -145,13 +145,7 @@ void osd_fini_iobuf(struct osd_device *d, struct osd_iobuf *iobuf) #define __REQ_WRITE BIO_RW #endif -#ifdef HAVE_BIO_ENDIO_2ARG -#define DIO_RETURN(a) static void dio_complete_routine(struct bio *bio, int error) -#else -#define DIO_RETURN(a) return(a) -static int dio_complete_routine(struct bio *bio, unsigned int done, int error) -#endif { struct osd_iobuf *iobuf = bio->bi_private; struct bio_vec *bvl; @@ -175,7 +169,7 @@ static int dio_complete_routine(struct bio *bio, unsigned int done, int error) bio->bi_rw, bio->bi_vcnt, bio->bi_idx, bio->bi_size, bio->bi_end_io, cfs_atomic_read(&bio->bi_cnt), bio->bi_private); - DIO_RETURN(0); + return; } /* the check is outside of the cycle for performance reason -bzzz */ @@ -214,7 +208,6 @@ static int dio_complete_routine(struct bio *bio, unsigned int done, int error) * deadlocking the OST. The bios are now released as soon as complete * so the pool cannot be exhausted while IOs are competing. bug 10076 */ bio_put(bio); - DIO_RETURN(0); } static void record_start_io(struct osd_iobuf *iobuf, int size)