Whamcloud - gitweb
LU-16350 osd-ldiskfs: no_llseek removed, dquot_transfer
[fs/lustre-release.git] / lustre / ofd / ofd_access_log.c
index 791d027..8d00ed1 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/circ_buf.h>
 #include <linux/device.h>
 #include <linux/fs.h>
+#include <linux/idr.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/module.h>
@@ -340,10 +341,9 @@ unsigned int oal_file_poll(struct file *filp, struct poll_table_struct *wait)
        return mask;
 }
 
-static long oal_ioctl_info(struct oal_circ_buf *ocb, unsigned long arg)
+static long oal_ioctl_info(struct oal_circ_buf *ocb, void __user *uarg)
 {
        struct ofd_access_log *oal = ocb->ocb_access_log;
-
        struct lustre_access_log_info_v1 __user *lali;
        u32 entry_count = CIRC_CNT(ocb->ocb_circ.head,
                                ocb->ocb_circ.tail,
@@ -352,7 +352,7 @@ static long oal_ioctl_info(struct oal_circ_buf *ocb, unsigned long arg)
                                ocb->ocb_circ.tail,
                                oal->oal_log_size) / oal->oal_entry_size;
 
-       lali = (struct lustre_access_log_info_v1 __user *)arg;
+       lali = uarg;
        BUILD_BUG_ON(sizeof(lali->lali_name) != sizeof(oal->oal_name));
 
        if (put_user(LUSTRE_ACCESS_LOG_VERSION_1, &lali->lali_version))
@@ -392,7 +392,7 @@ static long oal_ioctl_info(struct oal_circ_buf *ocb, unsigned long arg)
 }
 
 static long oal_file_ioctl(struct file *filp, unsigned int cmd,
-                       unsigned long arg)
+                          unsigned long arg)
 {
        struct oal_circ_buf *ocb = filp->private_data;
 
@@ -400,7 +400,7 @@ static long oal_file_ioctl(struct file *filp, unsigned int cmd,
        case LUSTRE_ACCESS_LOG_IOCTL_VERSION:
                return LUSTRE_ACCESS_LOG_VERSION_1;
        case LUSTRE_ACCESS_LOG_IOCTL_INFO:
-               return oal_ioctl_info(ocb, arg);
+               return oal_ioctl_info(ocb, (void __user *)arg);
        case LUSTRE_ACCESS_LOG_IOCTL_FILTER:
                ocb->ocb_filter = arg;
                return 0;
@@ -432,7 +432,9 @@ static const struct file_operations oal_fops = {
        .read = &oal_file_read,
        .write = &oal_file_write,
        .poll = &oal_file_poll,
+#ifdef HAVE_NO_LLSEEK
        .llseek = &no_llseek,
+#endif
 };
 
 static void oal_device_release(struct device *dev)
@@ -571,9 +573,8 @@ void ofd_access_log_delete(struct ofd_access_log *oal)
 
        oal->oal_is_closed = 1;
        down_read(&oal->oal_buf_list_sem);
-       list_for_each_entry(ocb, &oal->oal_circ_buf_list, ocb_list) {
-               wake_up_all(&ocb->ocb_read_wait_queue);
-       }
+       list_for_each_entry(ocb, &oal->oal_circ_buf_list, ocb_list)
+               wake_up(&ocb->ocb_read_wait_queue);
        up_read(&oal->oal_buf_list_sem);
        cdev_device_del(&oal->oal_cdev, &oal->oal_device);
 }
@@ -629,7 +630,7 @@ static unsigned int oal_control_file_poll(struct file *filp, poll_table *wait)
 }
 
 static long oal_control_file_ioctl(struct file *filp, unsigned int cmd,
-                               unsigned long arg)
+                                  unsigned long arg)
 {
        struct oal_control_file *ccf = filp->private_data;