Whamcloud - gitweb
LU-5396 lnet/klnds: add sparse annotation __user wherever needed
[fs/lustre-release.git] / lustre / fld / lproc_fld.c
index caf3c1a..8dd6fe4 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_FLD
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/module.h>
 #include <dt_object.h>
 #include <obd_support.h>
 #include <lustre_fld.h>
@@ -68,9 +63,8 @@ fld_proc_targets_seq_show(struct seq_file *m, void *unused)
        LASSERT(fld != NULL);
 
        spin_lock(&fld->lcf_lock);
-        cfs_list_for_each_entry(target,
-                                &fld->lcf_targets, ft_chain)
-               seq_printf(m, "%s\n", fld_target_name(target));
+       list_for_each_entry(target, &fld->lcf_targets, ft_chain)
+       seq_printf(m, "%s\n", fld_target_name(target));
        spin_unlock(&fld->lcf_lock);
        RETURN(0);
 }
@@ -91,7 +85,7 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused)
 }
 
 static ssize_t
-fld_proc_hash_seq_write(struct file *file, const char *buffer,
+fld_proc_hash_seq_write(struct file *file, const char __user *buffer,
                        size_t count, loff_t *off)
 {
        struct lu_client_fld *fld = ((struct seq_file *)file->private_data)->private;
@@ -124,7 +118,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer,
 }
 
 static ssize_t
-lprocfs_cache_flush_seq_write(struct file *file, const char *buffer,
+lprocfs_cache_flush_seq_write(struct file *file, const char __user *buffer,
                               size_t count, loff_t *pos)
 {
        struct lu_client_fld *fld = ((struct seq_file *)file->private_data)->private;