# HG changeset patch
# Parent 127d016f2ea8116365a36223e82aa0d1cca87ce1

diff -r 127d016f2ea8 lustre/llite/file.c
--- a/lustre/llite/file.c	Tue Dec 21 01:54:16 2010 +0900
+++ b/lustre/llite/file.c	Fri Jan 07 00:08:01 2011 +0900
@@ -2866,9 +2866,16 @@
         RETURN(rc);
 }
 
+#ifdef HAVE_UNLOCKED_IOCTL
+long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+
+        struct inode *inode = file->f_dentry->d_inode;
+#else
 int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                   unsigned long arg)
 {
+#endif
         struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
         int flags;
         ENTRY;
@@ -3601,7 +3608,11 @@
 #else
         .aio_write      = ll_file_aio_write,
 #endif
+#ifdef HAVE_UNLOCKED_IOCTL
+        .unlocked_ioctl = ll_file_ioctl,
+#else
         .ioctl          = ll_file_ioctl,
+#endif
         .open           = ll_file_open,
         .release        = ll_file_release,
         .mmap           = ll_file_mmap,
@@ -3629,7 +3640,11 @@
 #else
         .aio_write      = ll_file_aio_write,
 #endif
+#ifdef HAVE_UNLOCKED_IOCTL
+        .unlocked_ioctl = ll_file_ioctl,
+#else
         .ioctl          = ll_file_ioctl,
+#endif
         .open           = ll_file_open,
         .release        = ll_file_release,
         .mmap           = ll_file_mmap,
@@ -3662,7 +3677,11 @@
 #else
         .aio_write      = ll_file_aio_write,
 #endif
+#ifdef HAVE_UNLOCKED_IOCTL
+        .unlocked_ioctl = ll_file_ioctl,
+#else
         .ioctl          = ll_file_ioctl,
+#endif
         .open           = ll_file_open,
         .release        = ll_file_release,
         .mmap           = ll_file_mmap,
diff -r 127d016f2ea8 lustre/obdclass/linux/linux-module.c
--- a/lustre/obdclass/linux/linux-module.c	Tue Dec 21 01:54:16 2010 +0900
+++ b/lustre/obdclass/linux/linux-module.c	Fri Jan 07 00:08:01 2011 +0900
@@ -198,8 +198,13 @@
 }
 
 /* to control /dev/obd */
+#ifdef HAVE_UNLOCKED_IOCTL
+static long obd_class_ioctl(struct file *filp, unsigned int cmd,
+                           unsigned long arg)
+#else
 static int obd_class_ioctl(struct inode *inode, struct file *filp,
                            unsigned int cmd, unsigned long arg)
+#endif
 {
         int err = 0;
         ENTRY;
@@ -218,7 +223,11 @@
 /* declare character device */
 static struct file_operations obd_psdev_fops = {
         .owner   = THIS_MODULE,
+#if HAVE_UNLOCKED_IOCTL
+        .unlocked_ioctl = obd_class_ioctl, /* unlocked_ioctl */
+#else
         .ioctl   = obd_class_ioctl,     /* ioctl */
+#endif
         .open    = obd_class_open,      /* open */
         .release = obd_class_release,   /* release */
 };
diff -r 127d016f2ea8 lustre/obdecho/echo_client.c
--- a/lustre/obdecho/echo_client.c	Tue Dec 21 01:54:16 2010 +0900
+++ b/lustre/obdecho/echo_client.c	Fri Jan 07 00:08:01 2011 +0900
@@ -1179,7 +1179,9 @@
         int                     i;
         ENTRY;
 
+#ifndef HAVE_UNLOCKED_IOCTL
         unlock_kernel();
+#endif
 
         memset(&dummy_oti, 0, sizeof(dummy_oti));
 
@@ -1303,7 +1305,9 @@
                 ldlm_lock_decref(&ack_lock->lock, ack_lock->mode);
         }
 
+#ifndef HAVE_UNLOCKED_IOCTL
         lock_kernel();
+#endif
 
         return rc;
 }
diff -r 127d016f2ea8 lustre/tests/obdfilter-survey.sh
--- a/lustre/tests/obdfilter-survey.sh	Tue Dec 21 01:54:16 2010 +0900
+++ b/lustre/tests/obdfilter-survey.sh	Fri Jan 07 00:08:01 2011 +0900
@@ -5,6 +5,7 @@
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
+init_logging
 
 nobjhi=${nobjhi:-1}
 thrhi=${thrhi:-16}