]> git.pld-linux.org Git - packages/lin_tape.git/blob - linux-4.11.patch
- started update to 3.0.18
[packages/lin_tape.git] / linux-4.11.patch
1 --- lin_tape-3.0.18/lin_tape_tape.h~    2017-05-09 21:24:21.100249196 +0200
2 +++ lin_tape-3.0.18/lin_tape_tape.h     2017-05-09 21:22:43.130950272 +0200
3 @@ -85,7 +85,11 @@
4  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
5  #define KOBJ_CT(kobj) ((kobj) ? atomic_read(&(kobj)->refcount) : 0)
6  #else
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
8  #define KOBJ_CT(kobj) ((kobj) ? atomic_read(&(kobj)->kref.refcount) : 0)
9 +#else
10 +#define KOBJ_CT(kobj) ((kobj) ? kref_read(&(kobj)->kref) : 0)
11 +#endif
12  #endif
13  
14  /* global definitions */
15 --- lin_tape-3.0.18/lin_tape_ioctl_tape.c~      2017-05-09 21:30:01.000000000 +0200
16 +++ lin_tape-3.0.18/lin_tape_ioctl_tape.c       2017-05-09 21:36:05.393963455 +0200
17 @@ -6464,7 +6464,11 @@
18         } /* if */
19  
20         tmp_rq = (void*)sdev->request_queue;
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
22 +       scsi_req_init(req);
23 +#else
24         req->cmd_type = REQ_TYPE_BLOCK_PC;
25 +#endif
26  #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
27         req->cmd_flags |= REQ_QUIET;
28  #else
29 @@ -6540,17 +6540,29 @@
30                 bio = req->bio;
31         } /* if */
32  
33 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
34 +       scsi_req(req)->cmd_len = COMMAND_SIZE(cdb[0]);
35 +       memset(scsi_req(req)->cmd, '\0', MAX_CDB_SIZE);
36 +       memcpy(scsi_req(req)->cmd, cdb, scsi_req(req)->cmd_len);
37 +       scsi_req(req)->sense = sense_data;
38 +       scsi_req(req)->sense_len = 0;
39 +#else
40         req->cmd_len = COMMAND_SIZE(cdb[0]);
41         memset(req->cmd, '\0', MAX_CDB_SIZE);
42         memcpy(req->cmd, cdb, req->cmd_len);
43         req->sense = sense_data;
44         req->sense_len = 0;
45 +#endif
46         req->timeout = timeout;
47         req->retries = 0;
48  
49         blk_execute_rq(req->q, NULL, req, 1);
50  
51 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
52 +       *resid = scsi_req(req)->resid_len;
53 +#else
54         *resid = req->resid_len;
55 +#endif
56         status_code = req->errors;
57  
58         if(buf_len && !use_sg) {
59 --- lin_tape-3.0.18/stmp.c~     2017-05-09 21:30:01.000000000 +0200
60 +++ lin_tape-3.0.18/stmp.c      2017-05-09 21:35:48.826918381 +0200
61 @@ -611,7 +611,11 @@
62         if (!req)
63                 return DRIVER_ERROR << 24;
64  
65 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
66 +       scsi_req_init(req);
67 +#else
68         req->cmd_type = REQ_TYPE_BLOCK_PC;
69 +#endif
70  #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
71         req->cmd_flags |= REQ_QUIET;
72  #else
This page took 0.025911 seconds and 3 git commands to generate.