Whamcloud - gitweb
LU-9679 lustre: avoid cast of file->private_data
[fs/lustre-release.git] / lustre / fld / lproc_fld.c
index 1bcecdf..5edc90d 100644 (file)
@@ -82,7 +82,8 @@ static ssize_t
 fld_debugfs_hash_seq_write(struct file *file, const char __user *buffer,
                        size_t count, loff_t *off)
 {
-       struct lu_client_fld *fld;
+       struct seq_file *m = file->private_data;
+       struct lu_client_fld *fld = m->private;
        struct lu_fld_hash *hash = NULL;
        char fh_name[8];
        int i;
@@ -93,8 +94,6 @@ fld_debugfs_hash_seq_write(struct file *file, const char __user *buffer,
        if (copy_from_user(fh_name, buffer, count) != 0)
                return -EFAULT;
 
-       fld = ((struct seq_file *)file->private_data)->private;
-
        for (i = 0; fld_hash[i].fh_name; i++) {
                if (count != strlen(fld_hash[i].fh_name))
                        continue;