summaryrefslogtreecommitdiffstats
path: root/module
Commit message (Collapse)AuthorAgeFilesLines
* Update references to nonexistent man pages in codeRyan Moeller2020-10-309-11/+11
| | | | | | | | Refer to the correct section or alternative for FreeBSD and Linux. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11132
* FreeBSD: Remove BIO_ORDERED flag from BIO_FLUSHAlexander Motin2020-10-301-1/+0
| | | | | | | | | | | | | | ZFS always waits for the write completion before flushing the cache. That is why it does not require explicit ordering fences around it, which are pretty difficult to implement for NVMe, since one has no internal concept of strict request ordering. This was already removed from FreeBSD once, but got resurrected by mistake during OpenZFS merge. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Closes #11130
* Linux: g/c leftover fence in zfs_znode_allocMateusz Guzik2020-10-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | The port removed provisions for zfs_znode_move but the cleanup missed this bit. To quote the original: [snip] list_insert_tail(&zfsvfs->z_all_znodes, zp); membar_producer(); /* * Everything else must be valid before assigning z_zfsvfs makes the * znode eligible for zfs_znode_move(). */ zp->z_zfsvfs = zfsvfs; [/snip] In the current code it is immediately followed by unlock which issues the same fence, thus plays no role in correctness. Reviewed-by: Matt Macy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11115
* FreeBSD: g/c unused zfs_znode_move supportMateusz Guzik2020-10-292-31/+1
| | | | | | | | | The allocator does not provide the functionality to begin with. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Matt Macy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11114
* Use known license string for zluaBrian Behlendorf2020-10-271-1/+1
| | | | | | | | | | | The Linux kernel MODULE_LICENSE macro only recognizes a handful of license strings and "MIT" is not one of the them. Update the macro to use "Dual MIT/GPL" which is recognized and what the kernel expects MIT licensed modules to use. Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11112 Closes #11113
* FreeBSD: Skip RAW kstat sysctls by defaultRyan Moeller2020-10-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | These kstats are often expensive to compute so we want to avoid them unless specifically requested. The following kstats are affected by this change: kstat.zfs.${pool}.multihost kstat.zfs.${pool}.misc.state kstat.zfs.${pool}.txgs kstat.zfs.misc.fletcher_4_bench kstat.zfs.misc.vdev_raidz_bench kstat.zfs.misc.dbufs kstat.zfs.misc.dbgmsg In FreeBSD 13, sysctl(8) has been updated to still list the names/description/type of skipped sysctls so they are still discoverable. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Mateusz Guzik <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11099
* FreeBSD: catch up with 1300123 version bumpMateusz Guzik2020-10-261-0/+9
| | | | | | | | | - removed thread argument from VOP_INACTIVE - removed cred argument from VOP_VPTOCNP Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Matt Macy <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11104
* Add missing zfs_arc_evict_batch_limit tunableRyan Moeller2020-10-221-1/+4
| | | | | | | | It's even documented already. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11094
* Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSDMatthew Macy2020-10-2113-1250/+698
| | | | | | | | | | The zfs_fsync, zfs_read, and zfs_write function are almost identical between Linux and FreeBSD. With a little refactoring they can be moved to the common code which is what is done by this commit. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #11078
* Non-l2arc pool reads shouldn't be l2arc missesAdam D. Moss2020-10-201-8/+21
| | | | | | | | | | | | | | | | | | | | The current l2_misses accounting behavior treats all reads to pools without a configured l2arc as an l2arc miss, IFF there is at least one other pool on the system which does have an l2arc configured. This makes it extremely hard to tune for an improved l2arc hit/miss ratio because this ratio will be modulated by reads from pools which do not (and should not) have l2arc devices; its upper limit will depend on the ratio of reads from l2arc'd pools and non-l2arc'd pools. This PR prevents ARC reads affecting l2arc stats (n.b. l2_misses is the only relevant one) where the target spa doesn't have an l2arc. Includes new test - l2arc_l2miss_pos.ksh Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Amanakis <[email protected]> Signed-off-by: Adam Moss <[email protected]> Closes #10921
* Makefile.bsd: remove directory that no longer existsKyle Evans2020-10-201-1/+0
| | | | | | | | | | | This was removed in a reorganization of directories preparing for the merge of FreeBSD support, 006e9a408824 by mmacy. While llvm is perfectly happy with the nonexistent -I directory, the gcc6 and gcc9 we can elect to use as cross-toolchains both trip over it. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Kyle Evans <[email protected]> Closes #11077
* FreeBSD: delete unreferenced fileMatthew Macy2020-10-201-70/+0
| | | | | | | | | zfs_onexit_os.c was not deleted when it was removed from the build Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #11079
* FreeBSD: add missing fplookup_vexec handler to special vop vectorsMateusz Guzik2020-10-152-0/+12
| | | | | | | | | Otherwise lookup can fail with EOPNOTSUPP or panic. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Matt Macy <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11066
* FreeBSD: g/c unused vop vector zfsctl_ops_shares_dirMateusz Guzik2020-10-151-3/+1
| | | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Matt Macy <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11066
* Ignore special vdev ashift for spa ashift min/maxDon Brady2020-10-152-17/+25
| | | | | | | | | | | | | | | | | | | | | The removal of a vdev in the normal class would fail if there was a special or deup vdev that had a different ashift than the vdevs in the normal class. Moved the initialization of spa_min_ashift / spa_max_ashift from vdev_open so that it occurs after the vdev allocation bias was initialized (i.e. after vdev_load). Caveat -- In order to remove a special/dedup vdev it must have the same ashift as the normal pool vdevs. This could perhaps be lifted in the future (i.e. for the case where there is ample space in any surviving special class vdevs) Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #9363 Closes #9364 Closes #11053
* Fix crash caused by invalid snapshot names in redactnvlChristian Schwarz2020-10-141-1/+1
| | | | | | | | | | This is a follow up fix for commit 0fdd6106bb. The VERIFY is only true when we haven't hit an error code path. See added test case for a reproducer. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #11048
* Fix incorrect deletion order in range_tree_add_impl gap casePaul Dagnelie2020-10-141-1/+1
| | | | | | | | | | | | After a side-effectful call like add or remove, references to range segs stored in btrees can no longer be used safely. We move the remove call to just before the reinsertion call so that the seg remains valid for as long as we need it. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #11044 Closes #11056
* FreeBSD: fix panic due to tqid overflowMateusz Guzik2020-10-141-10/+38
| | | | | | | | | | | | | | | The 32-bit counter eventually wraps to 0 which is a sentinel for invalid id. Make it 64-bit on LP64 platforms and 0-check otherwise. Note: Linux counterpart uses id stored per queue instead of a global. I did not check going that way is feasible with the goal being the minimal fix doing the job. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11059
* Cross-platform acltypeRyan Moeller2020-10-136-13/+51
| | | | | | | | | | | | | | | | | The acltype property is currently hidden on FreeBSD and does not reflect the NFSv4 style ZFS ACLs used on the platform. This makes it difficult to observe that a pool imported from FreeBSD on Linux has a different type of ACL that is being ignored, and vice versa. Add an nfsv4 acltype and expose the property on FreeBSD. Make the default acltype nfsv4 on FreeBSD. Setting acltype to an unhanded style is treated the same as setting it to off. The ACLs will not be removed, but they will be ignored. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10520
* FreeBSD: make adjustments for the standalone environmentWarner Losh2020-10-131-1/+1
| | | | | | | | | | | In FreeBSD, there are three compile environments that are supported: user land, the kernel and the bootloader / standalone. Adjust the headers to compile in the standalone environment. Limit kernel-only items from view when _STANDALONE is defined. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Warner Losh <[email protected]> Closes #10998
* dmu_zfetch: don't leak unreferenced stream when zfetch is freedMatthew Macy2020-10-131-2/+6
| | | | | | | | | | | | | | | | | | | | | Currently streams are only freed when: - They have no referencing zfetch and and their I/O references go to zero. - They are more than 2s old and a new I/O request comes in on the same zfetch. This means that we will leak unreferenced streams when their zfetch structure is freed. This change checks the reference count on a stream at zfetch free time. If it is zero we free it immediately. If it has remaining references we allow the prefetch callback to free it at I/O completion time. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Adam Moss <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #11052
* aarch64: Use proper guards for NEON instructionsWarner Losh2020-10-131-3/+3
| | | | | | | | | | | | | | | | | | | | The zstd code assumes that if you are on aarch64, you have NEON instructions. This is not necessarily true. In a boot loader, where you might not have the VFP properly initialized, these instructions may not be available. It's also an error to include arm_neon.h when the NEON insturctions aren't enabled. Change the guards for using the NEON instructions from __aarch64__ to __ARM_NEON which is the standard symbol for knowing if they are available. __ARM_NEON is the proper symbol, defined in ARM C Language Extensions Release 2.1 (https://developer.arm.com/documentation/ihi0053/d/). Some sources suggest __ARM_NEON__, but that's the obsolete spelling from prior versions of the standard. Updated based on zstd pull request https://github.com/facebook/zstd/pull/2356 Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Warner Losh <[email protected]> Closes #11055
* FreeBSD: use cache_rename if availableMateusz Guzik2020-10-131-4/+14
| | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Matt Macy <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11045
* Expose zfetch_max_idistance tunableRyan Moeller2020-10-132-3/+7
| | | | | | | | | | | | | | | FreeBSD had this value tunable before the switch to the new OpenZFS. The tunable name has changed, breaking legacy compat. Restore legacy compat for this tunable, properly expose the tunable with the new name on all platforms, and document it in zfs-module-parameters(5). While here, clean up the documentation for zfetch_max_distance a bit. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11038
* zil_parse: make callback parameters constChristian Schwarz2020-10-093-15/+26
| | | | | | | | | Code cleanup, a follow up commit to 4d55ea81. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Co-authored-by: Ryan Moeller <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #11020
* Linux: Initialize zp in zfs_setattr_dirRyan Moeller2020-10-091-1/+1
| | | | | | | | | | | | | | | | The value of zp is used without having been initialized under some conditions. Initialize the pointer to NULL. Add a regression test case using chown in acl/posix. However, this is not enough because the setup sets xattr=sa, which means zfs_setattr_dir will not be called. Create a second group of acl tests in acl/posix-sa duplicating the acl/posix tests with symlinks, and remove xattr=sa from the original acl/posix tests. This provides more coverage for the default xattr=on code. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10043 Closes #11025
* Replace ZFS on Linux references with OpenZFSBrian Behlendorf2020-10-0819-27/+4
| | | | | | | | | | | | | This change updates the documentation to refer to the project as OpenZFS instead ZFS on Linux. Web links have been updated to refer to https://github.com/openzfs/zfs. The extraneous zfsonlinux.org web links in the ZED and SPL sources have been dropped. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11007
* Fix Linux modules uninstallJacob Adams2020-10-081-1/+1
| | | | | | | | | | | | A missing semicolon between kmoddir variable declaration and the uninstall for loop caused modules_uninstall-Linux to fail with: Syntax error: "do" unexpected Reviewed-by: Kjeld Schouten <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jacob Adams <[email protected]> Closes #11032
* Fix ubsan: shift exponent is too largeChuck Tuffli2020-10-081-1/+2
| | | | | | | | | | | | | | | | | | | When running libzpool with the Undefined Behavior Sanitizer (ubsan) enabled, a zpool create causes a run-time error: module/zfs/vdev_label.c:600:14: runtime error: shift exponent 64 is too large for 64-bit type 'long long unsigned int'` in vdev_config_generate() Fix is to convert vdev_removal_max_span to its base-2 logarithm, using highbit64(), and then compare the "shifts". Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Chuck Tuffli <[email protected]> Closes #9744 Closes #11024
* Make dbufstat work on FreeBSDRyan Moeller2020-10-081-0/+1
| | | | | | | | | | | | | With procfs_list kstats implemented for FreeBSD, dbufs are now exposed as kstat.zfs.misc.dbufs. On FreeBSD, dbufstats can use the sysctl instead of procfs when no input file has been given. Enable the dbufstats tests on FreeBSD. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11008
* FreeBSD: Sort and dedup includes in kmod_coreRyan Moeller2020-10-081-50/+43
| | | | | | | | Code cleanup. Sort includes, remove duplicates, and drop some extra blank lines in kmod_core.c. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11000
* Make L2ARC tests more robustGeorge Amanakis2020-10-051-11/+6
| | | | | | | | | | Instead of relying on arbitrary timers after pool export/import or cache device off/online rely on arcstats. This makes the L2ARC tests more robust. Also cleanup some functions related to persistent L2ARC. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Adam Moss <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #10983
* FreeBSD: Sort out kernel FPU headers for 12.1-RELRyan Moeller2020-10-021-4/+7
| | | | | | | | | | | We were missing an include for kernel FPU functions, breaking the build on FreeBSD 12.1-RELEASE. This was apparently being pulled in from elsewhere on stable/12 and head. Sorted the other includes in these files while here. Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11005
* Throw const on some stringsRyan Moeller2020-10-0211-74/+68
| | | | | | | | | | In C, const indicates to the reader that mutation will not occur. It can also serve as a hint about ownership. Add const in a few places where it makes sense. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10997
* Mismatched nvlist names in zfs_keys_send_spaceJohn Poduska2020-10-021-4/+6
| | | | | | | | | | | | | | | This causes "zfs send -vt ..." to fail with: cannot resume send: Unknown error 1030 It turns out that some of the name/value pairs in the verification list for zfs_ioc_send_space(), zfs_keys_send_space, had the wrong name, so the ioctl got kicked out in zfs_check_input_nvpairs(). Update the names accordingly. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: John Poduska <[email protected]> Closes #10978
* Fix buggy procfs_list_seq_next warningBrian Behlendorf2020-09-301-0/+12
| | | | | | | | | | | | | | | | | | | The kernel seq_read() helper function expects ->next() to update the passed position even there are no more entries. Failure to do so results in the following warning being logged. seq_file: buggy .next function procfs_list_seq_next [spl] did not update position index Functionally there is no issue with the way procfs_list_seq_next() is implemented and the warning is harmless. However, we want to silence this some what scary incorrect warning. This commit updates the Linux procfs code to advance the position even for the last entry. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10984 Closes #10996
* FreeBSD: Fix legacy compat for platform IOCsRyan Moeller2020-09-301-1/+3
| | | | | | | | | | The request number is out of bounds of the platform table. Subtract the starting offset to get the correct subscript. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10994
* Eliminate gratuitous bzeroing in dbuf_stats_hash_table_dataMatthew Macy2020-09-301-1/+2
| | | | | | | | | | `dbuf_stats_hash_table_data` can take much longer than it needs to by repeatedly bzeroing its buffer when in fact the buffer only needs to be NULL terminated. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10993
* do a cyclic seek for unused memory objects in poolSebastian Gottschall2020-09-302-2/+26
| | | | | | | | | | | | | | | | | | | | In non regular use cases allocated memory might stay persistent in memory pool. This small patch checks every minute if there are old objects which can be released from memory pool. Right now with regular use, the pool is checked for old objects on each allocation attempt from this pool. so basically polling by its use. Now consider what happens if someone writes a lot of files and stops use of the volume or even unmounts it. So the code will no longer check if objects can be released from the pool. Already allocated objects will still stay in pool cache. this is no big issue for common use. But someone discovered this issue while doing tests. personally i know this behavior and I'm aware of it. Its no big issue. just a enhancement Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Kjeld Schouten-Lebbing <[email protected]> Signed-off-by: Sebastian Gottschall <[email protected]> Closes #10938 Closes #10969
* Drop references when skipping dmu_send due to EXDEVRyan Moeller2020-09-302-5/+10
| | | | | | | | | | | | | | When an invalid incremental send is requested where the "to" ds is before the "from" ds, make sure to drop the reference to the pool and the dataset before returning the error. Add an assert on FreeBSD to make sure we don't hold any locks after returning from an ioctl. Add some test coverage. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10919
* Use known license string for zzstdBrian Behlendorf2020-09-281-1/+1
| | | | | | | | | | | The Linux kernel MODULE_LICENSE macro only recognizes a handful of license strings and "BSD" is not one of the them. Update the macro to use "Dual BSD/GPL" which is recognized and what the kernel expects BSD licensed module to use. Reviewed-by: Kjeld Schouten <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10982 Closes #10992
* zfetch: Don't issue new streams when old have not completedMatthew Macy2020-09-272-37/+150
| | | | | | | | | | | | | | | | | The current dmu_zfetch code implicitly assumes that I/Os complete within min_sec_reap seconds. With async dmu and a readonly workload (and thus no exponential backoff in operations from the "write throttle") such as L2ARC rebuild it is possible to saturate the drives with I/O requests. These are then effectively compounded with prefetch requests. This change reference counts streams and prevents them from being recycled after their min_sec_reap timeout if they still have outstanding I/Os. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10900
* Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.cAdam D. Moss2020-09-251-2/+4
| | | | | | | | | | | | | | Prefetching of dnodes in dbuf_read() can cause significant mutex contention for some workloads and isn't very helpful. This is because we already get 32 dnodes for each block read, and when iterating over a directory we prefetch the dnodes in the directory. Disable this prefetching to prevent the lock contention. Reviewed-by: Brian Behlendorf <[email protected]> Submitted-by: Adam Moss <[email protected]> Submitted-by: Matthew Ahrens <[email protected]> Signed-off-by: Adam Moss <[email protected]> Closes #10877 Closes #10953
* Fix PREEMPTION=y and BLK_CGROUP=y config on arm64Brian Behlendorf2020-09-251-0/+10
| | | | | | | | | | | | | | | With PREEMPTION=y and BLK_CGROUP=y preempt_schedule_notrace() is being used on arm64 which is a GPL-only function and hence the build of the DKMS kernel module fails. Fix that by redefining preempt_schedule_notrace() to preempt_schedule() which should be safe as long as tracing is not used. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Juerg Haefliger <[email protected]> Closes #8545 Closes #9948 Closes #10416 Closes #10973
* FreeBSD: update cache_purgevfs usage after 1300117 version bumpMateusz Guzik2020-09-251-0/+4
| | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Nick Wolff <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #10970
* FreeBSD: Code cleanup in zio_cryptRyan Moeller2020-09-251-145/+76
| | | | | | | | | | | | | | | Address some unused value and control flow issues flagged by Coverity. Unreachable code is pruned and unused values are avoided. Some scattered sections are reordered for coherence. We can assume kmem_alloc(n, KM_SLEEP) doesn't fail, so there is no need to check if it returned NULL. The allocated memory doesn't need to be zeroed, other than the last iovec (the MAC). Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10884
* Prune dead branch reported by CoverityRyan Moeller2020-09-251-5/+1
| | | | | | | | | wkey is NULL at every `goto error;`. dcp is never NULL. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10884
* zfs_log_write: simplify data copying code for WR_COPIED recordsChristian Schwarz2020-09-251-8/+15
| | | | | | | | | | | | | | | | | | lr_write_t records that are WR_COPIED have the record data directly appended to them (see lr_write_t type definition). The data is copied from the debuf using dmu_read_by_dnode. This function was called, only for WR_COPIED records, as part of a short-circuiting if-statement's if-expression. I found this side-effectful call to dmu_read_by_dnode pretty hard to spot. This patch improves readability by moving the call to its own line. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #10956
* FreeBSD: Add support for procfs_listMatthew Macy2020-09-236-36/+172
| | | | | | | | | | The procfs_list interface is required by several kstats. Implement this functionality for FreeBSD to provide access to these kstats. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10890
* FreeBSD: Don't save user FPU context in kernel threadsMatthew Macy2020-09-231-0/+4
| | | | | | Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10899