]> git.pld-linux.org Git - packages/lin_tape.git/blobdiff - kernel-5.6.patch
- up to 3.0.52
[packages/lin_tape.git] / kernel-5.6.patch
diff --git a/kernel-5.6.patch b/kernel-5.6.patch
new file mode 100644 (file)
index 0000000..651d11e
--- /dev/null
@@ -0,0 +1,150 @@
+--- lin_tape-3.0.52/lin_tape_scsi_config.h~    2020-03-05 19:43:09.000000000 +0100
++++ lin_tape-3.0.52/lin_tape_scsi_config.h     2020-04-04 21:53:09.046695460 +0200
+@@ -223,6 +223,7 @@
+ {
+       return single_open(file, tape_read_proc, NULL);
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ static struct file_operations tape_proc_ops = {
+     .owner   = THIS_MODULE,
+     .open    = tape_open_proc,
+@@ -230,6 +231,14 @@
+     .llseek  = seq_lseek,
+     .release = single_release,
+ };
++#else
++static struct proc_ops tape_proc_ops = {
++    .proc_open    = tape_open_proc,
++    .proc_read    = seq_read,
++    .proc_lseek  = seq_lseek,
++    .proc_release = single_release,
++};
++#endif
+ #endif
+ int rd_pc_initial
+@@ -255,6 +264,7 @@
+ {
+       return single_open(file, changer_read_proc, NULL);
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ static struct file_operations changer_proc_ops = {
+     .owner   = THIS_MODULE,
+     .open    = changer_open_proc,
+@@ -262,6 +272,14 @@
+     .llseek  = seq_lseek,
+     .release = single_release,
+ };
++#else
++static struct proc_ops changer_proc_ops = {
++    .proc_open    = changer_open_proc,
++    .proc_read    = seq_read,
++    .proc_lseek  = seq_lseek,
++    .proc_release = single_release,
++};
++#endif
+ #endif
+ static int status_read_proc
+@@ -273,6 +291,7 @@
+ {
+       return single_open(file, status_read_proc, NULL);
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ static struct file_operations status_proc_ops = {
+     .owner   = THIS_MODULE,
+     .open    = status_open_proc,
+@@ -280,6 +299,14 @@
+     .llseek  = seq_lseek,
+     .release = single_release,
+ };
++#else
++static struct proc_ops status_proc_ops = {
++    .proc_open    = status_open_proc,
++    .proc_read    = seq_read,
++    .proc_lseek  = seq_lseek,
++    .proc_release = single_release,
++};
++#endif
+ #endif
+ int rdstatus_pc_initial
+--- lin_tape-3.0.52/lin_tape_ioctl_tape.c~     2020-03-05 19:43:09.000000000 +0100
++++ lin_tape-3.0.52/lin_tape_ioctl_tape.c      2020-04-04 22:13:44.016713929 +0200
+@@ -25,6 +25,16 @@
+ #include "lin_tape_scsi_tape.h"
+ #include <linux/delay.h>
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++struct lin_tape_timeval {
++  __kernel_long_t      tv_sec;
++  __kernel_suseconds_t tv_usec;
++};
++#else
++#define lin_tape_timeval timeval
++#endif
++
+ /*****************************************************************************
+  *                                                                           *
+  *              Tape Drive Ioctls                                            *
+@@ -2794,7 +2804,7 @@
+ ssize_t tape_set_tod(struct tape_descriptor** drvp)
+ {
+-      struct timeval* tv = NULL;
++      struct lin_tape_timeval* tv = NULL;
+       struct tod_control* buffer = NULL;
+       struct tape_descriptor *drv = *drvp;
+       int now = 0, rc = STATUS_SUCCESS;
+@@ -2810,20 +2820,20 @@
+               goto EXIT_LABEL;
+       } /* if */
+-      tv = kmalloc(sizeof(struct timeval), GFP_KERNEL);
++      tv = kmalloc(sizeof(struct lin_tape_timeval), GFP_KERNEL);
+       if(!tv) {
+               rc = -ENOMEM;
+               goto EXIT_LABEL;
+       } /* if */
+       memset(buffer, '\0', sizeof(struct tod_control));
+-      memset(tv, '\0', sizeof(struct timeval));
++      memset(tv, '\0', sizeof(struct lin_tape_timeval));
+       rc = tape_modesense_page(&drv, TODControlPageNumber, (unchar*)buffer,
+               sizeof(struct tod_control), True, True);
+       if(rc != STATUS_SUCCESS) goto EXIT_LABEL;
+-      memset(tv, '\0', sizeof(struct timeval));
++      memset(tv, '\0', sizeof(struct lin_tape_timeval));
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
+       do_gettimeofday(tv);
+ #else
+@@ -8930,7 +8940,7 @@
+ int erp_tod(struct tape_descriptor* drv, union cdb* tmp_cdb, char* sense_data)
+ {
+-      struct timeval* tv = NULL;
++      struct lin_tape_timeval* tv = NULL;
+       struct tod_control* tod_buf = NULL;
+       int now = 0, rc = -EIO;
+@@ -8940,7 +8950,7 @@
+               goto EXIT_LABEL;
+       } /* if */
+-      tv = kmalloc(sizeof(struct timeval), GFP_KERNEL);
++      tv = kmalloc(sizeof(struct lin_tape_timeval), GFP_KERNEL);
+       if(!tv) {
+               rc = -ENOMEM;
+               goto EXIT_LABEL;
+@@ -8951,7 +8961,7 @@
+       if(rc != STATUS_SUCCESS) goto EXIT_LABEL;
+       /* get time info to set TOD */
+-      memset(tv, '\0', sizeof(struct timeval));
++      memset(tv, '\0', sizeof(struct lin_tape_timeval));
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
+       do_gettimeofday(tv);
+ #else
This page took 0.751066 seconds and 4 git commands to generate.