For kernels at 3.10 and above the release method for block
devices no longer return a integer. This impacts the lloop
block device we use on the lustre client side.
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ib63e2897a48989f1cf5185a1c88a5ddbf989c0a9
Reviewed-on: http://review.whamcloud.com/5380
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>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+# 3.10 release for block device doesn't return int
+AC_DEFUN([LC_BLKDEV_RELEASE_RETURN_INT],
+[AC_MSG_CHECKING([if block_device_operations release returns int])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+],[
+ struct block_device_operations fops;
+ int i __attribute__ ((unused));
+
+ i = fops.release(NULL,0);
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_BLKDEV_RELEASE_RETURN_INT, 1,
+ [block device release returns int])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
# 3.10
LC_HAVE_ONLY_PROCFS_SEQ
# 3.10
LC_HAVE_ONLY_PROCFS_SEQ
+ LC_BLKDEV_RELEASE_RETURN_INT
#
if test x$enable_server != xno ; then
#
if test x$enable_server != xno ; then
-static int lo_release(struct gendisk *disk, fmode_t mode)
+#ifdef HAVE_BLKDEV_RELEASE_RETURN_INT
+static int
+#else
+static void
+#endif
+lo_release(struct gendisk *disk, fmode_t mode)
- struct lloop_device *lo = disk->private_data;
+ struct lloop_device *lo = disk->private_data;
mutex_lock(&lo->lo_ctl_mutex);
mutex_lock(&lo->lo_ctl_mutex);
mutex_unlock(&lo->lo_ctl_mutex);
mutex_unlock(&lo->lo_ctl_mutex);
+#ifdef HAVE_BLKDEV_RELEASE_RETURN_INT
+ return 0;
+#endif
}
/* lloop device node's ioctl function. */
}
/* lloop device node's ioctl function. */