])
])
+# 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])
+])
+])
+
#
# LC_PROG_LINUX
#
# 3.10
LC_HAVE_ONLY_PROCFS_SEQ
+ LC_BLKDEV_RELEASE_RETURN_INT
#
if test x$enable_server != xno ; then
return 0;
}
-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);
- --lo->lo_refcnt;
+ --lo->lo_refcnt;
mutex_unlock(&lo->lo_ctl_mutex);
-
- return 0;
+#ifdef HAVE_BLKDEV_RELEASE_RETURN_INT
+ return 0;
+#endif
}
/* lloop device node's ioctl function. */