Commit Graph

66 Commits

Author SHA1 Message Date
Krzysztof Majzerowicz-Jaszcz
da885a8ade Fix for a build failure for Ubuntu 18.04 kernel 4.15
This patch fixes the problem of fs_bio_set being defined as a pointer in
kernels before 4.18, which results in build failure.

Fixes #1312

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-08-18 13:43:00 +02:00
Krzysztof Majzerowicz-Jaszcz
e997f768b0 Rework for RHEL8.5
Rework for RHEL8.5 compatibility to avoid potential bug of exiting queue
after IO completion on a different CPU.

Targeted RHEL kernel version corrected.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-08-16 13:50:59 +02:00
Krzysztof Majzerowicz-Jaszcz
b983eeb751 RHEL8.5 kernel 4.18 support fix
This patch adds support for RHEL8.5 with kernel 4.18.0.348.2.1.el8 and
later.

Additional request queue operations added for these kernels.
Configure scripts added/updated.

Fixes #1278

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-08-12 08:52:36 +02:00
Michal Mielewczyk
e4bc62bd18 Add missing semicolons in configure scripts
Since commit 51dc893fc1 every script must take care about adding a semicolon at
the end of compilable line of code

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-08-11 13:33:31 +02:00
Robert Baldyga
a4610f96cc configure: Add get_define() helper function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-10 12:13:15 +02:00
Robert Baldyga
51dc893fc1 configure: Don't append semicolon by default
This allows to pass not only C code, but also preprocessor directives.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-09 19:49:38 +02:00
Robert Baldyga
d460d39374 configure: Fix coding style
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-09 19:49:38 +02:00
Adam Rutkowski
ae1bede207 remove unused config options
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-27 16:25:15 +02:00
Krzysztof Majzerowicz-Jaszcz
b3140ed863 Fix for #1224 - kernel crash in the IO path
This fixes issue #1224 - null pointer dereference in kernel in the IO path with large IO's issued

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-06-14 05:12:48 -04:00
Krzysztof Majzerowicz-Jaszcz
24fd2d1140 Fix compilation issues on rhel's 4.18 kernel
RHELs patched kernel needs additional configure.d test in order to
configure OpenCAS. This patch implements this.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-06-10 09:08:29 -04:00
Krzysztof Majzerowicz-Jaszcz
12ddca1cf3 OpenCAS Linux kernel 5.15 adaptation
This patch adapts OpenCAS Linux to compile and work with kernel v5.15

Commit id's from the kernel affecting OpenCAS:

commit 0e0ccdecb3cff95a350b4364e7ebbaa754d0e47d
    block: remove bdget_disk

commit 9c2b9dbafc067e173db30c4fd0636392d27944e8
    block: remove alloc_disk and alloc_disk_node

commit a8698707a1835be3abd12a3b28079a80999f8dee
    block: move bd_mutex to struct gendisk

commit 2cece3778475abc855084d897a3cf61249798ad9
    scsi: scsi_ioctl: Remove scsi_req_init()

commit 2f4731dcd0bb73379fbb9e3eb07ae7324125caef
    block: remove bdput

commit 14cf1dbb55bb07427babee425fd2a8a9300737cc
    block: remove bdgrab

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-06-09 08:49:32 +02:00
Gal Hammer
4ed8a59402 configure/bio_max_vecs: adapt to kernel 5.12
The bio_alloc_bioset() function now BUG() if trying to allocate a bio
with more than BIO_MAX_VECS vectors.

A no-limit value (-1) is defined in order not to change old kernels'
behaviour.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2022-03-08 16:06:03 +02:00
Gal Hammer
1d64bc5294 configure/bd_first_part: adapt to kernel 5.12
The disk's partitions table was changed to xarray.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2022-03-07 09:44:35 +01:00
Gal Hammer
3c3cb6bdf1 configure/bio_dev: adapt to kernel 5.12
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2022-03-07 09:44:35 +01:00
Gal Hammer
4bb435555f configure/bd_part_count: adapt to kernel 5.12
Moved cas_blk_get_part_count function to configure section after the
the disk's partitions table was changed to xarray.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2022-03-07 09:44:35 +01:00
Gal Hammer
fea5e72d8c configure/module_mutex: adapt to kernel 5.12
The module_mutex is internal to the module loader since kernel
commit 922f2a7c.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-07 09:41:59 +01:00
Robert Baldyga
46e6d92732 configure: trigger compilation error on pointer type incompatibility
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 16:45:11 +01:00
Gal Hammer
2162e945c2 configure: adapt to kernel 5.11
The disk_part_iter_next function is declated in linux/genhd.h header file.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2021-12-28 17:10:51 +02:00
Rafal Stefanowski
3d23b6d08f Fix kernel __vmalloc() check
Use dedicated 'pgprot_t' type instead of 'struct pgprot'
which is only defined for x86 architecture.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-11-25 09:14:42 +01:00
Robert Baldyga
d9b8df7748
Merge pull request #978 from rafalste/license_change_contributions
License change to be approved by contributors
2021-11-19 16:58:44 +01:00
Rafal Stefanowski
acec05060d Fix license
Change license to BSD-3-Clause

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-28 12:46:42 +02:00
Rafal Stefanowski
c7a0ae4af3 License change to be approved by contributors
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-27 11:54:04 +02:00
Robert Baldyga
17950e5a43 Fix API incompatibility detection in configure script
Convert warning about int to pointer detection into an error.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-08-25 14:09:06 +02:00
Jan Musial
ac00bd503a Add config for BLK_MQ_F_BLOCKING flag
Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-08-18 09:04:15 +02:00
Robert Baldyga
517d98a6ed Split big IO requests
OCF cannot allocate request map bigger than 4MiB (due to kmalloc
limitations), thus we need to split bigger IOs into series smaller
ones to reduce request map size.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-07-07 18:52:22 +02:00
Robert Baldyga
d6fa4c6d53 configure: Fix condition for bd_first_part
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-18 13:19:56 +02:00
Robert Baldyga
e5e0697da4 Add support for kernel 5.11
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
c7ac8c55f4 Remove unused configs
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
b82b338c53 Remove blk request handling path
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
7343cb55fa Handle all io on bio handler
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 16:52:35 +02:00
Adam Rutkowski
9c08ed4b87 Set proper multiqueue flags
Setting BLK_MQ_F_STACKING (to indicate stacked device) and
BLK_MQ_F_BLOCKING (to indicate potentially blocking operations
like acquiring mutex or GFP_NOIO allocations).

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-04-16 22:52:18 -05:00
Kozlowski Mateusz
ab0a7e0a44 Add detection of ktime_get_real_ts64 vs getnstimeofday
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-03-26 13:46:09 +01:00
Rafal Stefanowski
43f43068ad Update copyright statements (2021)
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-01-21 13:15:38 +01:00
Robert Baldyga
493caf2b31 configure: Fix coding style
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-01-15 10:10:41 +01:00
Robert Baldyga
ca3e1a5984 Revert "modules: use si_mem_available() when possible"
This method produced too optimistic free memory value, which in result
led to oom killer activation. This patch restores more conservative
free memory calculation method.

This reverts commit 1e9b7a4262.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-01-14 15:16:09 +01:00
Robert Baldyga
1810010093 Use default kernel export mechanism when symbol lookup is not available
Since kernel 5.7 kallsyms_on_each_symbol() is not available.
NOTE: This affects ability to perform upgrade in flight on kernels 5.7+.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
0596597f61 Replace ioctl_by_bdev() with vfs_ioctl()
Since kernel 5.8 ioctl_by_bdev() is not available.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
c596c66063 configure: Add wrappers for default make request function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
48c3598ef5 configure: Add bdev_disk_changed() wrapper
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
d9ea8d3e32 configure: Add blk_queue_make_request() wrapper
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
ca7f809965 configure: Add __vmalloc() wrapper
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
bbd0cb57a5 configure: Update generic_acct wrapper to kernel 5.8
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Anatol Pomozov
c04b0b6d67 Use linux/blkdev.h header for lookup_bdev()
Upstream commit 3f1266f1f82d7 moved lookup_bdev() to linux/blkdev.h

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
2020-11-05 15:22:46 -08:00
Anatol Pomozov
59d0492ef4 Specify modules source dir to avoid build warnings
If we run 'make kernelversion' in a read-only dir then it produces

  mkdir: cannot create directory ‘.tmp_1056416’: Permission denied
  mkdir: cannot create directory ‘.tmp_1056420’: Permission denied
  mkdir: cannot create directory ‘.tmp_1056421’: Permission denied
  mkdir: cannot create directory ‘.tmp_1056423’: Permission denied

warnings. To avoid it we need to specify where the source (and build)
directory located.

Closes #540

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
2020-10-29 18:36:23 -07:00
Michal Mielewczyk
8b64206570 configure: add CAS_BLK_BIDI_RQ() macro
Since commit 8b3238cabd50e27 in linux kernel removed blk_bidi_rq() marco, it
has to be wrapped in CAS `configure` script

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-08-25 08:46:24 -04:00
Robert Baldyga
1e25420f86
Merge pull request #404 from rafalste/copyright_update
Update copyright statements
2020-05-19 11:25:11 +02:00
Rafal Stefanowski
44b4020cc1 Update copyright statements
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-05-04 16:47:38 +02:00
Michal Rakowski
1e9b7a4262 modules: use si_mem_available() when possible
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2020-04-29 11:05:41 +02:00
Michal Mielewczyk
195e5c5e56 configure: Save output from test modules compilation.
Currently configure script doesn't support any logging mechanism. To make easy
debugging possible, output from all failed compilation attempts is stored.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-10-14 08:43:45 -04:00
Michal Rakowski
0bd6fd4036 configure: use blk_mq_end_request as a default instead of non-mq variant
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-26 16:21:15 +02:00