Whamcloud - gitweb
LU-2800 autoconf: remove bio_endio args test 04/8104/2
authorJames Simmons <uja.ornl@gmail.com>
Wed, 30 Oct 2013 13:04:18 +0000 (09:04 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 14 Nov 2013 04:14:14 +0000 (04:14 +0000)
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>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/llite/lloop.c
lustre/osd-ldiskfs/osd_io.c

index 1cccf82..dbbfc71 100644 (file)
@@ -356,24 +356,6 @@ AC_DEFUN([LC_CONFIG_GSS],
  fi
 ])
 
  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 <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)
@@ -1258,9 +1240,6 @@ AC_DEFUN([LC_PROG_LINUX],
          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
 
index 0366fff..3e52025 100644 (file)
@@ -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
 
 #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
index 30a55d6..1f5c6de 100644 (file)
@@ -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:
         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);
 }
 
        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;
         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;
         }
 }
                 bio = tmp;
         }
 }
index c407fb8..f7df35f 100644 (file)
@@ -145,13 +145,7 @@ void osd_fini_iobuf(struct osd_device *d, struct osd_iobuf *iobuf)
 #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;
@@ -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);
                        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 */
         }
 
         /* 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);
          * 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)
 }
 
 static void record_start_io(struct osd_iobuf *iobuf, int size)