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
4 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
5 #define KOBJ_CT(kobj) ((kobj) ? atomic_read(&(kobj)->refcount) : 0)
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
8 #define KOBJ_CT(kobj) ((kobj) ? atomic_read(&(kobj)->kref.refcount) : 0)
10 +#define KOBJ_CT(kobj) ((kobj) ? kref_read(&(kobj)->kref) : 0)
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 @@
20 tmp_rq = (void*)sdev->request_queue;
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
24 req->cmd_type = REQ_TYPE_BLOCK_PC;
26 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
27 req->cmd_flags |= REQ_QUIET;
29 @@ -6540,17 +6540,29 @@
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;
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;
46 req->timeout = timeout;
49 blk_execute_rq(req->q, NULL, req, 1);
51 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
52 + *resid = scsi_req(req)->resid_len;
54 *resid = req->resid_len;
56 status_code = req->errors;
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
63 return DRIVER_ERROR << 24;
65 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
68 req->cmd_type = REQ_TYPE_BLOCK_PC;
70 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
71 req->cmd_flags |= REQ_QUIET;