Linux 5.6 compat: struct proc_ops

The proc_ops structure was introduced to replace the use of of the
file_operations structure when registering proc handlers.  This
change creates a new kstat_proc_op_t typedef for compatibility
which can be used to pass around the correct structure.

This change additionally adds the 'const' keyword to all of the
existing proc operations structures.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9961
This commit is contained in:
Brian Behlendorf
2020-02-06 10:30:41 -08:00
parent e0ce98d57c
commit 0dd7364853
6 changed files with 97 additions and 12 deletions
+9 -2
View File
@@ -185,13 +185,20 @@ procfs_list_write(struct file *filp, const char __user *buf, size_t len,
return (len);
}
static struct file_operations procfs_list_operations = {
.owner = THIS_MODULE,
static const kstat_proc_op_t procfs_list_operations = {
#ifdef HAVE_PROC_OPS_STRUCT
.proc_open = procfs_list_open,
.proc_write = procfs_list_write,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = seq_release_private,
#else
.open = procfs_list_open,
.write = procfs_list_write,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_private,
#endif
};
/*