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 <uja.ornl@gmail.com>
Change-Id: Ieedface5065d660284c5dfb9a61cb81e4174c61d
Reviewed-on: http://review.whamcloud.com/8104
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
-# 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 <linux/bio.h>
-],[
- 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)
# 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)
LC_CONFIG_RMTCLIENT
LC_CONFIG_GSS
LC_CONFIG_RMTCLIENT
LC_CONFIG_GSS
- # 2.6.24
- LC_BIO_ENDIO_2ARG
-
# 2.6.32
LC_BLK_QUEUE_MAX_SEGMENTS
# 2.6.32
LC_BLK_QUEUE_MAX_SEGMENTS
#define cfs_for_each_possible_cpu(cpu) for_each_cpu(cpu)
#endif
#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
#ifndef HAVE_SIMPLE_SETATTR
#define simple_setattr(dentry, ops) inode_setattr((dentry)->d_inode, ops)
#endif
loop_add_bio(lo, old_bio);
LL_MRF_RETURN(0);
err:
loop_add_bio(lo, old_bio);
LL_MRF_RETURN(0);
err:
- cfs_bio_io_error(old_bio, old_bio->bi_size);
while (bio) {
struct bio *tmp = bio->bi_next;
bio->bi_next = NULL;
while (bio) {
struct bio *tmp = bio->bi_next;
bio->bi_next = NULL;
- cfs_bio_endio(bio, bio->bi_size, ret);
#define __REQ_WRITE BIO_RW
#endif
#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)
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;
{
struct osd_iobuf *iobuf = bio->bi_private;
struct bio_vec *bvl;
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);
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);
}
/* the check is outside of the cycle for performance reason -bzzz */
}
/* the check is outside of the cycle for performance reason -bzzz */
* 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);
* 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);
}
static void record_start_io(struct osd_iobuf *iobuf, int size)
}
static void record_start_io(struct osd_iobuf *iobuf, int size)