Whamcloud - gitweb
LU-506 FC15: unplug_fn removed since 2.6.39.
authoryangsheng <ys@whamcloud.com>
Thu, 24 Nov 2011 05:12:28 +0000 (13:12 +0800)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Dec 2011 15:48:30 +0000 (10:48 -0500)
The old plugging interface isn't exist any more. So
disable the unplug_fn callback in this case.

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I2396b845e2f2ef158f8e21e031a31ac83f3a5b02
Reviewed-on: http://review.whamcloud.com/1738
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/llite/lloop.c

index 52c1db2..15c8a99 100644 (file)
@@ -2057,6 +2057,24 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
 ])
 ])
 
+#
+# 2.6.39 remove unplug_fn from request_queue.
+#
+AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
+[AC_MSG_CHECKING([if request_queue has unplug_fn field])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/blkdev.h>
+],[
+        struct request_queue rq;
+        memset(rq.unplug_fn, 0, sizeof(rq.unplug_fn));
+],[
+        AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
+                [request_queue has unplug_fn field]),
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
 
 #
 # LC_PROG_LINUX
 
 #
 # LC_PROG_LINUX
@@ -2209,6 +2227,9 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_BLK_QUEUE_MAX_SECTORS
          LC_BLK_QUEUE_MAX_SEGMENTS
 
          LC_BLK_QUEUE_MAX_SECTORS
          LC_BLK_QUEUE_MAX_SEGMENTS
 
+         # 2.6.39
+         LC_REQUEST_QUEUE_UNPLUG_FN
+
          #
          if test x$enable_server = xyes ; then
              AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
          #
          if test x$enable_server = xyes ; then
              AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
index fa98a49..952d144 100644 (file)
@@ -379,6 +379,7 @@ err:
         return 0;
 }
 
         return 0;
 }
 
+#ifdef HAVE_REQUEST_QUEUE_UNPLUG_FN
 /*
  * kick off io on the underlying address space
  */
 /*
  * kick off io on the underlying address space
  */
@@ -389,6 +390,7 @@ static void loop_unplug(struct request_queue *q)
         clear_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags);
         blk_run_address_space(lo->lo_backing_file->f_mapping);
 }
         clear_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags);
         blk_run_address_space(lo->lo_backing_file->f_mapping);
 }
+#endif
 
 static inline void loop_handle_bio(struct lloop_device *lo, struct bio *bio)
 {
 
 static inline void loop_handle_bio(struct lloop_device *lo, struct bio *bio)
 {
@@ -541,7 +543,9 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
          */
         blk_queue_make_request(lo->lo_queue, loop_make_request);
         lo->lo_queue->queuedata = lo;
          */
         blk_queue_make_request(lo->lo_queue, loop_make_request);
         lo->lo_queue->queuedata = lo;
+#ifdef HAVE_REQUEST_QUEUE_UNPLUG_FN
         lo->lo_queue->unplug_fn = loop_unplug;
         lo->lo_queue->unplug_fn = loop_unplug;
+#endif
 
         /* queue parameters */
         CLASSERT(CFS_PAGE_SIZE < (1 << (sizeof(unsigned short) * 8)));
 
         /* queue parameters */
         CLASSERT(CFS_PAGE_SIZE < (1 << (sizeof(unsigned short) * 8)));