Whamcloud - gitweb
LU-5275 lprocfs: reduce scope of params_tree.h
[fs/lustre-release.git] / lustre / lov / lproc_lov.c
index 7786513..1a1de46 100644 (file)
@@ -54,7 +54,8 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v)
        return seq_printf(m, LPU64"\n", desc->ld_default_stripe_size);
 }
 
-static ssize_t lov_stripesize_seq_write(struct file *file, const char *buffer,
+static ssize_t lov_stripesize_seq_write(struct file *file,
+                                       const char __user *buffer,
                                        size_t count, loff_t *off)
 {
        struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
@@ -84,7 +85,8 @@ static int lov_stripeoffset_seq_show(struct seq_file *m, void *v)
        return seq_printf(m, LPU64"\n", desc->ld_default_stripe_offset);
 }
 
-static ssize_t lov_stripeoffset_seq_write(struct file *file, const char *buffer,
+static ssize_t lov_stripeoffset_seq_write(struct file *file,
+                                         const char __user *buffer,
                                          size_t count, loff_t *off)
 {
        struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
@@ -113,7 +115,8 @@ static int lov_stripetype_seq_show(struct seq_file *m, void *v)
        return seq_printf(m, "%u\n", desc->ld_pattern);
 }
 
-static ssize_t lov_stripetype_seq_write(struct file *file, const char *buffer,
+static ssize_t lov_stripetype_seq_write(struct file *file,
+                                       const char __user *buffer,
                                        size_t count, loff_t *off)
 {
        struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
@@ -143,7 +146,8 @@ static int lov_stripecount_seq_show(struct seq_file *m, void *v)
                          (__s16)(desc->ld_default_stripe_count + 1) - 1);
 }
 
-static ssize_t lov_stripecount_seq_write(struct file *file, const char *buffer,
+static ssize_t lov_stripecount_seq_write(struct file *file,
+                                        const char __user *buffer,
                                         size_t count, loff_t *off)
 {
        struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
@@ -227,12 +231,12 @@ static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
 static int lov_tgt_seq_show(struct seq_file *p, void *v)
 {
         struct lov_tgt_desc *tgt = v;
-        return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index, 
-                          obd_uuid2str(&tgt->ltd_uuid), 
-                          tgt->ltd_active ? "" : "IN");
+       return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
+                         obd_uuid2str(&tgt->ltd_uuid),
+                         tgt->ltd_active ? "" : "IN");
 }
 
-struct seq_operations lov_tgt_sops = {
+static const struct seq_operations lov_tgt_sops = {
         .start = lov_tgt_seq_start,
         .stop = lov_tgt_seq_stop,
         .next = lov_tgt_seq_next,
@@ -244,7 +248,10 @@ static int lov_target_seq_open(struct inode *inode, struct file *file)
        struct seq_file *seq;
        int rc;
 
-       LPROCFS_ENTRY_CHECK(PDE(inode));
+       rc = LPROCFS_ENTRY_CHECK(inode);
+       if (rc < 0)
+               return rc;
+
        rc = seq_open(file, &lov_tgt_sops);
        if (rc)
                return rc;