aboutsummaryrefslogtreecommitdiffstats
path: root/config
Commit message (Collapse)AuthorAgeFilesLines
* Linux 5.17 compat: PDE_DATA() renamed to pde_data()наб2022-02-041-7/+9
| | | | | | | | | | | | | Upstream commit 359745d78351c6f5442435f81549f0207ece28aa ("proc: remove PDE_DATA() completely") Link: https://lore.kernel.org/all/[email protected]/T/#u Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13004 Closes #12989
* Linux 5.17 compat: dequeue_signal() takes a 4th argumentнаб2022-02-041-2/+43
| | | | | | | | | | | | | Linux 5.17's dequeue_signal() takes an additional enum pid_type * output argument Upstream commit 5768d8906bc23d512b1a736c1e198aa833a6daa4 ("signal: Requeue signals in the appropriate queue") Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12989
* Linux 5.17 compat: detect complete_and_exit() renameнаб2022-02-042-0/+29
| | | | | | | | | | | | | Linux 5.17 sees a rename from complete_and_exit() to kthread complete_and_exit() Upstream commit cead18552660702a4a46f58e65188fe5f36e9dfe ("exit: Rename complete_and_exit to kthread_complete_and_exit") Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12989
* Add support for FALLOC_FL_ZERO_RANGERich Ercolani2022-02-041-0/+17
| | | | | | | | | | For us, I think it's always just FALLOC_FL_PUNCH_HOLE with a fake mustache on. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Coleman Kane <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12975
* Linux 5.16 compat: Added mapping for iov_iter_fault_in_readableRich Ercolani2022-02-042-3/+20
| | | | | | | | | | Linux decided to rename this for some reason. At some point, we should probably invert this mapping, but for now... Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Coleman Kane <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12975
* Linux 5.16 compat: Added add_disk check for returnRich Ercolani2022-02-042-0/+29
| | | | | | | | | add_disk went from void to must-check int return. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Coleman Kane <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12975
* Linux 5.16 compat: Check slab.h for kvmallocRich Ercolani2022-02-041-0/+1
| | | | | | | | | As it says on the tin - the folio work moved a bunch out of mm.h. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Coleman Kane <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12975
* Linux 5.16: The blk-cgroup.h header is where struct blkcg_gq is definedColeman Kane2021-12-071-0/+27
| | | | | | | | | | | | | The definition of struct blkcg_gq was moved into blk-cgroup.h, which is a header that's been in Linux since 2015. This is used by vdev_blkg_tryget() in module/os/linux/zfs/vdev_disk.c. Since the kernel for CentOS 7 and similar-generation releases doesn't have this header, its inclusion is guarded by a configure test. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12819
* Linux 5.16: bio_set_dev is no longer a helper macroColeman Kane2021-12-071-0/+28
| | | | | | | | | | | | | | | | | | This change adds a confiugre check to determine if bio_set_dev is a helper macro or not. If not, then the attempt to override its internal call to bio_associate_blkg(), with a macro definition to our own version, is no longer possible, as the compiler won't use it when compiling the new inline function replacement implemented in the header. This change also creates a new vdev_bio_set_dev() function that performs the same work, and also performs the work implemented in vdev_bio_associate_blkg(), as it is the only thing calling that function in our code. Our custom vdev_bio_associate_blkg() is now only compiled if the bio_set_dev() is a macro in the Linux headers. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12819
* Linux 5.16: type member of iov_iter renamed iter_typeColeman Kane2021-12-071-0/+22
| | | | | | | | | | | | | The iov_iter->type member was renamed iov_iter->iter_type. However, while looking into this, realized that in 2018 a iov_iter_type(*iov) accessor function was introduced. So if that is present, use it, otherwise fall back to trying the existing behavior of directly accessing type from iov_iter. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12819
* Linux 5.16: block_device_operations->submit_bio now returns voidColeman Kane2021-12-071-0/+29
| | | | | | | | | | The return type for the submit_bio member of struct block_device_operations was changed to no longer return a value. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12819
* Linux 5.16 compat: asm/fpu/xcr.h is new location for xgetbv/xsetbvColeman Kane2021-12-071-0/+15
| | | | | | | | | | | Linux 5.16 moved these functions into this new header in commit 1b4fb8545f2b00f2844c4b7619d64d98440a477c. This change adds code to look for the presence of this header, and include it so that the code using xgetbv & xsetbv will compile again. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12800
* Linux 5.13 compat: retry zvol_open() when contendedBrian Behlendorf2021-12-061-0/+22
| | | | | | | | | | | | | | | | | | | | | | | Due to a possible lock inversion the zvol open call path on Linux needs to be able to retry in the case where the spa_namespace_lock cannot be acquired. For Linux 5.12 an older kernel this was accomplished by returning -ERESTARTSYS from zvol_open() to request that blkdev_get() drop the bdev->bd_mutex lock, reaquire it, then call the open callback again. However, as of the 5.13 kernel this behavior was removed. Therefore, for 5.12 and older kernels we preserved the existing retry logic, but for 5.13 and newer kernels we retry internally in zvol_open(). This should always succeed except in the case where a pool's vdev are layed on zvols, in which case it may fail. To handle this case vdev_disk_open() has been updated to retry when opening a device when -ERESTARTSYS is returned. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #12301 Closes #12759
* Linux 5.16: wait_on_page_bit() no longer available to modulesColeman Kane2021-12-062-0/+28
| | | | | | | | | | | | | Instead, linux/pagemap.h offers a number of folio-specific functions to be called instead. In this case, module/os/linux/zfs/zfs_vnops_os.c wants to call wait_on_page_bit(pp, PG_writeback). This gets replaced with folio_wait_bit(folio_page(pp), PG_writeback). This change modifies the code to conditionally compile that if configure identifies th presence of the folio_wait_bit() function. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12800
* Linux 5.16 compat: submit_bio()Brian Behlendorf2021-11-051-2/+1
| | | | | | | | | | | | The submit_bio() prototype has changed again. The version is 5.16 still only expects a single argument but the return type has changed to void. Since we never used the returned value before update the configure check to detect both single arg versions. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #12725
* Use fallthrough macroBrian Behlendorf2021-11-023-0/+25
| | | | | | | | | | | | | | | | As of the Linux 5.9 kernel a fallthrough macro has been added which should be used to anotate all intentional fallthrough paths. Once all of the kernel code paths have been updated to use fallthrough the -Wimplicit-fallthrough option will because the default. To avoid warnings in the OpenZFS code base when this happens apply the fallthrough macro. Additional reading: https://lwn.net/Articles/794944/ Reviewed-by: Tony Nguyen <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #12441
* Detect HAVE_LARGE_STACKS at compile time (#12584)Kevin Bowling2021-11-012-32/+0
| | | | | | | | | | Move HAVE_LARGE_STACKS definitions to header and set when appropriate. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Kevin Bowling <[email protected]> Closes #12350
* Correct a flaw in the Python 3 version checking (#12636)Rich Ercolani2021-11-012-6/+42
| | | | | | | | | | | | | | | It turns out the ax_python_devel.m4 version check assumes that ("3.X+1.0" >= "3.X.0") is True in Python, which is not when X+1 is 10 or above and X is not. (Also presumably X+1=100 and ...) So let's remake the check to behave consistently, using the "packaging" or (if absent) the "distlib" modules. (Also, update the Github workflows to use the new packages.) Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes: #12073
* Linux 5.15 compat: get_acl()Brian Behlendorf2021-09-141-1/+22
| | | | | | | | | | | | | | | Kernel commits 332f606b32b6 ovl: enable RCU'd ->get_acl() 0cad6246621b vfs: add rcu argument to ->get_acl() callback Added compatibility code to detect the new ->get_acl() interface and correctly handle the case where the new rcu argument is set. Reviewed-by: Coleman Kane <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #12548
* Linux 5.15 compat: standalone <linux/stdarg.h>Alexander2021-09-142-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | Kernel commits 39f75da7bcc8 ("isystem: trim/fixup stdarg.h and other headers") c0891ac15f04 ("isystem: ship and use stdarg.h") 564f963eabd1 ("isystem: delete global -isystem compile option") (for now can be found in linux-next.git tree, will land into the Linus' tree during the ongoing 5.15 cycle with one of akpm merges) removed the -isystem flag and disallowed the inclusion of any compiler header files. They also introduced a minimal <linux/stdarg.h> as a replacement for <stdarg.h>. include/os/linux/spl/sys/cmn_err.h in the ZFS source tree includes <stdarg.h> unconditionally. Introduce a test for <linux/stdarg.h> and include it instead of the compiler's one to prevent module build breakage. Reviewed-by: Tony Nguyen <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Lobakin <[email protected]> Closes #12531
* Linux 5.15 compat: block device readaheadBrian Behlendorf2021-09-141-0/+40
| | | | | | | | | | | | | | | | | | | | | | | The 5.15 kernel moved the backing_dev_info structure out of the request queue structure which causes a build failure. Rather than look in the new location for the BDI we instead detect this upstream refactoring by the existance of either the blk_queue_update_readahead() or disk_update_readahead() functions. In either case, there's no longer any reason to manually set the ra_pages value since it will be overridden with a reasonable default (2x the block size) when blk_queue_io_opt() is called. Therefore, we update the compatibility wrapper to do nothing for 5.9 and newer kernels. While it's tempting to do the same for older kernels we want to keep the compatibility code to preserve the existing behavior. Removing it would effectively increase the default readahead to 128k. Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #12532
* Libabigail: make .abi files more consistentGeorge Melikov2021-09-141-1/+5
| | | | | | | Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #12529
* Correct checking bdev_check_media_change messageRyan Moeller2021-09-141-1/+1
| | | | | | | | | We're not looking for bdev_disk_changed. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #12492
* Linux 5.14 compat: explicity assign set_page_dirtyColeman Kane2021-09-142-0/+36
| | | | | | | | | | | | | | | Kernel 5.14 introduced a change where set_page_dirty of struct address_space_operations is no longer implicitly set to __set_page_dirty_buffers(), which ended up resulting in a NULL pointer deref in the kernel when it is attempted to be called. This change sets .set_page_dirty in the structure to __set_page_dirty_nobuffers(), which was introduced with the related patch set. The breaking change was introduce in commit 0af573780b0b13fceb7fabd49dc1b073cee9a507 to torvalds/linux.git. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #12427
* Linux 5.14 compat: blk_alloc_disk()Brian Behlendorf2021-09-141-0/+20
| | | | | | | | | | | | | | | | In Linux 5.14, blk_alloc_queue is no longer exported, and its usage has been superseded by blk_alloc_disk, which returns a gendisk struct from which we can still retrieve the struct request_queue* that is needed in the one place where it is used. This also replaces the call to alloc_disk(minors), and minors is now set via struct member assignment. Reviewed-by: Tony Nguyen <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Coleman Kane <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #12362 Closes #12409
* config/libatomic: require -latomic iff atomic.c doesn't link w/o itнаб2021-09-141-20/+14
| | | | | | | | | | | In absence of LTO, and dynamic libatomic, la.so ends up in the needs section of every toolchain executable; some consider this an issue. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12345 Closes #12359
* libspl: implement atomics in terms of atomicsнаб2021-06-212-0/+35
| | | | | | | | | | | | | | | | This replaces the generic libspl atomic.c atomics implementation with one based on builtin gcc atomics. This functionality was added as an experimental feature in gcc 4.4. Today even CentOS 7 ships with gcc 4.8 as the default compiler we can make this the default. Furthermore, the builtin atomics are as good or better than our hand-rolled implementation so it's reasonable to drop that custom code. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11904 Closes #12252 Closes #12244
* Force --enable-debug on FreeBSD if INVARIANTS is setRich Ercolani2021-06-091-0/+17
| | | | | | | | | | | There's already logic to force INVARIANTS on for building if it's present in the running kernel; however, not having DEBUG enabled when DEBUG and INVARIANTS are can cause strange panics. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12185 Closes #12163
* Turn checkbashisms into a make targetнаб2021-06-092-1/+18
| | | | | | | | | make_gitrev.sh actually breaks checkbashisms' parser, which /insists/ that the end-of-line " is actually a string start Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12101
* Turn shellcheck into a normal make target. Fix new files it caughtнаб2021-06-093-0/+16
| | | | | | | | | | | This checks every file it checked (and a few more), but explicitly instead of "if it works it works" best-effort (which wasn't that good anyway) Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #10512 Closes #12101
* Introduce write-mostly sumsAlexander Motin2021-06-091-0/+27
| | | | | | | | | | | | | | | | | | | | | wmsum counters are a reduced version of aggsum counters, optimized for write-mostly scenarios. They do not provide optimized read functions, but instead allow much cheaper add function. The primary usage is infrequently read statistic counters, not requiring exact precision. The Linux implementation is directly mapped into percpu_counter KPI. The FreeBSD implementation is directly mapped into counter(9) KPI. In user-space due to lack of better implementation mapped to aggsum. Unfortunately neither Linux percpu_counter nor FreeBSD counter(9) provide sufficient functionality to completelly replace aggsum, so it still remains to be used for several hot counters. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored-By: iXsystems, Inc. Closes #12114
* Fix SC2181 ("[ $?") outside tests/наб2021-06-081-2/+1
| | | | | | | Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12042
* Minor fix to configure on s390xRich Ercolani2021-05-281-1/+3
| | | | | | | | | configure on s390x has a key check fail with an error about a variable being used uninitialized. So let's initialize it. Reviewed-by: Colin Ian King <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12126
* Bend zpl_set_acl to permit the new userns* parameterRich Ercolani2021-05-271-2/+23
| | | | | | | | | | | | Just like #12087, the set_acl signature changed with all the bolted-on *userns parameters, which disabled set_acl usage, and caused #12076. Turn zpl_set_acl into zpl_set_acl and zpl_set_acl_impl, and add a new configure test for the new version. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12076 Closes #12093
* Various Linux kABI cosmeticsнаб2021-05-272-4/+8
| | | | | | | Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12103
* Update tmpfile() existence detectionRich Ercolani2021-05-271-4/+24
| | | | | | | | | | | | Linux changed the tmpfile() signature again in torvalds/linux@6521f89, which in turn broke our HAVE_TMPFILE detection in configure. Update that macro to include the new case, and change the signature of zpl_tmpfile as appropriate. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes: #12060 Closes: #12087
* linux 5.13 compat: bdevops->revalidate_disk() removedColeman Kane2021-05-271-0/+32
| | | | | | | | | | | | | | Linux kernel commit 0f00b82e5413571ed225ddbccad6882d7ea60bc7 removes the revalidate_disk() handler from struct block_device_operations. This caused a regression, and this commit eliminates the call to it and the assignment in the block_device_operations static handler assignment code, when configure identifies that the kernel doesn't support that API handler. Reviewed-by: Colin Ian King <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #11967 Closes #11977
* Add SIGSTOP and SIGTSTP handling to issigPaul Dagnelie2021-04-194-0/+69
| | | | | | | | | | | | | | | | This change adds SIGSTOP and SIGTSTP handling to the issig function; this mirrors its behavior on Solaris. This way, long running kernel tasks can be stopped with the appropriate signals. Note that doing so with ctrl-z on the command line doesn't return control of the tty to the shell, because tty handling is done separately from stopping the process. That can be future work, if people feel that it is a necessary addition. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Issue #810 Issue #10843 Closes #11801
* Added check for broken alien versionRich Ercolani2021-04-142-1/+19
| | | | | | | | | | | Added a check for alien 8.95.{1,2,3}, which is known to fail to generate debs 100% of the time, and instead print out a message informing the developer that it's known to be broken and linking them to more information. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #11848 Closes #11850
* Fix various typosAndrea Gelmini2021-04-072-2/+2
| | | | | | | | | | Correct an assortment of typos throughout the code base. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Andrea Gelmini <[email protected]> Closes #11774
* Bump libzfs.so and libzpool.so versionsBrian Behlendorf2021-04-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Bump the library versions as advised by the libtool guidelines. https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html Two new functions were added but no existing functions were changed, so we increase the version and the age (version:revision:age). Added functions (2): - boolean_t zpool_is_draid_spare(const char *); - zpool_compat_status_t zpool_load_compat(const char *, boolean_t *, char *, char *); Additionally bump the libzpool.so version information. This library is for internal use but we still want to update the version to track major changes to the interfaces. The libzfsbootenv, libuutil, libnvpair and libzfs_core libraries have not been updated. Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11817
* Fixing m4 iops rename checkBrian Atkinson2021-04-071-0/+1
| | | | | | | | | The configure check for iops->rename wanting flags was missing the AC_MSG_CHECKING() so it would just print yes without saying what was being checked. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes #11825
* Linux 5.12 update: bio_max_segs() replaces BIO_MAX_PAGESColeman Kane2021-03-192-0/+25
| | | | | | | | | | | The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs() function that implements the typical MIN(x,y) logic used throughout the kernel for bounding the allocation, and also the new implementation is intended to be signed-safe (which the former was not). Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #11765
* Linux 5.12 compat: idmapped mountsColeman Kane2021-03-1912-107/+398
| | | | | | | | | | | | | | | | In Linux 5.12, the filesystem API was modified to support ipmapped mounts by adding a "struct user_namespace *" parameter to a number functions and VFS handlers. This change adds the needed autoconf macros to detect the new interfaces and updates the code appropriately. This change does not add support for idmapped mounts, instead it preserves the existing behavior by passing the initial user namespace where needed. A subsequent commit will be required to add support for idmapped mounted. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #11712
* FreeBSD module --enable-debug --enable-invariantsRyan Moeller2021-03-051-0/+36
| | | | | | | | | | | | Wire up the --enable-debug flag for configure to the FreeBSD module build. Add --enable-invariants. The running FreeBSD kernel config is used to detect whether to enable INVARIANTS if not explicitly specified with --enable-invariants or --disable-invariants. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11678
* Linux 5.12 compat: replace bio_*_io_acct with disk_*_io_acctColeman Kane2021-02-241-22/+47
| | | | | | | | | | | | The bio_*_acct functions became GPL exports, which causes the kernel modules to refuse to compile. This replaces code with alternate function calls to the disk_*_io_acct interfaces, which are not GPL exports. This change was added in kernel commit 99dfc43ecbf67f12a06512918aaba61d55863efc. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #11639
* Linux 5.12 compat: bio->bi_disk member movedColeman Kane2021-02-241-0/+29
| | | | | | | | | | The struct bio member bi_disk was moved underneath a new member named bi_bdev. So all attempts to reference bio->bi_disk need to now become bio->bi_bdev->bd_disk. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Coleman Kane <[email protected]> Closes #11639
* Add "compatibility" property for zpool feature setsColm2021-02-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Property to allow sets of features to be specified; for compatibility with specific versions / releases / external systems. Influences the behavior of 'zpool upgrade' and 'zpool create'. Initial man page changes and test cases included. Brief synopsis: zpool create -o compatibility=off|legacy|file[,file...] pool vdev... compatibility = off : disable compatibility mode (enable all features) compatibility = legacy : request that no features be enabled compatibility = file[,file...] : read features from specified files. Only features present in *all* files will be enabled on the resulting pool. Filenames may be absolute, or relative to /etc/zfs/compatibility.d or /usr/share/zfs/compatibility.d (/etc checked first). Only affects zpool create, zpool upgrade and zpool status. ABI changes in libzfs: * New function "zpool_load_compat" to load and parse compat sets. * Add "zpool_compat_status_t" typedef for compatibility parse status. * Add ZPOOL_PROP_COMPATIBILITY to the pool properties enum * Add ZPOOL_STATUS_COMPATIBILITY_ERR to the pool status enum An initial set of base compatibility sets are included in cmd/zpool/compatibility.d, and the Makefile for cmd/zpool is modified to install these in $pkgdatadir/compatibility.d and to create symbolic links to a reasonable set of aliases. Reviewed-by: ericloewe Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Colm Buckley <[email protected]> Closes #11468
* Remove unused iov_iter_init_compat() wrapperBrian Behlendorf2021-01-301-44/+0
| | | | | | | | | | This compatibility code is no longer needed. For it a while iov_iter_init_compat() was used by zfs_uio_prefaultpages() but this code should have been dropped as part of commit 83b91ae1. Take care of that oversight and remove it. Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11543
* cppcheck: integrete cppcheckBrian Behlendorf2021-01-265-4/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for cppcheck to perform a proper analysis it needs to be aware of how the sources are compiled (source files, include paths/files, extra defines, etc). All the needed information is available from the Makefiles and can be leveraged with a generic cppcheck Makefile target. So let's add one. Additional minor changes: * Removing the cppcheck-suppressions.txt file. With cppcheck 2.3 and these changes it appears to no longer be needed. Some inline suppressions were also removed since they appear not to be needed. We can add them back if it turns out they're needed for older versions of cppcheck. * Added the ax_count_cpus m4 macro to detect at configure time how many processors are available in order to run multiple cppcheck jobs. This value is also now used as a replacement for nproc when executing the kernel interface checks. * "PHONY =" line moved in to the Rules.am file which is included at the top of all Makefile.am's. This is just convenient becase it allows us to use the += syntax to add phony targets. * One upside of this integration worth mentioning is it now allows `make cppcheck` to be run in any directory to check that subtree. * For the moment, cppcheck is not run against the FreeBSD specific kernel sources. The cppcheck-FreeBSD target will need to be implemented and testing on FreeBSD to support this. Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11508