mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Compare commits
162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| baa5031456 | |||
| cd42e992b5 | |||
| c60df6a801 | |||
| d8fa32a79d | |||
| 88a5ee0706 | |||
| 0465fbecd7 | |||
| a99a37991e | |||
| 2ca1515374 | |||
| bce36e21ca | |||
| 86492e3c96 | |||
| 07f0465742 | |||
| 0f9457d1dd | |||
| 859f906a4b | |||
| 84a9861536 | |||
| 9d64d1bfad | |||
| ce22dc2589 | |||
| 8479a45abe | |||
| 8156099cf2 | |||
| 11ad6124c3 | |||
| 11de432c8b | |||
| 464747ffd3 | |||
| 92a8af0f8b | |||
| 4fa84563b8 | |||
| 6961d4fb57 | |||
| 3a36797ad6 | |||
| ac6500389b | |||
| 1f055436f3 | |||
| 0172ee525b | |||
| 33174af151 | |||
| 6f27c4cadd | |||
| dd5de55eba | |||
| b5835ed137 | |||
| ef08cb26da | |||
| 9ad205ecde | |||
| 14cce09a65 | |||
| 9835255f5d | |||
| 4d2f7f9839 | |||
| 25c4271d2f | |||
| c950c5d369 | |||
| 13ccbbb47a | |||
| ba3c7692cd | |||
| 27cc6df760 | |||
| d06c8de748 | |||
| 2a2e358475 | |||
| bc42d96d66 | |||
| 88686213c3 | |||
| 21f66db674 | |||
| 3ca305f873 | |||
| 96cad4ca4c | |||
| 5668411713 | |||
| 32cd2da551 | |||
| fa2480f5b3 | |||
| ad8c8c1e31 | |||
| f14a62ebbe | |||
| dfdac38afb | |||
| 08da054005 | |||
| bb401c02fc | |||
| da9da6aea6 | |||
| 97f1eb8052 | |||
| 7d8e2a7f73 | |||
| 3ea3649755 | |||
| 0342c4a6b2 | |||
| d7bf0e5259 | |||
| c24a039042 | |||
| f4e2aed42a | |||
| 54ef0fdf60 | |||
| 2eab4f7b39 | |||
| 4c0fbd8d6d | |||
| fa4b1a404e | |||
| 4c484d66b7 | |||
| 41f2a9c81f | |||
| 6724746596 | |||
| 938d1588eb | |||
| 0f1e8ba2f8 | |||
| b474dfad0d | |||
| 9edf6af4ae | |||
| 2566592045 | |||
| 3d4d61988a | |||
| 61f3638a34 | |||
| 706307445e | |||
| ea3f7c12a9 | |||
| 6f323353d2 | |||
| b3b37b84e8 | |||
| 4d17e200dd | |||
| 5972bb856c | |||
| ef3fea63eb | |||
| 71216b91d2 | |||
| 284489893b | |||
| 6581b17842 | |||
| 51d3c23150 | |||
| 16c223eec9 | |||
| 7aaf6ce9d8 | |||
| 3f817debb4 | |||
| 97889c037a | |||
| 86b39b41a0 | |||
| 531572b590 | |||
| 74101f7e2a | |||
| c1c26a77ff | |||
| db65272aef | |||
| da88fc4ac9 | |||
| 889152ce4a | |||
| 5d859a2e22 | |||
| e0cfa1592d | |||
| d088fb7d24 | |||
| 67995229a8 | |||
| 2ff09e8fed | |||
| 9f1d3db730 | |||
| 5dda8c0910 | |||
| d6da6cbd74 | |||
| 6732e223bf | |||
| baaac31655 | |||
| b0b0d07b13 | |||
| 8a56047135 | |||
| 9a7ef02f4d | |||
| 3bd7cd06b7 | |||
| b9c3040b10 | |||
| 5dbed50429 | |||
| 3fb0942cc5 | |||
| fa2cbd4007 | |||
| bb9542a2a0 | |||
| 72e4996a54 | |||
| 575872cc37 | |||
| f4ce02ae42 | |||
| 97d7228f42 | |||
| 026fe79646 | |||
| 602b5dca7b | |||
| d5fb6abd36 | |||
| 39993c3dfe | |||
| e3c1c9153f | |||
| 2ea370a4e3 | |||
| 3e91a9c525 | |||
| c94f730078 | |||
| 457e62d7ca | |||
| 19bf54b764 | |||
| fdd8c0aea1 | |||
| dced953b62 | |||
| f7c1db6366 | |||
| fa5de0c5cd | |||
| 793a2cff2a | |||
| fdd97e0093 | |||
| 3b8817db96 | |||
| 25ea8ce94b | |||
| 8b1a132de7 | |||
| 7ea8331009 | |||
| 3c5f354a8c | |||
| 5c0fe099ec | |||
| 5fc134ff2f | |||
| 7ad2616d37 | |||
| d0d9dccc61 | |||
| 28520cad25 | |||
| deb7a84231 | |||
| eebf00bee9 | |||
| d0b3be763f | |||
| cb599d27ed | |||
| af3a5bb40d | |||
| 51c2bd0def | |||
| 03ff875e09 | |||
| 13b5348848 | |||
| 4820185031 | |||
| 52a2af6fd1 | |||
| 220bb7341e | |||
| 58211157bf |
@@ -30,6 +30,7 @@ Andreas Dilger <adilger@dilger.ca>
|
||||
Andrew Walker <awalker@ixsystems.com>
|
||||
Benedikt Neuffer <github@itfriend.de>
|
||||
Chengfei Zhu <chengfeix.zhu@intel.com>
|
||||
ChenHao Lu <18302010006@fudan.edu.cn>
|
||||
Chris Lindee <chris.lindee+github@gmail.com>
|
||||
Colm Buckley <colm@tuatha.org>
|
||||
Crag Wang <crag0715@gmail.com>
|
||||
@@ -43,6 +44,7 @@ Glenn Washburn <development@efficientek.com>
|
||||
Gordan Bobic <gordan.bobic@gmail.com>
|
||||
Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
|
||||
hedong zhang <h_d_zhang@163.com>
|
||||
Ilkka Sovanto <github@ilkka.kapsi.fi>
|
||||
InsanePrawn <Insane.Prawny@gmail.com>
|
||||
Jason Cohen <jwittlincohen@gmail.com>
|
||||
Jason Harmening <jason.harmening@gmail.com>
|
||||
@@ -57,6 +59,7 @@ KernelOfTruth <kerneloftruth@gmail.com>
|
||||
Liu Hua <liu.hua130@zte.com.cn>
|
||||
Liu Qing <winglq@gmail.com>
|
||||
loli10K <ezomori.nozomu@gmail.com>
|
||||
Mart Frauenlob <allkind@fastest.cc>
|
||||
Matthias Blankertz <matthias@blankertz.org>
|
||||
Michael Gmelin <grembo@FreeBSD.org>
|
||||
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
||||
@@ -73,6 +76,12 @@ WHR <msl0000023508@gmail.com>
|
||||
Yanping Gao <yanping.gao@xtaotech.com>
|
||||
Youzhong Yang <youzhong@gmail.com>
|
||||
|
||||
# Signed-off-by: overriding Author:
|
||||
Ryan <errornointernet@envs.net> <error.nointernet@gmail.com>
|
||||
Qiuhao Chen <chenqiuhao1997@gmail.com> <haohao0924@126.com>
|
||||
Yuxin Wang <yuxinwang9999@gmail.com> <Bi11gates9999@gmail.com>
|
||||
Zhenlei Huang <zlei@FreeBSD.org> <zlei.huang@gmail.com>
|
||||
|
||||
# Commits from strange places, long ago
|
||||
Brian Behlendorf <behlendorf1@llnl.gov> <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
|
||||
Brian Behlendorf <behlendorf1@llnl.gov> <behlendo@fedora-17-amd64.(none)>
|
||||
@@ -89,6 +98,7 @@ Alek Pinchuk <apinchuk@axcient.com> <alek-p@users.noreply.github.com>
|
||||
Alexander Lobakin <alobakin@pm.me> <solbjorn@users.noreply.github.com>
|
||||
Alexey Smirnoff <fling@member.fsf.org> <fling-@users.noreply.github.com>
|
||||
Allen Holl <allen.m.holl@gmail.com> <65494904+allen-4@users.noreply.github.com>
|
||||
Alphan Yılmaz <alphanyilmaz@gmail.com> <a1ea321@users.noreply.github.com>
|
||||
Ameer Hamza <ahamza@ixsystems.com> <106930537+ixhamza@users.noreply.github.com>
|
||||
Andrew J. Hesford <ajh@sideband.org> <48421688+ahesford@users.noreply.github.com>>
|
||||
Andrew Sun <me@andrewsun.com> <as-com@users.noreply.github.com>
|
||||
@@ -96,18 +106,22 @@ Aron Xu <happyaron.xu@gmail.com> <happyaron@users.noreply.github.com>
|
||||
Arun KV <arun.kv@datacore.com> <65647132+arun-kv@users.noreply.github.com>
|
||||
Ben Wolsieffer <benwolsieffer@gmail.com> <lopsided98@users.noreply.github.com>
|
||||
bernie1995 <bernie.pikes@gmail.com> <42413912+bernie1995@users.noreply.github.com>
|
||||
Bojan Novković <bnovkov@FreeBSD.org> <72801811+bnovkov@users.noreply.github.com>
|
||||
Boris Protopopov <boris.protopopov@actifio.com> <bprotopopov@users.noreply.github.com>
|
||||
Brad Forschinger <github@bnjf.id.au> <bnjf@users.noreply.github.com>
|
||||
Brandon Thetford <brandon@dodecatec.com> <dodexahedron@users.noreply.github.com>
|
||||
buzzingwires <buzzingwires@outlook.com> <131118055+buzzingwires@users.noreply.github.com>
|
||||
Cedric Maunoury <cedric.maunoury@gmail.com> <38213715+cedricmaunoury@users.noreply.github.com>
|
||||
Charles Suh <charles.suh@gmail.com> <charlessuh@users.noreply.github.com>
|
||||
Chris Peredun <chris.peredun@ixsystems.com> <126915832+chrisperedun@users.noreply.github.com>
|
||||
Dacian Reece-Stremtan <dacianstremtan@gmail.com> <35844628+dacianstremtan@users.noreply.github.com>
|
||||
Damian Szuberski <szuberskidamian@gmail.com> <30863496+szubersk@users.noreply.github.com>
|
||||
Daniel Hiepler <d-git@coderdu.de> <32984777+heeplr@users.noreply.github.com>
|
||||
Daniel Kobras <d.kobras@science-computing.de> <sckobras@users.noreply.github.com>
|
||||
Daniel Reichelt <hacking@nachtgeist.net> <nachtgeist@users.noreply.github.com>
|
||||
David Quigley <david.quigley@intel.com> <dpquigl@users.noreply.github.com>
|
||||
Dennis R. Friedrichsen <dennis.r.friedrichsen@gmail.com> <31087738+dennisfriedrichsen@users.noreply.github.com>
|
||||
Dex Wood <slash2314@gmail.com> <slash2314@users.noreply.github.com>
|
||||
DHE <git@dehacked.net> <DeHackEd@users.noreply.github.com>
|
||||
Dmitri John Ledkov <dimitri.ledkov@canonical.com> <19779+xnox@users.noreply.github.com>
|
||||
Dries Michiels <driesm.michiels@gmail.com> <32487486+driesmp@users.noreply.github.com>
|
||||
@@ -128,6 +142,7 @@ Harry Mallon <hjmallon@gmail.com> <1816667+hjmallon@users.noreply.github.com>
|
||||
Hiếu Lê <leorize+oss@disroot.org> <alaviss@users.noreply.github.com>
|
||||
Jake Howard <git@theorangeone.net> <RealOrangeOne@users.noreply.github.com>
|
||||
James Cowgill <james.cowgill@mips.com> <jcowgill@users.noreply.github.com>
|
||||
Jaron Kent-Dobias <jaron@kent-dobias.com> <kentdobias@users.noreply.github.com>
|
||||
Jason King <jason.king@joyent.com> <jasonbking@users.noreply.github.com>
|
||||
Jeff Dike <jdike@akamai.com> <52420226+jdike@users.noreply.github.com>
|
||||
Jitendra Patidar <jitendra.patidar@nutanix.com> <53164267+jsai20@users.noreply.github.com>
|
||||
@@ -137,7 +152,9 @@ John L. Hammond <john.hammond@intel.com> <35266395+jhammond-intel@users.noreply.
|
||||
John-Mark Gurney <jmg@funkthat.com> <jmgurney@users.noreply.github.com>
|
||||
John Ramsden <johnramsden@riseup.net> <johnramsden@users.noreply.github.com>
|
||||
Jonathon Fernyhough <jonathon@m2x.dev> <559369+jonathonf@users.noreply.github.com>
|
||||
Jose Luis Duran <jlduran@gmail.com> <jlduran@users.noreply.github.com>
|
||||
Justin Hibbits <chmeeedalf@gmail.com> <chmeeedalf@users.noreply.github.com>
|
||||
Kevin Greene <kevin.greene@delphix.com> <104801862+kxgreene@users.noreply.github.com>
|
||||
Kevin Jin <lostking2008@hotmail.com> <33590050+jxdking@users.noreply.github.com>
|
||||
Kevin P. Fleming <kevin@km6g.us> <kpfleming@users.noreply.github.com>
|
||||
Krzysztof Piecuch <piecuch@kpiecuch.pl> <3964215+pikrzysztof@users.noreply.github.com>
|
||||
@@ -148,9 +165,11 @@ Lorenz Hüdepohl <dev@stellardeath.org> <lhuedepohl@users.noreply.github.com>
|
||||
Luís Henriques <henrix@camandro.org> <73643340+lumigch@users.noreply.github.com>
|
||||
Marcin Skarbek <git@skarbek.name> <mskarbek@users.noreply.github.com>
|
||||
Matt Fiddaman <github@m.fiddaman.uk> <81489167+matt-fidd@users.noreply.github.com>
|
||||
Maxim Filimonov <che@bein.link> <part1zano@users.noreply.github.com>
|
||||
Max Zettlmeißl <max@zettlmeissl.de> <6818198+maxz@users.noreply.github.com>
|
||||
Michael Niewöhner <foss@mniewoehner.de> <c0d3z3r0@users.noreply.github.com>
|
||||
Michael Zhivich <mzhivich@akamai.com> <33133421+mzhivich@users.noreply.github.com>
|
||||
MigeljanImeri <ImeriMigel@gmail.com> <78048439+MigeljanImeri@users.noreply.github.com>
|
||||
Mo Zhou <cdluminate@gmail.com> <5723047+cdluminate@users.noreply.github.com>
|
||||
Nick Mattis <nickm970@gmail.com> <nmattis@users.noreply.github.com>
|
||||
omni <omni+vagant@hack.org> <79493359+omnivagant@users.noreply.github.com>
|
||||
@@ -164,6 +183,7 @@ Ping Huang <huangping@smartx.com> <101400146+hpingfs@users.noreply.github.com>
|
||||
Piotr P. Stefaniak <pstef@freebsd.org> <pstef@users.noreply.github.com>
|
||||
Richard Allen <belperite@gmail.com> <33836503+belperite@users.noreply.github.com>
|
||||
Rich Ercolani <rincebrain@gmail.com> <214141+rincebrain@users.noreply.github.com>
|
||||
Rick Macklem <rmacklem@uoguelph.ca> <64620010+rmacklem@users.noreply.github.com>
|
||||
Rob Wing <rob.wing@klarasystems.com> <98866084+rob-wing@users.noreply.github.com>
|
||||
Roman Strashkin <roman.strashkin@nexenta.com> <Ramzec@users.noreply.github.com>
|
||||
Ryan Hirasaki <ryanhirasaki@gmail.com> <4690732+RyanHir@users.noreply.github.com>
|
||||
@@ -174,13 +194,17 @@ Scott Colby <scott@scolby.com> <scolby33@users.noreply.github.com>
|
||||
Sean Eric Fagan <kithrup@mac.com> <kithrup@users.noreply.github.com>
|
||||
Spencer Kinny <spencerkinny1995@gmail.com> <30333052+Spencer-Kinny@users.noreply.github.com>
|
||||
Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com> <75025422+nssrikanth@users.noreply.github.com>
|
||||
Stefan Lendl <s.lendl@proxmox.com> <1321542+stfl@users.noreply.github.com>
|
||||
Thomas Bertschinger <bertschinger@lanl.gov> <101425190+bertschinger@users.noreply.github.com>
|
||||
Thomas Geppert <geppi@digitx.de> <geppi@users.noreply.github.com>
|
||||
Tim Crawford <tcrawford@datto.com> <crawfxrd@users.noreply.github.com>
|
||||
Todd Seidelmann <18294602+seidelma@users.noreply.github.com>
|
||||
Tom Matthews <tom@axiom-partners.com> <tomtastic@users.noreply.github.com>
|
||||
Tony Perkins <tperkins@datto.com> <62951051+tony-zfs@users.noreply.github.com>
|
||||
Torsten Wörtwein <twoertwein@gmail.com> <twoertwein@users.noreply.github.com>
|
||||
Tulsi Jain <tulsi.jain@delphix.com> <TulsiJain@users.noreply.github.com>
|
||||
Václav Skála <skala@vshosting.cz> <33496485+vaclavskala@users.noreply.github.com>
|
||||
Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com> <88050553+vaibhav-delphix@users.noreply.github.com>
|
||||
Violet Purcell <vimproved@inventati.org> <66446404+vimproved@users.noreply.github.com>
|
||||
Vipin Kumar Verma <vipin.verma@hpe.com> <75025470+vermavipinkumar@users.noreply.github.com>
|
||||
Wolfgang Bumiller <w.bumiller@proxmox.com> <Blub@users.noreply.github.com>
|
||||
|
||||
@@ -46,6 +46,7 @@ CONTRIBUTORS:
|
||||
Alex Zhuravlev <alexey.zhuravlev@intel.com>
|
||||
Allan Jude <allanjude@freebsd.org>
|
||||
Allen Holl <allen.m.holl@gmail.com>
|
||||
Alphan Yılmaz <alphanyilmaz@gmail.com>
|
||||
alteriks <alteriks@gmail.com>
|
||||
Alyssa Ross <hi@alyssa.is>
|
||||
Ameer Hamza <ahamza@ixsystems.com>
|
||||
@@ -88,15 +89,18 @@ CONTRIBUTORS:
|
||||
Bassu <bassu@phi9.com>
|
||||
Ben Allen <bsallen@alcf.anl.gov>
|
||||
Ben Cordero <bencord0@condi.me>
|
||||
Benda Xu <orv@debian.org>
|
||||
Benedikt Neuffer <github@itfriend.de>
|
||||
Benjamin Albrecht <git@albrecht.io>
|
||||
Benjamin Gentil <benjgentil.pro@gmail.com>
|
||||
Benjamin Sherman <benjamin@holyarmy.org>
|
||||
Ben McGough <bmcgough@fredhutch.org>
|
||||
Ben Rubson <ben.rubson@gmail.com>
|
||||
Ben Wolsieffer <benwolsieffer@gmail.com>
|
||||
bernie1995 <bernie.pikes@gmail.com>
|
||||
Bill McGonigle <bill-github.com-public1@bfccomputing.com>
|
||||
Bill Pijewski <wdp@joyent.com>
|
||||
Bojan Novković <bnovkov@FreeBSD.org>
|
||||
Boris Protopopov <boris.protopopov@nexenta.com>
|
||||
Brad Forschinger <github@bnjf.id.au>
|
||||
Brad Lewis <brad.lewis@delphix.com>
|
||||
@@ -111,6 +115,7 @@ CONTRIBUTORS:
|
||||
bzzz77 <bzzz.tomas@gmail.com>
|
||||
cable2999 <cable2999@users.noreply.github.com>
|
||||
Caleb James DeLisle <calebdelisle@lavabit.com>
|
||||
Cameron Harr <harr1@llnl.gov>
|
||||
Cao Xuewen <cao.xuewen@zte.com.cn>
|
||||
Carlo Landmeter <clandmeter@gmail.com>
|
||||
Carlos Alberto Lopez Perez <clopez@igalia.com>
|
||||
@@ -120,12 +125,15 @@ CONTRIBUTORS:
|
||||
Chen Can <chen.can2@zte.com.cn>
|
||||
Chengfei Zhu <chengfeix.zhu@intel.com>
|
||||
Chen Haiquan <oc@yunify.com>
|
||||
ChenHao Lu <18302010006@fudan.edu.cn>
|
||||
Chip Parker <aparker@enthought.com>
|
||||
Chris Burroughs <chris.burroughs@gmail.com>
|
||||
Chris Davidson <christopher.davidson@gmail.com>
|
||||
Chris Dunlap <cdunlap@llnl.gov>
|
||||
Chris Dunlop <chris@onthe.net.au>
|
||||
Chris Lindee <chris.lindee+github@gmail.com>
|
||||
Chris McDonough <chrism@plope.com>
|
||||
Chris Peredun <chris.peredun@ixsystems.com>
|
||||
Chris Siden <chris.siden@delphix.com>
|
||||
Chris Siebenmann <cks.github@cs.toronto.edu>
|
||||
Christer Ekholm <che@chrekh.se>
|
||||
@@ -144,6 +152,7 @@ CONTRIBUTORS:
|
||||
Clint Armstrong <clint@clintarmstrong.net>
|
||||
Coleman Kane <ckane@colemankane.org>
|
||||
Colin Ian King <colin.king@canonical.com>
|
||||
Colin Percival <cperciva@tarsnap.com>
|
||||
Colm Buckley <colm@tuatha.org>
|
||||
Crag Wang <crag0715@gmail.com>
|
||||
Craig Loomis <cloomis@astro.princeton.edu>
|
||||
@@ -156,10 +165,12 @@ CONTRIBUTORS:
|
||||
Damiano Albani <damiano.albani@gmail.com>
|
||||
Damian Szuberski <szuberskidamian@gmail.com>
|
||||
Damian Wojsław <damian@wojslaw.pl>
|
||||
Daniel Berlin <dberlin@dberlin.org>
|
||||
Daniel Hiepler <d-git@coderdu.de>
|
||||
Daniel Hoffman <dj.hoffman@delphix.com>
|
||||
Daniel Kobras <d.kobras@science-computing.de>
|
||||
Daniel Kolesa <daniel@octaforge.org>
|
||||
Daniel Perry <dtperry@amazon.com>
|
||||
Daniel Reichelt <hacking@nachtgeist.net>
|
||||
Daniel Stevenson <bot@dstev.net>
|
||||
Daniel Verite <daniel@verite.pro>
|
||||
@@ -176,8 +187,11 @@ CONTRIBUTORS:
|
||||
David Quigley <david.quigley@intel.com>
|
||||
Debabrata Banerjee <dbanerje@akamai.com>
|
||||
D. Ebdrup <debdrup@freebsd.org>
|
||||
Dennis R. Friedrichsen <dennis.r.friedrichsen@gmail.com>
|
||||
Denys Rtveliashvili <denys@rtveliashvili.name>
|
||||
Derek Dai <daiderek@gmail.com>
|
||||
Derek Schrock <dereks@lifeofadishwasher.com>
|
||||
Dex Wood <slash2314@gmail.com>
|
||||
DHE <git@dehacked.net>
|
||||
Didier Roche <didrocks@ubuntu.com>
|
||||
Dimitri John Ledkov <xnox@ubuntu.com>
|
||||
@@ -235,9 +249,12 @@ CONTRIBUTORS:
|
||||
Gionatan Danti <g.danti@assyoma.it>
|
||||
Giuseppe Di Natale <guss80@gmail.com>
|
||||
Glenn Washburn <development@efficientek.com>
|
||||
glibg10b <glibg10b@users.noreply.github.com>
|
||||
gofaster <felix.gofaster@gmail.com>
|
||||
Gordan Bobic <gordan@redsleeve.org>
|
||||
Gordon Bergling <gbergling@googlemail.com>
|
||||
Gordon Ross <gwr@nexenta.com>
|
||||
Gordon Tetlow <gordon@freebsd.org>
|
||||
Graham Christensen <graham@grahamc.com>
|
||||
Graham Perrin <grahamperrin@gmail.com>
|
||||
Gregor Kopka <gregor@kopka.net>
|
||||
@@ -265,6 +282,7 @@ CONTRIBUTORS:
|
||||
Igor Kozhukhov <ikozhukhov@gmail.com>
|
||||
Igor Lvovsky <ilvovsky@gmail.com>
|
||||
ilbsmart <wgqimut@gmail.com>
|
||||
Ilkka Sovanto <github@ilkka.kapsi.fi>
|
||||
illiliti <illiliti@protonmail.com>
|
||||
ilovezfs <ilovezfs@icloud.com>
|
||||
InsanePrawn <Insane.Prawny@gmail.com>
|
||||
@@ -280,9 +298,11 @@ CONTRIBUTORS:
|
||||
Jan Engelhardt <jengelh@inai.de>
|
||||
Jan Kryl <jan.kryl@nexenta.com>
|
||||
Jan Sanislo <oystr@cs.washington.edu>
|
||||
Jaron Kent-Dobias <jaron@kent-dobias.com>
|
||||
Jason Cohen <jwittlincohen@gmail.com>
|
||||
Jason Harmening <jason.harmening@gmail.com>
|
||||
Jason King <jason.brian.king@gmail.com>
|
||||
Jason Lee <jasonlee@lanl.gov>
|
||||
Jason Zaman <jasonzaman@gmail.com>
|
||||
Javen Wu <wu.javen@gmail.com>
|
||||
Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
|
||||
@@ -313,6 +333,7 @@ CONTRIBUTORS:
|
||||
Jonathon Fernyhough <jonathon@m2x.dev>
|
||||
Jorgen Lundman <lundman@lundman.net>
|
||||
Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
|
||||
Jose Luis Duran <jlduran@gmail.com>
|
||||
Josh Soref <jsoref@users.noreply.github.com>
|
||||
Joshua M. Clulow <josh@sysmgr.org>
|
||||
José Luis Salvador Rufo <salvador.joseluis@gmail.com>
|
||||
@@ -336,8 +357,10 @@ CONTRIBUTORS:
|
||||
Kash Pande <kash@tripleback.net>
|
||||
Kay Pedersen <christianpe96@gmail.com>
|
||||
Keith M Wesolowski <wesolows@foobazco.org>
|
||||
Kent Ross <k@mad.cash>
|
||||
KernelOfTruth <kerneloftruth@gmail.com>
|
||||
Kevin Bowling <kevin.bowling@kev009.com>
|
||||
Kevin Greene <kevin.greene@delphix.com>
|
||||
Kevin Jin <lostking2008@hotmail.com>
|
||||
Kevin P. Fleming <kevin@km6g.us>
|
||||
Kevin Tanguy <kevin.tanguy@ovh.net>
|
||||
@@ -389,8 +412,10 @@ CONTRIBUTORS:
|
||||
Mark Shellenbaum <Mark.Shellenbaum@Oracle.COM>
|
||||
marku89 <mar42@kola.li>
|
||||
Mark Wright <markwright@internode.on.net>
|
||||
Mart Frauenlob <allkind@fastest.cc>
|
||||
Martin Matuska <mm@FreeBSD.org>
|
||||
Martin Rüegg <martin.rueegg@metaworx.ch>
|
||||
Martin Wagner <martin.wagner.dev@gmail.com>
|
||||
Massimo Maggi <me@massimo-maggi.eu>
|
||||
Mateusz Guzik <mjguzik@gmail.com>
|
||||
Mateusz Piotrowski <0mp@FreeBSD.org>
|
||||
@@ -405,6 +430,7 @@ CONTRIBUTORS:
|
||||
Matus Kral <matuskral@me.com>
|
||||
Mauricio Faria de Oliveira <mfo@canonical.com>
|
||||
Max Grossman <max.grossman@delphix.com>
|
||||
Maxim Filimonov <che@bein.link>
|
||||
Maximilian Mehnert <maximilian.mehnert@gmx.de>
|
||||
Max Zettlmeißl <max@zettlmeissl.de>
|
||||
Md Islam <mdnahian@outlook.com>
|
||||
@@ -417,6 +443,7 @@ CONTRIBUTORS:
|
||||
Michael Niewöhner <foss@mniewoehner.de>
|
||||
Michael Zhivich <mzhivich@akamai.com>
|
||||
Michal Vasilek <michal@vasilek.cz>
|
||||
MigeljanImeri <ImeriMigel@gmail.com>
|
||||
Mike Gerdts <mike.gerdts@joyent.com>
|
||||
Mike Harsch <mike@harschsystems.com>
|
||||
Mike Leddy <mike.leddy@gmail.com>
|
||||
@@ -448,6 +475,7 @@ CONTRIBUTORS:
|
||||
Olaf Faaland <faaland1@llnl.gov>
|
||||
Oleg Drokin <green@linuxhacker.ru>
|
||||
Oleg Stepura <oleg@stepura.com>
|
||||
Olivier Certner <olce.freebsd@certner.fr>
|
||||
Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
|
||||
omni <omni+vagant@hack.org>
|
||||
Orivej Desh <orivej@gmx.fr>
|
||||
@@ -466,6 +494,7 @@ CONTRIBUTORS:
|
||||
Peng <peng.hse@xtaotech.com>
|
||||
Peter Ashford <ashford@accs.com>
|
||||
Peter Dave Hello <hsu@peterdavehello.org>
|
||||
Peter Doherty <peterd@acranox.org>
|
||||
Peter Levine <plevine457@gmail.com>
|
||||
Peter Wirdemo <peter.wirdemo@gmail.com>
|
||||
Petros Koutoupis <petros@petroskoutoupis.com>
|
||||
@@ -479,6 +508,8 @@ CONTRIBUTORS:
|
||||
Prasad Joshi <prasadjoshi124@gmail.com>
|
||||
privb0x23 <privb0x23@users.noreply.github.com>
|
||||
P.SCH <p88@yahoo.com>
|
||||
Qiuhao Chen <chenqiuhao1997@gmail.com>
|
||||
Quartz <yyhran@163.com>
|
||||
Quentin Zdanis <zdanisq@gmail.com>
|
||||
Rafael Kitover <rkitover@gmail.com>
|
||||
RageLtMan <sempervictus@users.noreply.github.com>
|
||||
@@ -491,11 +522,15 @@ CONTRIBUTORS:
|
||||
Riccardo Schirone <rschirone91@gmail.com>
|
||||
Richard Allen <belperite@gmail.com>
|
||||
Richard Elling <Richard.Elling@RichardElling.com>
|
||||
Richard Kojedzinszky <richard@kojedz.in>
|
||||
Richard Laager <rlaager@wiktel.com>
|
||||
Richard Lowe <richlowe@richlowe.net>
|
||||
Richard Sharpe <rsharpe@samba.org>
|
||||
Richard Yao <ryao@gentoo.org>
|
||||
Rich Ercolani <rincebrain@gmail.com>
|
||||
Rick Macklem <rmacklem@uoguelph.ca>
|
||||
rilysh <nightquick@proton.me>
|
||||
Robert Evans <evansr@google.com>
|
||||
Robert Novak <sailnfool@gmail.com>
|
||||
Roberto Ricci <ricci@disroot.org>
|
||||
Rob Norris <robn@despairlabs.com>
|
||||
@@ -505,11 +540,14 @@ CONTRIBUTORS:
|
||||
Roman Strashkin <roman.strashkin@nexenta.com>
|
||||
Ross Williams <ross@ross-williams.net>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Ryan <errornointernet@envs.net>
|
||||
Ryan Hirasaki <ryanhirasaki@gmail.com>
|
||||
Ryan Lahfa <masterancpp@gmail.com>
|
||||
Ryan Libby <rlibby@FreeBSD.org>
|
||||
Ryan Moeller <freqlabs@FreeBSD.org>
|
||||
Sam Atkinson <samatk@amazon.com>
|
||||
Sam Hathaway <github.com@munkynet.org>
|
||||
Sam James <sam@gentoo.org>
|
||||
Sam Lunt <samuel.j.lunt@gmail.com>
|
||||
Samuel VERSCHELDE <stormi-github@ylix.fr>
|
||||
Samuel Wycliffe <samuelwycliffe@gmail.com>
|
||||
@@ -527,9 +565,12 @@ CONTRIBUTORS:
|
||||
Sen Haerens <sen@senhaerens.be>
|
||||
Serapheim Dimitropoulos <serapheim@delphix.com>
|
||||
Seth Forshee <seth.forshee@canonical.com>
|
||||
Seth Troisi <sethtroisi@google.com>
|
||||
Shaan Nobee <sniper111@gmail.com>
|
||||
Shampavman <sham.pavman@nexenta.com>
|
||||
Shaun Tancheff <shaun@aeonazure.com>
|
||||
Shawn Bayern <sbayern@law.fsu.edu>
|
||||
Shengqi Chen <harry-chen@outlook.com>
|
||||
Shen Yan <shenyanxxxy@qq.com>
|
||||
Simon Guest <simon.guest@tesujimath.org>
|
||||
Simon Klinkert <simon.klinkert@gmail.com>
|
||||
@@ -537,6 +578,7 @@ CONTRIBUTORS:
|
||||
Spencer Kinny <spencerkinny1995@gmail.com>
|
||||
Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com>
|
||||
Stanislav Seletskiy <s.seletskiy@gmail.com>
|
||||
Stefan Lendl <s.lendl@proxmox.com>
|
||||
Steffen Müthing <steffen.muething@iwr.uni-heidelberg.de>
|
||||
Stephen Blinick <stephen.blinick@delphix.com>
|
||||
sterlingjensen <sterlingjensen@users.noreply.github.com>
|
||||
@@ -557,6 +599,7 @@ CONTRIBUTORS:
|
||||
Teodor Spæren <teodor_spaeren@riseup.net>
|
||||
TerraTech <TerraTech@users.noreply.github.com>
|
||||
Thijs Cramer <thijs.cramer@gmail.com>
|
||||
Thomas Bertschinger <bertschinger@lanl.gov>
|
||||
Thomas Geppert <geppi@digitx.de>
|
||||
Thomas Lamprecht <guggentom@hotmail.de>
|
||||
Till Maas <opensource@till.name>
|
||||
@@ -569,6 +612,7 @@ CONTRIBUTORS:
|
||||
Tim Schumacher <timschumi@gmx.de>
|
||||
Tino Reichardt <milky-zfs@mcmilk.de>
|
||||
Tobin Harding <me@tobin.cc>
|
||||
Todd Seidelmann <seidelma@users.noreply.github.com>
|
||||
Tom Caputi <tcaputi@datto.com>
|
||||
Tom Matthews <tom@axiom-partners.com>
|
||||
Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
|
||||
@@ -586,6 +630,7 @@ CONTRIBUTORS:
|
||||
Turbo Fredriksson <turbo@bayour.com>
|
||||
Tyler J. Stachecki <stachecki.tyler@gmail.com>
|
||||
Umer Saleem <usaleem@ixsystems.com>
|
||||
Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
|
||||
Valmiky Arquissandas <kayvlim@gmail.com>
|
||||
Val Packett <val@packett.cool>
|
||||
Vince van Oosten <techhazard@codeforyouand.me>
|
||||
@@ -614,10 +659,13 @@ CONTRIBUTORS:
|
||||
yuina822 <ayuichi@club.kyutech.ac.jp>
|
||||
YunQiang Su <syq@debian.org>
|
||||
Yuri Pankov <yuri.pankov@gmail.com>
|
||||
Yuxin Wang <yuxinwang9999@gmail.com>
|
||||
Yuxuan Shui <yshuiv7@gmail.com>
|
||||
Zachary Bedell <zac@thebedells.org>
|
||||
Zach Dykstra <dykstra.zachary@gmail.com>
|
||||
zgock <zgock@nuc.base.zgock-lab.net>
|
||||
Zhao Yongming <zym@apache.org>
|
||||
Zhenlei Huang <zlei@FreeBSD.org>
|
||||
Zhu Chuang <chuang@melty.land>
|
||||
Érico Nogueira <erico.erc@gmail.com>
|
||||
Đoàn Trần Công Danh <congdanhqx@gmail.com>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Meta: 1
|
||||
Name: zfs
|
||||
Branch: 1.0
|
||||
Version: 2.2.3
|
||||
Version: 2.2.6
|
||||
Release: 1
|
||||
Release-Tags: relext
|
||||
License: CDDL
|
||||
Author: OpenZFS
|
||||
Linux-Maximum: 6.7
|
||||
Linux-Maximum: 6.10
|
||||
Linux-Minimum: 3.10
|
||||
|
||||
+10
-1
@@ -793,18 +793,27 @@ def section_dmu(kstats_dict):
|
||||
|
||||
zfetch_stats = isolate_section('zfetchstats', kstats_dict)
|
||||
|
||||
zfetch_access_total = int(zfetch_stats['hits'])+int(zfetch_stats['misses'])
|
||||
zfetch_access_total = int(zfetch_stats['hits']) +\
|
||||
int(zfetch_stats['future']) + int(zfetch_stats['stride']) +\
|
||||
int(zfetch_stats['past']) + int(zfetch_stats['misses'])
|
||||
|
||||
prt_1('DMU predictive prefetcher calls:', f_hits(zfetch_access_total))
|
||||
prt_i2('Stream hits:',
|
||||
f_perc(zfetch_stats['hits'], zfetch_access_total),
|
||||
f_hits(zfetch_stats['hits']))
|
||||
future = int(zfetch_stats['future']) + int(zfetch_stats['stride'])
|
||||
prt_i2('Hits ahead of stream:', f_perc(future, zfetch_access_total),
|
||||
f_hits(future))
|
||||
prt_i2('Hits behind stream:',
|
||||
f_perc(zfetch_stats['past'], zfetch_access_total),
|
||||
f_hits(zfetch_stats['past']))
|
||||
prt_i2('Stream misses:',
|
||||
f_perc(zfetch_stats['misses'], zfetch_access_total),
|
||||
f_hits(zfetch_stats['misses']))
|
||||
prt_i2('Streams limit reached:',
|
||||
f_perc(zfetch_stats['max_streams'], zfetch_stats['misses']),
|
||||
f_hits(zfetch_stats['max_streams']))
|
||||
prt_i1('Stream strides:', f_hits(zfetch_stats['stride']))
|
||||
prt_i1('Prefetches issued', f_hits(zfetch_stats['io_issued']))
|
||||
print()
|
||||
|
||||
|
||||
+50
-7
@@ -157,6 +157,16 @@ cols = {
|
||||
"free": [5, 1024, "ARC free memory"],
|
||||
"avail": [5, 1024, "ARC available memory"],
|
||||
"waste": [5, 1024, "Wasted memory due to round up to pagesize"],
|
||||
"ztotal": [6, 1000, "zfetch total prefetcher calls per second"],
|
||||
"zhits": [5, 1000, "zfetch stream hits per second"],
|
||||
"zahead": [6, 1000, "zfetch hits ahead of streams per second"],
|
||||
"zpast": [5, 1000, "zfetch hits behind streams per second"],
|
||||
"zmisses": [7, 1000, "zfetch stream misses per second"],
|
||||
"zmax": [4, 1000, "zfetch limit reached per second"],
|
||||
"zfuture": [7, 1000, "zfetch stream future per second"],
|
||||
"zstride": [7, 1000, "zfetch stream strides per second"],
|
||||
"zissued": [7, 1000, "zfetch prefetches issued per second"],
|
||||
"zactive": [7, 1000, "zfetch prefetches active per second"],
|
||||
}
|
||||
|
||||
v = {}
|
||||
@@ -164,6 +174,8 @@ hdr = ["time", "read", "ddread", "ddh%", "dmread", "dmh%", "pread", "ph%",
|
||||
"size", "c", "avail"]
|
||||
xhdr = ["time", "mfu", "mru", "mfug", "mrug", "unc", "eskip", "mtxmis",
|
||||
"dread", "pread", "read"]
|
||||
zhdr = ["time", "ztotal", "zhits", "zahead", "zpast", "zmisses", "zmax",
|
||||
"zfuture", "zstride", "zissued", "zactive"]
|
||||
sint = 1 # Default interval is 1 second
|
||||
count = 1 # Default count is 1
|
||||
hdr_intr = 20 # Print header every 20 lines of output
|
||||
@@ -188,6 +200,8 @@ if sys.platform.startswith('freebsd'):
|
||||
|
||||
k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
|
||||
if ctl.type != sysctl.CTLTYPE_NODE]
|
||||
k += [ctl for ctl in sysctl.filter('kstat.zfs.misc.zfetchstats')
|
||||
if ctl.type != sysctl.CTLTYPE_NODE]
|
||||
|
||||
if not k:
|
||||
sys.exit(1)
|
||||
@@ -199,19 +213,28 @@ if sys.platform.startswith('freebsd'):
|
||||
continue
|
||||
|
||||
name, value = s.name, s.value
|
||||
# Trims 'kstat.zfs.misc.arcstats' from the name
|
||||
kstat[name[24:]] = int(value)
|
||||
|
||||
if "arcstats" in name:
|
||||
# Trims 'kstat.zfs.misc.arcstats' from the name
|
||||
kstat[name[24:]] = int(value)
|
||||
else:
|
||||
kstat["zfetch_" + name[27:]] = int(value)
|
||||
|
||||
elif sys.platform.startswith('linux'):
|
||||
def kstat_update():
|
||||
global kstat
|
||||
|
||||
k = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
|
||||
k1 = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
|
||||
|
||||
if not k:
|
||||
k2 = ["zfetch_" + line.strip() for line in
|
||||
open('/proc/spl/kstat/zfs/zfetchstats')]
|
||||
|
||||
if k1 is None or k2 is None:
|
||||
sys.exit(1)
|
||||
|
||||
del k[0:2]
|
||||
del k1[0:2]
|
||||
del k2[0:2]
|
||||
k = k1 + k2
|
||||
kstat = {}
|
||||
|
||||
for s in k:
|
||||
@@ -239,6 +262,7 @@ def usage():
|
||||
sys.stderr.write("\t -v : List all possible field headers and definitions"
|
||||
"\n")
|
||||
sys.stderr.write("\t -x : Print extended stats\n")
|
||||
sys.stderr.write("\t -z : Print zfetch stats\n")
|
||||
sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
|
||||
sys.stderr.write("\t -o : Redirect output to the specified file\n")
|
||||
sys.stderr.write("\t -s : Override default field separator with custom "
|
||||
@@ -357,6 +381,7 @@ def init():
|
||||
global count
|
||||
global hdr
|
||||
global xhdr
|
||||
global zhdr
|
||||
global opfile
|
||||
global sep
|
||||
global out
|
||||
@@ -368,15 +393,17 @@ def init():
|
||||
xflag = False
|
||||
hflag = False
|
||||
vflag = False
|
||||
zflag = False
|
||||
i = 1
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(
|
||||
sys.argv[1:],
|
||||
"axo:hvs:f:p",
|
||||
"axzo:hvs:f:p",
|
||||
[
|
||||
"all",
|
||||
"extended",
|
||||
"zfetch",
|
||||
"outfile",
|
||||
"help",
|
||||
"verbose",
|
||||
@@ -410,13 +437,15 @@ def init():
|
||||
i += 1
|
||||
if opt in ('-p', '--parsable'):
|
||||
pretty_print = False
|
||||
if opt in ('-z', '--zfetch'):
|
||||
zflag = True
|
||||
i += 1
|
||||
|
||||
argv = sys.argv[i:]
|
||||
sint = int(argv[0]) if argv else sint
|
||||
count = int(argv[1]) if len(argv) > 1 else (0 if len(argv) > 0 else 1)
|
||||
|
||||
if hflag or (xflag and desired_cols):
|
||||
if hflag or (xflag and zflag) or ((zflag or xflag) and desired_cols):
|
||||
usage()
|
||||
|
||||
if vflag:
|
||||
@@ -425,6 +454,9 @@ def init():
|
||||
if xflag:
|
||||
hdr = xhdr
|
||||
|
||||
if zflag:
|
||||
hdr = zhdr
|
||||
|
||||
update_hdr_intr()
|
||||
|
||||
# check if L2ARC exists
|
||||
@@ -569,6 +601,17 @@ def calculate():
|
||||
v["el2mru"] = d["evict_l2_eligible_mru"] // sint
|
||||
v["el2inel"] = d["evict_l2_ineligible"] // sint
|
||||
v["mtxmis"] = d["mutex_miss"] // sint
|
||||
v["ztotal"] = (d["zfetch_hits"] + d["zfetch_future"] + d["zfetch_stride"] +
|
||||
d["zfetch_past"] + d["zfetch_misses"]) // sint
|
||||
v["zhits"] = d["zfetch_hits"] // sint
|
||||
v["zahead"] = (d["zfetch_future"] + d["zfetch_stride"]) // sint
|
||||
v["zpast"] = d["zfetch_past"] // sint
|
||||
v["zmisses"] = d["zfetch_misses"] // sint
|
||||
v["zmax"] = d["zfetch_max_streams"] // sint
|
||||
v["zfuture"] = d["zfetch_future"] // sint
|
||||
v["zstride"] = d["zfetch_stride"] // sint
|
||||
v["zissued"] = d["zfetch_io_issued"] // sint
|
||||
v["zactive"] = d["zfetch_io_active"] // sint
|
||||
|
||||
if l2exist:
|
||||
v["l2hits"] = d["l2_hits"] // sint
|
||||
|
||||
+83
-10
@@ -48,6 +48,7 @@
|
||||
#include <sys/spa_impl.h>
|
||||
#include <sys/dmu.h>
|
||||
#include <sys/zap.h>
|
||||
#include <sys/zap_impl.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
#include <sys/zfs_znode.h>
|
||||
#include <sys/zfs_sa.h>
|
||||
@@ -84,6 +85,9 @@
|
||||
#include <sys/brt_impl.h>
|
||||
#include <zfs_comutil.h>
|
||||
#include <sys/zstd/zstd.h>
|
||||
#if (__GLIBC__ && !__UCLIBC__)
|
||||
#include <execinfo.h> /* for backtrace() */
|
||||
#endif
|
||||
|
||||
#include <libnvpair.h>
|
||||
#include <libzutil.h>
|
||||
@@ -926,11 +930,41 @@ usage(void)
|
||||
static void
|
||||
dump_debug_buffer(void)
|
||||
{
|
||||
if (dump_opt['G']) {
|
||||
(void) printf("\n");
|
||||
(void) fflush(stdout);
|
||||
zfs_dbgmsg_print("zdb");
|
||||
}
|
||||
ssize_t ret __attribute__((unused));
|
||||
|
||||
if (!dump_opt['G'])
|
||||
return;
|
||||
/*
|
||||
* We use write() instead of printf() so that this function
|
||||
* is safe to call from a signal handler.
|
||||
*/
|
||||
ret = write(STDOUT_FILENO, "\n", 1);
|
||||
zfs_dbgmsg_print("zdb");
|
||||
}
|
||||
|
||||
#define BACKTRACE_SZ 100
|
||||
|
||||
static void sig_handler(int signo)
|
||||
{
|
||||
struct sigaction action;
|
||||
#if (__GLIBC__ && !__UCLIBC__) /* backtrace() is a GNU extension */
|
||||
int nptrs;
|
||||
void *buffer[BACKTRACE_SZ];
|
||||
|
||||
nptrs = backtrace(buffer, BACKTRACE_SZ);
|
||||
backtrace_symbols_fd(buffer, nptrs, STDERR_FILENO);
|
||||
#endif
|
||||
dump_debug_buffer();
|
||||
|
||||
/*
|
||||
* Restore default action and re-raise signal so SIGSEGV and
|
||||
* SIGABRT can trigger a core dump.
|
||||
*/
|
||||
action.sa_handler = SIG_DFL;
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_flags = 0;
|
||||
(void) sigaction(signo, &action, NULL);
|
||||
raise(signo);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1199,16 +1233,33 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
for (zap_cursor_init(&zc, os, object);
|
||||
zap_cursor_retrieve(&zc, &attr) == 0;
|
||||
zap_cursor_advance(&zc)) {
|
||||
(void) printf("\t\t%s = ", attr.za_name);
|
||||
boolean_t key64 =
|
||||
!!(zap_getflags(zc.zc_zap) & ZAP_FLAG_UINT64_KEY);
|
||||
|
||||
if (key64)
|
||||
(void) printf("\t\t0x%010lx = ",
|
||||
*(uint64_t *)attr.za_name);
|
||||
else
|
||||
(void) printf("\t\t%s = ", attr.za_name);
|
||||
|
||||
if (attr.za_num_integers == 0) {
|
||||
(void) printf("\n");
|
||||
continue;
|
||||
}
|
||||
prop = umem_zalloc(attr.za_num_integers *
|
||||
attr.za_integer_length, UMEM_NOFAIL);
|
||||
(void) zap_lookup(os, object, attr.za_name,
|
||||
attr.za_integer_length, attr.za_num_integers, prop);
|
||||
if (attr.za_integer_length == 1) {
|
||||
|
||||
if (key64)
|
||||
(void) zap_lookup_uint64(os, object,
|
||||
(const uint64_t *)attr.za_name, 1,
|
||||
attr.za_integer_length, attr.za_num_integers,
|
||||
prop);
|
||||
else
|
||||
(void) zap_lookup(os, object, attr.za_name,
|
||||
attr.za_integer_length, attr.za_num_integers,
|
||||
prop);
|
||||
|
||||
if (attr.za_integer_length == 1 && !key64) {
|
||||
if (strcmp(attr.za_name,
|
||||
DSL_CRYPTO_KEY_MASTER_KEY) == 0 ||
|
||||
strcmp(attr.za_name,
|
||||
@@ -1227,6 +1278,10 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
} else {
|
||||
for (i = 0; i < attr.za_num_integers; i++) {
|
||||
switch (attr.za_integer_length) {
|
||||
case 1:
|
||||
(void) printf("%u ",
|
||||
((uint8_t *)prop)[i]);
|
||||
break;
|
||||
case 2:
|
||||
(void) printf("%u ",
|
||||
((uint16_t *)prop)[i]);
|
||||
@@ -5217,7 +5272,7 @@ dump_label(const char *dev)
|
||||
sizeof (cksum_record_t), offsetof(cksum_record_t, link));
|
||||
|
||||
psize = statbuf.st_size;
|
||||
psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
|
||||
psize = P2ALIGN_TYPED(psize, sizeof (vdev_label_t), uint64_t);
|
||||
ashift = SPA_MINBLOCKSHIFT;
|
||||
|
||||
/*
|
||||
@@ -8934,9 +8989,27 @@ main(int argc, char **argv)
|
||||
char *spa_config_path_env, *objset_str;
|
||||
boolean_t target_is_spa = B_TRUE, dataset_lookup = B_FALSE;
|
||||
nvlist_t *cfg = NULL;
|
||||
struct sigaction action;
|
||||
|
||||
dprintf_setup(&argc, argv);
|
||||
|
||||
/*
|
||||
* Set up signal handlers, so if we crash due to bad on-disk data we
|
||||
* can get more info. Unlike ztest, we don't bail out if we can't set
|
||||
* up signal handlers, because zdb is very useful without them.
|
||||
*/
|
||||
action.sa_handler = sig_handler;
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_flags = 0;
|
||||
if (sigaction(SIGSEGV, &action, NULL) < 0) {
|
||||
(void) fprintf(stderr, "zdb: cannot catch SIGSEGV: %s\n",
|
||||
strerror(errno));
|
||||
}
|
||||
if (sigaction(SIGABRT, &action, NULL) < 0) {
|
||||
(void) fprintf(stderr, "zdb: cannot catch SIGABRT: %s\n",
|
||||
strerror(errno));
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is an environment variable SPA_CONFIG_PATH it overrides
|
||||
* default spa_config_path setting. If -U flag is specified it will
|
||||
|
||||
+26
-31
@@ -22,6 +22,7 @@
|
||||
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2016, Intel Corporation.
|
||||
* Copyright (c) 2023, Klara Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -231,28 +232,6 @@ fmd_prop_get_int32(fmd_hdl_t *hdl, const char *name)
|
||||
if (strcmp(name, "spare_on_remove") == 0)
|
||||
return (1);
|
||||
|
||||
if (strcmp(name, "io_N") == 0 || strcmp(name, "checksum_N") == 0)
|
||||
return (10); /* N = 10 events */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int64_t
|
||||
fmd_prop_get_int64(fmd_hdl_t *hdl, const char *name)
|
||||
{
|
||||
(void) hdl;
|
||||
|
||||
/*
|
||||
* These can be looked up in mp->modinfo->fmdi_props
|
||||
* For now we just hard code for phase 2. In the
|
||||
* future, there can be a ZED based override.
|
||||
*/
|
||||
if (strcmp(name, "remove_timeout") == 0)
|
||||
return (15ULL * 1000ULL * 1000ULL * 1000ULL); /* 15 sec */
|
||||
|
||||
if (strcmp(name, "io_T") == 0 || strcmp(name, "checksum_T") == 0)
|
||||
return (1000ULL * 1000ULL * 1000ULL * 600ULL); /* 10 min */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -535,6 +514,19 @@ fmd_serd_exists(fmd_hdl_t *hdl, const char *name)
|
||||
return (fmd_serd_eng_lookup(&mp->mod_serds, name) != NULL);
|
||||
}
|
||||
|
||||
int
|
||||
fmd_serd_active(fmd_hdl_t *hdl, const char *name)
|
||||
{
|
||||
fmd_module_t *mp = (fmd_module_t *)hdl;
|
||||
fmd_serd_eng_t *sgp;
|
||||
|
||||
if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
|
||||
zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name);
|
||||
return (0);
|
||||
}
|
||||
return (fmd_serd_eng_fired(sgp) || !fmd_serd_eng_empty(sgp));
|
||||
}
|
||||
|
||||
void
|
||||
fmd_serd_reset(fmd_hdl_t *hdl, const char *name)
|
||||
{
|
||||
@@ -543,12 +535,10 @@ fmd_serd_reset(fmd_hdl_t *hdl, const char *name)
|
||||
|
||||
if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
|
||||
zed_log_msg(LOG_ERR, "serd engine '%s' does not exist", name);
|
||||
return;
|
||||
} else {
|
||||
fmd_serd_eng_reset(sgp);
|
||||
fmd_hdl_debug(hdl, "serd_reset %s", name);
|
||||
}
|
||||
|
||||
fmd_serd_eng_reset(sgp);
|
||||
|
||||
fmd_hdl_debug(hdl, "serd_reset %s", name);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -556,16 +546,21 @@ fmd_serd_record(fmd_hdl_t *hdl, const char *name, fmd_event_t *ep)
|
||||
{
|
||||
fmd_module_t *mp = (fmd_module_t *)hdl;
|
||||
fmd_serd_eng_t *sgp;
|
||||
int err;
|
||||
|
||||
if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
|
||||
zed_log_msg(LOG_ERR, "failed to add record to SERD engine '%s'",
|
||||
name);
|
||||
return (0);
|
||||
}
|
||||
err = fmd_serd_eng_record(sgp, ep->ev_hrt);
|
||||
return (fmd_serd_eng_record(sgp, ep->ev_hrt));
|
||||
}
|
||||
|
||||
return (err);
|
||||
void
|
||||
fmd_serd_gc(fmd_hdl_t *hdl)
|
||||
{
|
||||
fmd_module_t *mp = (fmd_module_t *)hdl;
|
||||
|
||||
fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL);
|
||||
}
|
||||
|
||||
/* FMD Timers */
|
||||
@@ -579,7 +574,7 @@ _timer_notify(union sigval sv)
|
||||
const fmd_hdl_ops_t *ops = mp->mod_info->fmdi_ops;
|
||||
struct itimerspec its;
|
||||
|
||||
fmd_hdl_debug(hdl, "timer fired (%p)", ftp->ft_tid);
|
||||
fmd_hdl_debug(hdl, "%s timer fired (%p)", mp->mod_name, ftp->ft_tid);
|
||||
|
||||
/* disarm the timer */
|
||||
memset(&its, 0, sizeof (struct itimerspec));
|
||||
|
||||
@@ -151,7 +151,6 @@ extern void fmd_hdl_vdebug(fmd_hdl_t *, const char *, va_list);
|
||||
extern void fmd_hdl_debug(fmd_hdl_t *, const char *, ...);
|
||||
|
||||
extern int32_t fmd_prop_get_int32(fmd_hdl_t *, const char *);
|
||||
extern int64_t fmd_prop_get_int64(fmd_hdl_t *, const char *);
|
||||
|
||||
#define FMD_STAT_NOALLOC 0x0 /* fmd should use caller's memory */
|
||||
#define FMD_STAT_ALLOC 0x1 /* fmd should allocate stats memory */
|
||||
@@ -195,10 +194,12 @@ extern size_t fmd_buf_size(fmd_hdl_t *, fmd_case_t *, const char *);
|
||||
extern void fmd_serd_create(fmd_hdl_t *, const char *, uint_t, hrtime_t);
|
||||
extern void fmd_serd_destroy(fmd_hdl_t *, const char *);
|
||||
extern int fmd_serd_exists(fmd_hdl_t *, const char *);
|
||||
extern int fmd_serd_active(fmd_hdl_t *, const char *);
|
||||
extern void fmd_serd_reset(fmd_hdl_t *, const char *);
|
||||
extern int fmd_serd_record(fmd_hdl_t *, const char *, fmd_event_t *);
|
||||
extern int fmd_serd_fired(fmd_hdl_t *, const char *);
|
||||
extern int fmd_serd_empty(fmd_hdl_t *, const char *);
|
||||
extern void fmd_serd_gc(fmd_hdl_t *);
|
||||
|
||||
extern id_t fmd_timer_install(fmd_hdl_t *, void *, fmd_event_t *, hrtime_t);
|
||||
extern void fmd_timer_remove(fmd_hdl_t *, id_t);
|
||||
|
||||
@@ -310,8 +310,9 @@ fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
|
||||
}
|
||||
|
||||
void
|
||||
fmd_serd_eng_gc(fmd_serd_eng_t *sgp)
|
||||
fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
fmd_serd_elem_t *sep, *nep;
|
||||
hrtime_t hrt;
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ extern int fmd_serd_eng_fired(fmd_serd_eng_t *);
|
||||
extern int fmd_serd_eng_empty(fmd_serd_eng_t *);
|
||||
|
||||
extern void fmd_serd_eng_reset(fmd_serd_eng_t *);
|
||||
extern void fmd_serd_eng_gc(fmd_serd_eng_t *);
|
||||
extern void fmd_serd_eng_gc(fmd_serd_eng_t *, void *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+117
-26
@@ -23,6 +23,7 @@
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2016, Intel Corporation.
|
||||
* Copyright (c) 2023, Klara Inc.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
@@ -47,11 +48,16 @@
|
||||
#define DEFAULT_CHECKSUM_T 600 /* seconds */
|
||||
#define DEFAULT_IO_N 10 /* events */
|
||||
#define DEFAULT_IO_T 600 /* seconds */
|
||||
#define DEFAULT_SLOW_IO_N 10 /* events */
|
||||
#define DEFAULT_SLOW_IO_T 30 /* seconds */
|
||||
|
||||
#define CASE_GC_TIMEOUT_SECS 43200 /* 12 hours */
|
||||
|
||||
/*
|
||||
* Our serd engines are named 'zfs_<pool_guid>_<vdev_guid>_{checksum,io}'. This
|
||||
* #define reserves enough space for two 64-bit hex values plus the length of
|
||||
* the longest string.
|
||||
* Our serd engines are named in the following format:
|
||||
* 'zfs_<pool_guid>_<vdev_guid>_{checksum,io,slow_io}'
|
||||
* This #define reserves enough space for two 64-bit hex values plus the
|
||||
* length of the longest string.
|
||||
*/
|
||||
#define MAX_SERDLEN (16 * 2 + sizeof ("zfs___checksum"))
|
||||
|
||||
@@ -68,6 +74,7 @@ typedef struct zfs_case_data {
|
||||
int zc_pool_state;
|
||||
char zc_serd_checksum[MAX_SERDLEN];
|
||||
char zc_serd_io[MAX_SERDLEN];
|
||||
char zc_serd_slow_io[MAX_SERDLEN];
|
||||
int zc_has_remove_timer;
|
||||
} zfs_case_data_t;
|
||||
|
||||
@@ -114,7 +121,8 @@ zfs_de_stats_t zfs_stats = {
|
||||
{ "resource_drops", FMD_TYPE_UINT64, "resource related ereports" }
|
||||
};
|
||||
|
||||
static hrtime_t zfs_remove_timeout;
|
||||
/* wait 15 seconds after a removal */
|
||||
static hrtime_t zfs_remove_timeout = SEC2NSEC(15);
|
||||
|
||||
uu_list_pool_t *zfs_case_pool;
|
||||
uu_list_t *zfs_cases;
|
||||
@@ -124,6 +132,8 @@ uu_list_t *zfs_cases;
|
||||
#define ZFS_MAKE_EREPORT(type) \
|
||||
FM_EREPORT_CLASS "." ZFS_ERROR_CLASS "." type
|
||||
|
||||
static void zfs_purge_cases(fmd_hdl_t *hdl);
|
||||
|
||||
/*
|
||||
* Write out the persistent representation of an active case.
|
||||
*/
|
||||
@@ -170,6 +180,42 @@ zfs_case_unserialize(fmd_hdl_t *hdl, fmd_case_t *cp)
|
||||
return (zcp);
|
||||
}
|
||||
|
||||
/*
|
||||
* count other unique slow-io cases in a pool
|
||||
*/
|
||||
static uint_t
|
||||
zfs_other_slow_cases(fmd_hdl_t *hdl, const zfs_case_data_t *zfs_case)
|
||||
{
|
||||
zfs_case_t *zcp;
|
||||
uint_t cases = 0;
|
||||
static hrtime_t next_check = 0;
|
||||
|
||||
/*
|
||||
* Note that plumbing in some external GC would require adding locking,
|
||||
* since most of this module code is not thread safe and assumes there
|
||||
* is only one thread running against the module. So we perform GC here
|
||||
* inline periodically so that future delay induced faults will be
|
||||
* possible once the issue causing multiple vdev delays is resolved.
|
||||
*/
|
||||
if (gethrestime_sec() > next_check) {
|
||||
/* Periodically purge old SERD entries and stale cases */
|
||||
fmd_serd_gc(hdl);
|
||||
zfs_purge_cases(hdl);
|
||||
next_check = gethrestime_sec() + CASE_GC_TIMEOUT_SECS;
|
||||
}
|
||||
|
||||
for (zcp = uu_list_first(zfs_cases); zcp != NULL;
|
||||
zcp = uu_list_next(zfs_cases, zcp)) {
|
||||
if (zcp->zc_data.zc_pool_guid == zfs_case->zc_pool_guid &&
|
||||
zcp->zc_data.zc_vdev_guid != zfs_case->zc_vdev_guid &&
|
||||
zcp->zc_data.zc_serd_slow_io[0] != '\0' &&
|
||||
fmd_serd_active(hdl, zcp->zc_data.zc_serd_slow_io)) {
|
||||
cases++;
|
||||
}
|
||||
}
|
||||
return (cases);
|
||||
}
|
||||
|
||||
/*
|
||||
* Iterate over any active cases. If any cases are associated with a pool or
|
||||
* vdev which is no longer present on the system, close the associated case.
|
||||
@@ -376,6 +422,14 @@ zfs_serd_name(char *buf, uint64_t pool_guid, uint64_t vdev_guid,
|
||||
(long long unsigned int)vdev_guid, type);
|
||||
}
|
||||
|
||||
static void
|
||||
zfs_case_retire(fmd_hdl_t *hdl, zfs_case_t *zcp)
|
||||
{
|
||||
fmd_hdl_debug(hdl, "retiring case");
|
||||
|
||||
fmd_case_close(hdl, zcp->zc_case);
|
||||
}
|
||||
|
||||
/*
|
||||
* Solve a given ZFS case. This first checks to make sure the diagnosis is
|
||||
* still valid, as well as cleaning up any pending timer associated with the
|
||||
@@ -632,9 +686,7 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
if (strcmp(class,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_DATA)) == 0 ||
|
||||
strcmp(class,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_CONFIG_CACHE_WRITE)) == 0 ||
|
||||
strcmp(class,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_DELAY)) == 0) {
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_CONFIG_CACHE_WRITE)) == 0) {
|
||||
zfs_stats.resource_drops.fmds_value.ui64++;
|
||||
return;
|
||||
}
|
||||
@@ -702,6 +754,9 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
if (zcp->zc_data.zc_serd_checksum[0] != '\0')
|
||||
fmd_serd_reset(hdl,
|
||||
zcp->zc_data.zc_serd_checksum);
|
||||
if (zcp->zc_data.zc_serd_slow_io[0] != '\0')
|
||||
fmd_serd_reset(hdl,
|
||||
zcp->zc_data.zc_serd_slow_io);
|
||||
} else if (fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_RSRC(FM_RESOURCE_STATECHANGE))) {
|
||||
uint64_t state = 0;
|
||||
@@ -730,7 +785,11 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
if (fmd_case_solved(hdl, zcp->zc_case))
|
||||
return;
|
||||
|
||||
fmd_hdl_debug(hdl, "error event '%s'", class);
|
||||
if (vdev_guid)
|
||||
fmd_hdl_debug(hdl, "error event '%s', vdev %llu", class,
|
||||
vdev_guid);
|
||||
else
|
||||
fmd_hdl_debug(hdl, "error event '%s'", class);
|
||||
|
||||
/*
|
||||
* Determine if we should solve the case and generate a fault. We solve
|
||||
@@ -779,6 +838,8 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_IO_FAILURE)) ||
|
||||
fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_DELAY)) ||
|
||||
fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_PROBE_FAILURE))) {
|
||||
const char *failmode = NULL;
|
||||
boolean_t checkremove = B_FALSE;
|
||||
@@ -814,6 +875,51 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class)
|
||||
}
|
||||
if (fmd_serd_record(hdl, zcp->zc_data.zc_serd_io, ep))
|
||||
checkremove = B_TRUE;
|
||||
} else if (fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_DELAY))) {
|
||||
uint64_t slow_io_n, slow_io_t;
|
||||
|
||||
/*
|
||||
* Create a slow io SERD engine when the VDEV has the
|
||||
* 'vdev_slow_io_n' and 'vdev_slow_io_n' properties.
|
||||
*/
|
||||
if (zcp->zc_data.zc_serd_slow_io[0] == '\0' &&
|
||||
nvlist_lookup_uint64(nvl,
|
||||
FM_EREPORT_PAYLOAD_ZFS_VDEV_SLOW_IO_N,
|
||||
&slow_io_n) == 0 &&
|
||||
nvlist_lookup_uint64(nvl,
|
||||
FM_EREPORT_PAYLOAD_ZFS_VDEV_SLOW_IO_T,
|
||||
&slow_io_t) == 0) {
|
||||
zfs_serd_name(zcp->zc_data.zc_serd_slow_io,
|
||||
pool_guid, vdev_guid, "slow_io");
|
||||
fmd_serd_create(hdl,
|
||||
zcp->zc_data.zc_serd_slow_io,
|
||||
slow_io_n,
|
||||
SEC2NSEC(slow_io_t));
|
||||
zfs_case_serialize(zcp);
|
||||
}
|
||||
/* Pass event to SERD engine and see if this triggers */
|
||||
if (zcp->zc_data.zc_serd_slow_io[0] != '\0' &&
|
||||
fmd_serd_record(hdl, zcp->zc_data.zc_serd_slow_io,
|
||||
ep)) {
|
||||
/*
|
||||
* Ignore a slow io diagnosis when other
|
||||
* VDEVs in the pool show signs of being slow.
|
||||
*/
|
||||
if (zfs_other_slow_cases(hdl, &zcp->zc_data)) {
|
||||
zfs_case_retire(hdl, zcp);
|
||||
fmd_hdl_debug(hdl, "pool %llu has "
|
||||
"multiple slow io cases -- skip "
|
||||
"degrading vdev %llu",
|
||||
(u_longlong_t)
|
||||
zcp->zc_data.zc_pool_guid,
|
||||
(u_longlong_t)
|
||||
zcp->zc_data.zc_vdev_guid);
|
||||
} else {
|
||||
zfs_case_solve(hdl, zcp,
|
||||
"fault.fs.zfs.vdev.slow_io");
|
||||
}
|
||||
}
|
||||
} else if (fmd_nvl_class_match(hdl, nvl,
|
||||
ZFS_MAKE_EREPORT(FM_EREPORT_ZFS_CHECKSUM))) {
|
||||
/*
|
||||
@@ -924,6 +1030,8 @@ zfs_fm_close(fmd_hdl_t *hdl, fmd_case_t *cs)
|
||||
fmd_serd_destroy(hdl, zcp->zc_data.zc_serd_checksum);
|
||||
if (zcp->zc_data.zc_serd_io[0] != '\0')
|
||||
fmd_serd_destroy(hdl, zcp->zc_data.zc_serd_io);
|
||||
if (zcp->zc_data.zc_serd_slow_io[0] != '\0')
|
||||
fmd_serd_destroy(hdl, zcp->zc_data.zc_serd_slow_io);
|
||||
if (zcp->zc_data.zc_has_remove_timer)
|
||||
fmd_timer_remove(hdl, zcp->zc_remove_timer);
|
||||
|
||||
@@ -932,30 +1040,15 @@ zfs_fm_close(fmd_hdl_t *hdl, fmd_case_t *cs)
|
||||
fmd_hdl_free(hdl, zcp, sizeof (zfs_case_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* We use the fmd gc entry point to look for old cases that no longer apply.
|
||||
* This allows us to keep our set of case data small in a long running system.
|
||||
*/
|
||||
static void
|
||||
zfs_fm_gc(fmd_hdl_t *hdl)
|
||||
{
|
||||
zfs_purge_cases(hdl);
|
||||
}
|
||||
|
||||
static const fmd_hdl_ops_t fmd_ops = {
|
||||
zfs_fm_recv, /* fmdo_recv */
|
||||
zfs_fm_timeout, /* fmdo_timeout */
|
||||
zfs_fm_close, /* fmdo_close */
|
||||
NULL, /* fmdo_stats */
|
||||
zfs_fm_gc, /* fmdo_gc */
|
||||
NULL, /* fmdo_gc */
|
||||
};
|
||||
|
||||
static const fmd_prop_t fmd_props[] = {
|
||||
{ "checksum_N", FMD_TYPE_UINT32, "10" },
|
||||
{ "checksum_T", FMD_TYPE_TIME, "10min" },
|
||||
{ "io_N", FMD_TYPE_UINT32, "10" },
|
||||
{ "io_T", FMD_TYPE_TIME, "10min" },
|
||||
{ "remove_timeout", FMD_TYPE_TIME, "15sec" },
|
||||
{ NULL, 0, NULL }
|
||||
};
|
||||
|
||||
@@ -996,8 +1089,6 @@ _zfs_diagnosis_init(fmd_hdl_t *hdl)
|
||||
|
||||
(void) fmd_stat_create(hdl, FMD_STAT_NOALLOC, sizeof (zfs_stats) /
|
||||
sizeof (fmd_stat_t), (fmd_stat_t *)&zfs_stats);
|
||||
|
||||
zfs_remove_timeout = fmd_prop_get_int64(hdl, "remove_timeout");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -523,6 +523,9 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
|
||||
} else if (fmd_nvl_class_match(hdl, fault,
|
||||
"fault.fs.zfs.vdev.checksum")) {
|
||||
degrade_device = B_TRUE;
|
||||
} else if (fmd_nvl_class_match(hdl, fault,
|
||||
"fault.fs.zfs.vdev.slow_io")) {
|
||||
degrade_device = B_TRUE;
|
||||
} else if (fmd_nvl_class_match(hdl, fault,
|
||||
"fault.fs.zfs.device")) {
|
||||
fault_device = B_FALSE;
|
||||
|
||||
+61
-14
@@ -309,7 +309,8 @@ get_usage(zfs_help_t idx)
|
||||
"[filesystem|volume|snapshot] ...\n"));
|
||||
case HELP_MOUNT:
|
||||
return (gettext("\tmount\n"
|
||||
"\tmount [-flvO] [-o opts] <-a | filesystem>\n"));
|
||||
"\tmount [-flvO] [-o opts] <-a|-R filesystem|"
|
||||
"filesystem>\n"));
|
||||
case HELP_PROMOTE:
|
||||
return (gettext("\tpromote <clone-filesystem>\n"));
|
||||
case HELP_RECEIVE:
|
||||
@@ -6750,6 +6751,8 @@ zfs_do_holds(int argc, char **argv)
|
||||
#define MOUNT_TIME 1 /* seconds */
|
||||
|
||||
typedef struct get_all_state {
|
||||
char **ga_datasets;
|
||||
int ga_count;
|
||||
boolean_t ga_verbose;
|
||||
get_all_cb_t *ga_cbp;
|
||||
} get_all_state_t;
|
||||
@@ -6796,19 +6799,35 @@ get_one_dataset(zfs_handle_t *zhp, void *data)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
get_all_datasets(get_all_cb_t *cbp, boolean_t verbose)
|
||||
static int
|
||||
get_recursive_datasets(zfs_handle_t *zhp, void *data)
|
||||
{
|
||||
get_all_state_t state = {
|
||||
.ga_verbose = verbose,
|
||||
.ga_cbp = cbp
|
||||
};
|
||||
get_all_state_t *state = data;
|
||||
int len = strlen(zfs_get_name(zhp));
|
||||
for (int i = 0; i < state->ga_count; ++i) {
|
||||
if (strcmp(state->ga_datasets[i], zfs_get_name(zhp)) == 0)
|
||||
return (get_one_dataset(zhp, data));
|
||||
else if ((strncmp(state->ga_datasets[i], zfs_get_name(zhp),
|
||||
len) == 0) && state->ga_datasets[i][len] == '/') {
|
||||
(void) zfs_iter_filesystems_v2(zhp, 0,
|
||||
get_recursive_datasets, data);
|
||||
}
|
||||
}
|
||||
zfs_close(zhp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
static void
|
||||
get_all_datasets(get_all_state_t *state)
|
||||
{
|
||||
if (state->ga_verbose)
|
||||
set_progress_header(gettext("Reading ZFS config"));
|
||||
(void) zfs_iter_root(g_zfs, get_one_dataset, &state);
|
||||
if (state->ga_datasets == NULL)
|
||||
(void) zfs_iter_root(g_zfs, get_one_dataset, state);
|
||||
else
|
||||
(void) zfs_iter_root(g_zfs, get_recursive_datasets, state);
|
||||
|
||||
if (verbose)
|
||||
if (state->ga_verbose)
|
||||
finish_progress(gettext("done."));
|
||||
}
|
||||
|
||||
@@ -7154,18 +7173,22 @@ static int
|
||||
share_mount(int op, int argc, char **argv)
|
||||
{
|
||||
int do_all = 0;
|
||||
int recursive = 0;
|
||||
boolean_t verbose = B_FALSE;
|
||||
int c, ret = 0;
|
||||
char *options = NULL;
|
||||
int flags = 0;
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt(argc, argv, op == OP_MOUNT ? ":alvo:Of" : "al"))
|
||||
while ((c = getopt(argc, argv, op == OP_MOUNT ? ":aRlvo:Of" : "al"))
|
||||
!= -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
do_all = 1;
|
||||
break;
|
||||
case 'R':
|
||||
recursive = 1;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = B_TRUE;
|
||||
break;
|
||||
@@ -7207,7 +7230,7 @@ share_mount(int op, int argc, char **argv)
|
||||
argv += optind;
|
||||
|
||||
/* check number of arguments */
|
||||
if (do_all) {
|
||||
if (do_all || recursive) {
|
||||
enum sa_protocol protocol = SA_NO_PROTOCOL;
|
||||
|
||||
if (op == OP_SHARE && argc > 0) {
|
||||
@@ -7216,14 +7239,38 @@ share_mount(int op, int argc, char **argv)
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (argc != 0) {
|
||||
if (argc != 0 && do_all) {
|
||||
(void) fprintf(stderr, gettext("too many arguments\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
if (argc == 0 && recursive) {
|
||||
(void) fprintf(stderr,
|
||||
gettext("no dataset provided\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
start_progress_timer();
|
||||
get_all_cb_t cb = { 0 };
|
||||
get_all_datasets(&cb, verbose);
|
||||
get_all_state_t state = { 0 };
|
||||
if (argc == 0) {
|
||||
state.ga_datasets = NULL;
|
||||
state.ga_count = -1;
|
||||
} else {
|
||||
zfs_handle_t *zhp;
|
||||
for (int i = 0; i < argc; i++) {
|
||||
zhp = zfs_open(g_zfs, argv[i],
|
||||
ZFS_TYPE_FILESYSTEM);
|
||||
if (zhp == NULL)
|
||||
usage(B_FALSE);
|
||||
zfs_close(zhp);
|
||||
}
|
||||
state.ga_datasets = argv;
|
||||
state.ga_count = argc;
|
||||
}
|
||||
state.ga_verbose = verbose;
|
||||
state.ga_cbp = &cb;
|
||||
get_all_datasets(&state);
|
||||
|
||||
if (cb.cb_used == 0) {
|
||||
free(options);
|
||||
|
||||
@@ -1083,6 +1083,22 @@ main(int argc, char **argv)
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (record.zi_nlanes) {
|
||||
switch (io_type) {
|
||||
case ZIO_TYPE_READ:
|
||||
case ZIO_TYPE_WRITE:
|
||||
case ZIO_TYPES:
|
||||
break;
|
||||
default:
|
||||
(void) fprintf(stderr, "I/O type for a delay "
|
||||
"must be 'read' or 'write'\n");
|
||||
usage();
|
||||
libzfs_fini(g_zfs);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!error)
|
||||
error = ENXIO;
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@ static char *zpool_sysfs_gets(char *path)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
buf = calloc(sizeof (*buf), statbuf.st_size + 1);
|
||||
buf = calloc(statbuf.st_size + 1, sizeof (*buf));
|
||||
if (buf == NULL) {
|
||||
close(fd);
|
||||
return (NULL);
|
||||
@@ -458,7 +458,7 @@ static char *zpool_sysfs_gets(char *path)
|
||||
}
|
||||
|
||||
/* Remove trailing newline */
|
||||
if (buf[count - 1] == '\n')
|
||||
if (count > 0 && buf[count - 1] == '\n')
|
||||
buf[count - 1] = 0;
|
||||
|
||||
close(fd);
|
||||
|
||||
+95
-51
@@ -22,7 +22,7 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
|
||||
* Copyright (c) 2012 by Cyril Plisko. All rights reserved.
|
||||
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
|
||||
@@ -131,6 +131,13 @@ static int zpool_do_help(int argc, char **argv);
|
||||
static zpool_compat_status_t zpool_do_load_compat(
|
||||
const char *, boolean_t *);
|
||||
|
||||
enum zpool_options {
|
||||
ZPOOL_OPTION_POWER = 1024,
|
||||
ZPOOL_OPTION_ALLOW_INUSE,
|
||||
ZPOOL_OPTION_ALLOW_REPLICATION_MISMATCH,
|
||||
ZPOOL_OPTION_ALLOW_ASHIFT_MISMATCH
|
||||
};
|
||||
|
||||
/*
|
||||
* These libumem hooks provide a reasonable set of defaults for the allocator's
|
||||
* debugging facilities.
|
||||
@@ -347,7 +354,7 @@ get_usage(zpool_help_t idx)
|
||||
{
|
||||
switch (idx) {
|
||||
case HELP_ADD:
|
||||
return (gettext("\tadd [-fgLnP] [-o property=value] "
|
||||
return (gettext("\tadd [-afgLnP] [-o property=value] "
|
||||
"<pool> <vdev> ...\n"));
|
||||
case HELP_ATTACH:
|
||||
return (gettext("\tattach [-fsw] [-o property=value] "
|
||||
@@ -413,7 +420,7 @@ get_usage(zpool_help_t idx)
|
||||
"[<device> ...]\n"));
|
||||
case HELP_STATUS:
|
||||
return (gettext("\tstatus [--power] [-c [script1,script2,...]] "
|
||||
"[-igLpPstvxD] [-T d|u] [pool] ... \n"
|
||||
"[-DegiLpPstvx] [-T d|u] [pool] ...\n"
|
||||
"\t [interval [count]]\n"));
|
||||
case HELP_UPGRADE:
|
||||
return (gettext("\tupgrade\n"
|
||||
@@ -1009,8 +1016,9 @@ add_prop_list_default(const char *propname, const char *propval,
|
||||
}
|
||||
|
||||
/*
|
||||
* zpool add [-fgLnP] [-o property=value] <pool> <vdev> ...
|
||||
* zpool add [-afgLnP] [-o property=value] <pool> <vdev> ...
|
||||
*
|
||||
* -a Disable the ashift validation checks
|
||||
* -f Force addition of devices, even if they appear in use
|
||||
* -g Display guid for individual vdev name.
|
||||
* -L Follow links when resolving vdev path name.
|
||||
@@ -1026,8 +1034,11 @@ add_prop_list_default(const char *propname, const char *propval,
|
||||
int
|
||||
zpool_do_add(int argc, char **argv)
|
||||
{
|
||||
boolean_t force = B_FALSE;
|
||||
boolean_t check_replication = B_TRUE;
|
||||
boolean_t check_inuse = B_TRUE;
|
||||
boolean_t dryrun = B_FALSE;
|
||||
boolean_t check_ashift = B_TRUE;
|
||||
boolean_t force = B_FALSE;
|
||||
int name_flags = 0;
|
||||
int c;
|
||||
nvlist_t *nvroot;
|
||||
@@ -1038,8 +1049,18 @@ zpool_do_add(int argc, char **argv)
|
||||
nvlist_t *props = NULL;
|
||||
char *propval;
|
||||
|
||||
struct option long_options[] = {
|
||||
{"allow-in-use", no_argument, NULL, ZPOOL_OPTION_ALLOW_INUSE},
|
||||
{"allow-replication-mismatch", no_argument, NULL,
|
||||
ZPOOL_OPTION_ALLOW_REPLICATION_MISMATCH},
|
||||
{"allow-ashift-mismatch", no_argument, NULL,
|
||||
ZPOOL_OPTION_ALLOW_ASHIFT_MISMATCH},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt(argc, argv, "fgLno:P")) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "fgLno:P", long_options, NULL))
|
||||
!= -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
force = B_TRUE;
|
||||
@@ -1069,6 +1090,15 @@ zpool_do_add(int argc, char **argv)
|
||||
case 'P':
|
||||
name_flags |= VDEV_NAME_PATH;
|
||||
break;
|
||||
case ZPOOL_OPTION_ALLOW_INUSE:
|
||||
check_inuse = B_FALSE;
|
||||
break;
|
||||
case ZPOOL_OPTION_ALLOW_REPLICATION_MISMATCH:
|
||||
check_replication = B_FALSE;
|
||||
break;
|
||||
case ZPOOL_OPTION_ALLOW_ASHIFT_MISMATCH:
|
||||
check_ashift = B_FALSE;
|
||||
break;
|
||||
case '?':
|
||||
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
|
||||
optopt);
|
||||
@@ -1089,6 +1119,19 @@ zpool_do_add(int argc, char **argv)
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
if (force) {
|
||||
if (!check_inuse || !check_replication || !check_ashift) {
|
||||
(void) fprintf(stderr, gettext("'-f' option is not "
|
||||
"allowed with '--allow-replication-mismatch', "
|
||||
"'--allow-ashift-mismatch', or "
|
||||
"'--allow-in-use'\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
check_inuse = B_FALSE;
|
||||
check_replication = B_FALSE;
|
||||
check_ashift = B_FALSE;
|
||||
}
|
||||
|
||||
poolname = argv[0];
|
||||
|
||||
argc--;
|
||||
@@ -1119,8 +1162,8 @@ zpool_do_add(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* pass off to make_root_vdev for processing */
|
||||
nvroot = make_root_vdev(zhp, props, force, !force, B_FALSE, dryrun,
|
||||
argc, argv);
|
||||
nvroot = make_root_vdev(zhp, props, !check_inuse,
|
||||
check_replication, B_FALSE, dryrun, argc, argv);
|
||||
if (nvroot == NULL) {
|
||||
zpool_close(zhp);
|
||||
return (1);
|
||||
@@ -1224,7 +1267,7 @@ zpool_do_add(int argc, char **argv)
|
||||
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = (zpool_add(zhp, nvroot) != 0);
|
||||
ret = (zpool_add(zhp, nvroot, check_ashift) != 0);
|
||||
}
|
||||
|
||||
nvlist_free(props);
|
||||
@@ -2246,7 +2289,6 @@ print_status_initialize(vdev_stat_t *vs, boolean_t verbose)
|
||||
!vs->vs_scan_removing) {
|
||||
char zbuf[1024];
|
||||
char tbuf[256];
|
||||
struct tm zaction_ts;
|
||||
|
||||
time_t t = vs->vs_initialize_action_time;
|
||||
int initialize_pct = 100;
|
||||
@@ -2256,8 +2298,8 @@ print_status_initialize(vdev_stat_t *vs, boolean_t verbose)
|
||||
100 / (vs->vs_initialize_bytes_est + 1));
|
||||
}
|
||||
|
||||
(void) localtime_r(&t, &zaction_ts);
|
||||
(void) strftime(tbuf, sizeof (tbuf), "%c", &zaction_ts);
|
||||
(void) ctime_r(&t, tbuf);
|
||||
tbuf[24] = 0;
|
||||
|
||||
switch (vs->vs_initialize_state) {
|
||||
case VDEV_INITIALIZE_SUSPENDED:
|
||||
@@ -2297,7 +2339,6 @@ print_status_trim(vdev_stat_t *vs, boolean_t verbose)
|
||||
!vs->vs_scan_removing) {
|
||||
char zbuf[1024];
|
||||
char tbuf[256];
|
||||
struct tm zaction_ts;
|
||||
|
||||
time_t t = vs->vs_trim_action_time;
|
||||
int trim_pct = 100;
|
||||
@@ -2306,8 +2347,8 @@ print_status_trim(vdev_stat_t *vs, boolean_t verbose)
|
||||
100 / (vs->vs_trim_bytes_est + 1));
|
||||
}
|
||||
|
||||
(void) localtime_r(&t, &zaction_ts);
|
||||
(void) strftime(tbuf, sizeof (tbuf), "%c", &zaction_ts);
|
||||
(void) ctime_r(&t, tbuf);
|
||||
tbuf[24] = 0;
|
||||
|
||||
switch (vs->vs_trim_state) {
|
||||
case VDEV_TRIM_SUSPENDED:
|
||||
@@ -2569,7 +2610,13 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
|
||||
break;
|
||||
|
||||
case VDEV_AUX_ERR_EXCEEDED:
|
||||
(void) printf(gettext("too many errors"));
|
||||
if (vs->vs_read_errors + vs->vs_write_errors +
|
||||
vs->vs_checksum_errors == 0 && children == 0 &&
|
||||
vs->vs_slow_ios > 0) {
|
||||
(void) printf(gettext("too many slow I/Os"));
|
||||
} else {
|
||||
(void) printf(gettext("too many errors"));
|
||||
}
|
||||
break;
|
||||
|
||||
case VDEV_AUX_IO_FAILURE:
|
||||
@@ -3396,10 +3443,10 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,
|
||||
ms_status = zpool_enable_datasets(zhp, mntopts, 0);
|
||||
if (ms_status == EZFS_SHAREFAILED) {
|
||||
(void) fprintf(stderr, gettext("Import was "
|
||||
"successful, but unable to share some datasets"));
|
||||
"successful, but unable to share some datasets\n"));
|
||||
} else if (ms_status == EZFS_MOUNTFAILED) {
|
||||
(void) fprintf(stderr, gettext("Import was "
|
||||
"successful, but unable to mount some datasets"));
|
||||
"successful, but unable to mount some datasets\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7064,7 +7111,6 @@ zpool_do_split(int argc, char **argv)
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#define POWER_OPT 1024
|
||||
|
||||
/*
|
||||
* zpool online [--power] <pool> <device> ...
|
||||
@@ -7082,7 +7128,7 @@ zpool_do_online(int argc, char **argv)
|
||||
int flags = 0;
|
||||
boolean_t is_power_on = B_FALSE;
|
||||
struct option long_options[] = {
|
||||
{"power", no_argument, NULL, POWER_OPT},
|
||||
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -7092,7 +7138,7 @@ zpool_do_online(int argc, char **argv)
|
||||
case 'e':
|
||||
flags |= ZFS_ONLINE_EXPAND;
|
||||
break;
|
||||
case POWER_OPT:
|
||||
case ZPOOL_OPTION_POWER:
|
||||
is_power_on = B_TRUE;
|
||||
break;
|
||||
case '?':
|
||||
@@ -7205,7 +7251,7 @@ zpool_do_offline(int argc, char **argv)
|
||||
boolean_t is_power_off = B_FALSE;
|
||||
|
||||
struct option long_options[] = {
|
||||
{"power", no_argument, NULL, POWER_OPT},
|
||||
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -7218,7 +7264,7 @@ zpool_do_offline(int argc, char **argv)
|
||||
case 't':
|
||||
istmp = B_TRUE;
|
||||
break;
|
||||
case POWER_OPT:
|
||||
case ZPOOL_OPTION_POWER:
|
||||
is_power_off = B_TRUE;
|
||||
break;
|
||||
case '?':
|
||||
@@ -7318,7 +7364,7 @@ zpool_do_clear(int argc, char **argv)
|
||||
char *pool, *device;
|
||||
|
||||
struct option long_options[] = {
|
||||
{"power", no_argument, NULL, POWER_OPT},
|
||||
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -7335,7 +7381,7 @@ zpool_do_clear(int argc, char **argv)
|
||||
case 'X':
|
||||
xtreme_rewind = B_TRUE;
|
||||
break;
|
||||
case POWER_OPT:
|
||||
case ZPOOL_OPTION_POWER:
|
||||
is_power_on = B_TRUE;
|
||||
break;
|
||||
case '?':
|
||||
@@ -8864,7 +8910,7 @@ status_callback(zpool_handle_t *zhp, void *data)
|
||||
printf_color(ANSI_BOLD, gettext("action: "));
|
||||
printf_color(ANSI_YELLOW, gettext("Make sure the pool's devices"
|
||||
" are connected, then reboot your system and\n\timport the "
|
||||
"pool.\n"));
|
||||
"pool or run 'zpool clear' to resume the pool.\n"));
|
||||
break;
|
||||
|
||||
case ZPOOL_STATUS_IO_FAILURE_WAIT:
|
||||
@@ -9064,22 +9110,22 @@ status_callback(zpool_handle_t *zhp, void *data)
|
||||
}
|
||||
|
||||
/*
|
||||
* zpool status [-c [script1,script2,...]] [-igLpPstvx] [--power] [-T d|u] ...
|
||||
* zpool status [-c [script1,script2,...]] [-DegiLpPstvx] [--power] [-T d|u] ...
|
||||
* [pool] [interval [count]]
|
||||
*
|
||||
* -c CMD For each vdev, run command CMD
|
||||
* -D Display dedup status (undocumented)
|
||||
* -e Display only unhealthy vdevs
|
||||
* -i Display vdev initialization status.
|
||||
* -g Display guid for individual vdev name.
|
||||
* -i Display vdev initialization status.
|
||||
* -L Follow links when resolving vdev path name.
|
||||
* -p Display values in parsable (exact) format.
|
||||
* -P Display full path for vdev name.
|
||||
* -s Display slow IOs column.
|
||||
* -v Display complete error logs
|
||||
* -x Display only pools with potential problems
|
||||
* -D Display dedup status (undocumented)
|
||||
* -t Display vdev TRIM status.
|
||||
* -T Display a timestamp in date(1) or Unix format
|
||||
* -v Display complete error logs
|
||||
* -x Display only pools with potential problems
|
||||
* --power Display vdev enclosure slot power status
|
||||
*
|
||||
* Describes the health status of all pools or some subset.
|
||||
@@ -9095,12 +9141,12 @@ zpool_do_status(int argc, char **argv)
|
||||
char *cmd = NULL;
|
||||
|
||||
struct option long_options[] = {
|
||||
{"power", no_argument, NULL, POWER_OPT},
|
||||
{"power", no_argument, NULL, ZPOOL_OPTION_POWER},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt_long(argc, argv, "c:eigLpPsvxDtT:", long_options,
|
||||
while ((c = getopt_long(argc, argv, "c:DegiLpPstT:vx", long_options,
|
||||
NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
@@ -9127,15 +9173,18 @@ zpool_do_status(int argc, char **argv)
|
||||
}
|
||||
cmd = optarg;
|
||||
break;
|
||||
case 'D':
|
||||
cb.cb_dedup_stats = B_TRUE;
|
||||
break;
|
||||
case 'e':
|
||||
cb.cb_print_unhealthy = B_TRUE;
|
||||
break;
|
||||
case 'i':
|
||||
cb.cb_print_vdev_init = B_TRUE;
|
||||
break;
|
||||
case 'g':
|
||||
cb.cb_name_flags |= VDEV_NAME_GUID;
|
||||
break;
|
||||
case 'i':
|
||||
cb.cb_print_vdev_init = B_TRUE;
|
||||
break;
|
||||
case 'L':
|
||||
cb.cb_name_flags |= VDEV_NAME_FOLLOW_LINKS;
|
||||
break;
|
||||
@@ -9148,22 +9197,19 @@ zpool_do_status(int argc, char **argv)
|
||||
case 's':
|
||||
cb.cb_print_slow_ios = B_TRUE;
|
||||
break;
|
||||
case 'v':
|
||||
cb.cb_verbose = B_TRUE;
|
||||
break;
|
||||
case 'x':
|
||||
cb.cb_explain = B_TRUE;
|
||||
break;
|
||||
case 'D':
|
||||
cb.cb_dedup_stats = B_TRUE;
|
||||
break;
|
||||
case 't':
|
||||
cb.cb_print_vdev_trim = B_TRUE;
|
||||
break;
|
||||
case 'T':
|
||||
get_timestamp_arg(*optarg);
|
||||
break;
|
||||
case POWER_OPT:
|
||||
case 'v':
|
||||
cb.cb_verbose = B_TRUE;
|
||||
break;
|
||||
case 'x':
|
||||
cb.cb_explain = B_TRUE;
|
||||
break;
|
||||
case ZPOOL_OPTION_POWER:
|
||||
cb.cb_print_power = B_TRUE;
|
||||
break;
|
||||
case '?':
|
||||
@@ -9202,7 +9248,6 @@ zpool_do_status(int argc, char **argv)
|
||||
|
||||
if (cb.vcdl != NULL)
|
||||
free_vdev_cmd_data_list(cb.vcdl);
|
||||
|
||||
if (argc == 0 && cb.cb_count == 0)
|
||||
(void) fprintf(stderr, gettext("no pools available\n"));
|
||||
else if (cb.cb_explain && cb.cb_first && cb.cb_allpools)
|
||||
@@ -10638,11 +10683,10 @@ found:
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* The first arg isn't a pool name,
|
||||
* The first arg isn't the name of a valid pool.
|
||||
*/
|
||||
fprintf(stderr, gettext("missing pool name.\n"));
|
||||
fprintf(stderr, "\n");
|
||||
usage(B_FALSE);
|
||||
fprintf(stderr, gettext("Cannot get properties of %s: "
|
||||
"no such pool available.\n"), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ static void
|
||||
zfs_redup_stream(int infd, int outfd, boolean_t verbose)
|
||||
{
|
||||
int bufsz = SPA_MAXBLOCKSIZE;
|
||||
dmu_replay_record_t thedrr = { 0 };
|
||||
dmu_replay_record_t thedrr;
|
||||
dmu_replay_record_t *drr = &thedrr;
|
||||
redup_table_t rdt;
|
||||
zio_cksum_t stream_cksum;
|
||||
@@ -194,6 +194,8 @@ zfs_redup_stream(int infd, int outfd, boolean_t verbose)
|
||||
uint64_t num_records = 0;
|
||||
uint64_t num_write_byref_records = 0;
|
||||
|
||||
memset(&thedrr, 0, sizeof (dmu_replay_record_t));
|
||||
|
||||
#ifdef _ILP32
|
||||
uint64_t max_rde_size = SMALLEST_POSSIBLE_MAX_RDT_MB << 20;
|
||||
#else
|
||||
|
||||
+11
-9
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2018 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
* Copyright (c) 2014 Integros [integros.com]
|
||||
@@ -2448,7 +2448,7 @@ ztest_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf,
|
||||
ASSERT3P(zio, !=, NULL);
|
||||
size = doi.doi_data_block_size;
|
||||
if (ISP2(size)) {
|
||||
offset = P2ALIGN(offset, size);
|
||||
offset = P2ALIGN_TYPED(offset, size, uint64_t);
|
||||
} else {
|
||||
ASSERT3U(offset, <, size);
|
||||
offset = 0;
|
||||
@@ -3270,7 +3270,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
|
||||
"log" : NULL, ztest_opts.zo_raid_children, zs->zs_mirrors,
|
||||
1);
|
||||
|
||||
error = spa_vdev_add(spa, nvroot);
|
||||
error = spa_vdev_add(spa, nvroot, B_FALSE);
|
||||
fnvlist_free(nvroot);
|
||||
|
||||
switch (error) {
|
||||
@@ -3332,7 +3332,7 @@ ztest_vdev_class_add(ztest_ds_t *zd, uint64_t id)
|
||||
nvroot = make_vdev_root(NULL, NULL, NULL, ztest_opts.zo_vdev_size, 0,
|
||||
class, ztest_opts.zo_raid_children, zs->zs_mirrors, 1);
|
||||
|
||||
error = spa_vdev_add(spa, nvroot);
|
||||
error = spa_vdev_add(spa, nvroot, B_FALSE);
|
||||
fnvlist_free(nvroot);
|
||||
|
||||
if (error == ENOSPC)
|
||||
@@ -3439,7 +3439,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
nvlist_t *nvroot = make_vdev_root(NULL, aux, NULL,
|
||||
(ztest_opts.zo_vdev_size * 5) / 4, 0, NULL, 0, 0, 1);
|
||||
error = spa_vdev_add(spa, nvroot);
|
||||
error = spa_vdev_add(spa, nvroot, B_FALSE);
|
||||
|
||||
switch (error) {
|
||||
case 0:
|
||||
@@ -4668,7 +4668,8 @@ ztest_dmu_object_next_chunk(ztest_ds_t *zd, uint64_t id)
|
||||
*/
|
||||
mutex_enter(&os->os_obj_lock);
|
||||
object = ztest_random(os->os_obj_next_chunk);
|
||||
os->os_obj_next_chunk = P2ALIGN(object, dnodes_per_chunk);
|
||||
os->os_obj_next_chunk = P2ALIGN_TYPED(object, dnodes_per_chunk,
|
||||
uint64_t);
|
||||
mutex_exit(&os->os_obj_lock);
|
||||
}
|
||||
|
||||
@@ -6284,7 +6285,8 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
|
||||
* the end of the disk (vdev_psize) is aligned to
|
||||
* sizeof (vdev_label_t).
|
||||
*/
|
||||
uint64_t psize = P2ALIGN(fsize, sizeof (vdev_label_t));
|
||||
uint64_t psize = P2ALIGN_TYPED(fsize, sizeof (vdev_label_t),
|
||||
uint64_t);
|
||||
if ((leaf & 1) == 1 &&
|
||||
offset + sizeof (bad) > psize - VDEV_LABEL_END_SIZE)
|
||||
continue;
|
||||
@@ -6600,8 +6602,8 @@ ztest_fletcher_incr(ztest_ds_t *zd, uint64_t id)
|
||||
size_t inc = 64 * ztest_random(size / 67);
|
||||
/* sometimes add few bytes to test non-simd */
|
||||
if (ztest_random(100) < 10)
|
||||
inc += P2ALIGN(ztest_random(64),
|
||||
sizeof (uint32_t));
|
||||
inc += P2ALIGN_TYPED(ztest_random(64),
|
||||
sizeof (uint32_t), uint64_t);
|
||||
|
||||
if (inc > (size - pos))
|
||||
inc = size - pos;
|
||||
|
||||
@@ -18,6 +18,7 @@ subst_sed_cmd = \
|
||||
-e 's|@ASAN_ENABLED[@]|$(ASAN_ENABLED)|g' \
|
||||
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \
|
||||
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' \
|
||||
-e 's|@IS_SYSV_RC[@]|$(IS_SYSV_RC)|g' \
|
||||
-e 's|@LIBFETCH_DYNAMIC[@]|$(LIBFETCH_DYNAMIC)|g' \
|
||||
-e 's|@LIBFETCH_SONAME[@]|$(LIBFETCH_SONAME)|g' \
|
||||
-e 's|@PYTHON[@]|$(PYTHON)|g' \
|
||||
@@ -43,4 +44,4 @@ SUBSTFILES =
|
||||
CLEANFILES += $(SUBSTFILES)
|
||||
dist_noinst_DATA += $(SUBSTFILES:=.in)
|
||||
|
||||
$(call SUBST,%,)
|
||||
$(SUBSTFILES): $(call SUBST,%,)
|
||||
|
||||
@@ -80,10 +80,11 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
||||
[AC_MSG_ERROR("Python $PYTHON_VERSION unknown")]
|
||||
)
|
||||
|
||||
AX_PYTHON_DEVEL([$PYTHON_REQUIRED_VERSION], [
|
||||
AS_IF([test "x$enable_pyzfs" = xyes], [
|
||||
AC_MSG_ERROR("Python $PYTHON_REQUIRED_VERSION development library is not installed")
|
||||
], [test "x$enable_pyzfs" != xno], [
|
||||
AS_IF([test "x$enable_pyzfs" = xyes], [
|
||||
AX_PYTHON_DEVEL([$PYTHON_REQUIRED_VERSION])
|
||||
], [
|
||||
AX_PYTHON_DEVEL([$PYTHON_REQUIRED_VERSION], [true])
|
||||
AS_IF([test "x$ax_python_devel_found" = xno], [
|
||||
enable_pyzfs=no
|
||||
])
|
||||
])
|
||||
|
||||
+229
-112
@@ -4,18 +4,13 @@
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PYTHON_DEVEL([version], [action-if-not-found])
|
||||
# AX_PYTHON_DEVEL([version[,optional]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
|
||||
# in your configure.ac.
|
||||
#
|
||||
# Note: this is a slightly modified version of the original AX_PYTHON_DEVEL
|
||||
# macro which accepts an additional [action-if-not-found] argument. This
|
||||
# allow to detect if Python development is available without aborting the
|
||||
# configure phase with an hard error in case it is not.
|
||||
#
|
||||
# This macro checks for Python and tries to get the include path to
|
||||
# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LIBS) output
|
||||
# variables. It also exports $(PYTHON_EXTRA_LIBS) and
|
||||
@@ -28,6 +23,11 @@
|
||||
# version number. Don't use "PYTHON_VERSION" for this: that environment
|
||||
# variable is declared as precious and thus reserved for the end-user.
|
||||
#
|
||||
# By default this will fail if it does not detect a development version of
|
||||
# python. If you want it to continue, set optional to true, like
|
||||
# AX_PYTHON_DEVEL([], [true]). The ax_python_devel_found variable will be
|
||||
# "no" if it fails.
|
||||
#
|
||||
# This macro should work for all versions of Python >= 2.1.0. As an end
|
||||
# user, you can disable the check for the python version by setting the
|
||||
# PYTHON_NOVERSIONCHECK environment variable to something else than the
|
||||
@@ -45,7 +45,6 @@
|
||||
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
|
||||
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
|
||||
# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
|
||||
# Copyright (c) 2018 loli10K <ezomori.nozomu@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
@@ -73,10 +72,18 @@
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 21
|
||||
#serial 36
|
||||
|
||||
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
|
||||
AC_DEFUN([AX_PYTHON_DEVEL],[
|
||||
# Get whether it's optional
|
||||
if test -z "$2"; then
|
||||
ax_python_devel_optional=false
|
||||
else
|
||||
ax_python_devel_optional=$2
|
||||
fi
|
||||
ax_python_devel_found=yes
|
||||
|
||||
#
|
||||
# Allow the use of a (user set) custom python version
|
||||
#
|
||||
@@ -87,23 +94,26 @@ AC_DEFUN([AX_PYTHON_DEVEL],[
|
||||
|
||||
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
|
||||
if test -z "$PYTHON"; then
|
||||
m4_ifvaln([$2],[$2],[
|
||||
AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
|
||||
PYTHON_VERSION=""
|
||||
])
|
||||
AC_MSG_WARN([Cannot find python$PYTHON_VERSION in your system path])
|
||||
if ! $ax_python_devel_optional; then
|
||||
AC_MSG_ERROR([Giving up, python development not available])
|
||||
fi
|
||||
ax_python_devel_found=no
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for a version of Python >= 2.1.0
|
||||
#
|
||||
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
||||
ac_supports_python_ver=`$PYTHON -c "import sys; \
|
||||
if test $ax_python_devel_found = yes; then
|
||||
#
|
||||
# Check for a version of Python >= 2.1.0
|
||||
#
|
||||
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
||||
ac_supports_python_ver=`$PYTHON -c "import sys; \
|
||||
ver = sys.version.split ()[[0]]; \
|
||||
print (ver >= '2.1.0')"`
|
||||
if test "$ac_supports_python_ver" != "True"; then
|
||||
if test "$ac_supports_python_ver" != "True"; then
|
||||
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_FAILURE([
|
||||
AC_MSG_WARN([
|
||||
This version of the AC@&t@_PYTHON_DEVEL macro
|
||||
doesn't work properly with versions of Python before
|
||||
2.1.0. You may need to re-run configure, setting the
|
||||
@@ -112,20 +122,27 @@ PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
|
||||
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
|
||||
to something else than an empty string.
|
||||
])
|
||||
if ! $ax_python_devel_optional; then
|
||||
AC_MSG_FAILURE([Giving up])
|
||||
fi
|
||||
ax_python_devel_found=no
|
||||
PYTHON_VERSION=""
|
||||
else
|
||||
AC_MSG_RESULT([skip at user request])
|
||||
fi
|
||||
else
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# If the macro parameter ``version'' is set, honour it.
|
||||
# A Python shim class, VPy, is used to implement correct version comparisons via
|
||||
# string expressions, since e.g. a naive textual ">= 2.7.3" won't work for
|
||||
# Python 2.7.10 (the ".1" being evaluated as less than ".3").
|
||||
#
|
||||
if test -n "$1"; then
|
||||
if test $ax_python_devel_found = yes; then
|
||||
#
|
||||
# If the macro parameter ``version'' is set, honour it.
|
||||
# A Python shim class, VPy, is used to implement correct version comparisons via
|
||||
# string expressions, since e.g. a naive textual ">= 2.7.3" won't work for
|
||||
# Python 2.7.10 (the ".1" being evaluated as less than ".3").
|
||||
#
|
||||
if test -n "$1"; then
|
||||
AC_MSG_CHECKING([for a version of Python $1])
|
||||
cat << EOF > ax_python_devel_vpy.py
|
||||
class VPy:
|
||||
@@ -133,7 +150,7 @@ class VPy:
|
||||
return tuple(map(int, s.strip().replace("rc", ".").split(".")))
|
||||
def __init__(self):
|
||||
import sys
|
||||
self.vpy = tuple(sys.version_info)
|
||||
self.vpy = tuple(sys.version_info)[[:3]]
|
||||
def __eq__(self, s):
|
||||
return self.vpy == self.vtup(s)
|
||||
def __ne__(self, s):
|
||||
@@ -155,25 +172,69 @@ EOF
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([this package requires Python $1.
|
||||
AC_MSG_WARN([this package requires Python $1.
|
||||
If you have it installed, but it isn't the default Python
|
||||
interpreter in your system path, please pass the PYTHON_VERSION
|
||||
variable to configure. See ``configure --help'' for reference.
|
||||
])
|
||||
if ! $ax_python_devel_optional; then
|
||||
AC_MSG_ERROR([Giving up])
|
||||
fi
|
||||
ax_python_devel_found=no
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for Python include path
|
||||
#
|
||||
#
|
||||
AC_MSG_CHECKING([for Python include path])
|
||||
if test -z "$PYTHON_CPPFLAGS"; then
|
||||
python_path=`$PYTHON -c "import sysconfig; \
|
||||
print (sysconfig.get_path('include'));"`
|
||||
plat_python_path=`$PYTHON -c "import sysconfig; \
|
||||
print (sysconfig.get_path('platinclude'));"`
|
||||
if test $ax_python_devel_found = yes; then
|
||||
#
|
||||
# Check if you have distutils, else fail
|
||||
#
|
||||
AC_MSG_CHECKING([for the sysconfig Python package])
|
||||
ac_sysconfig_result=`$PYTHON -c "import sysconfig" 2>&1`
|
||||
if test $? -eq 0; then
|
||||
AC_MSG_RESULT([yes])
|
||||
IMPORT_SYSCONFIG="import sysconfig"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
AC_MSG_CHECKING([for the distutils Python package])
|
||||
ac_sysconfig_result=`$PYTHON -c "from distutils import sysconfig" 2>&1`
|
||||
if test $? -eq 0; then
|
||||
AC_MSG_RESULT([yes])
|
||||
IMPORT_SYSCONFIG="from distutils import sysconfig"
|
||||
else
|
||||
AC_MSG_WARN([cannot import Python module "distutils".
|
||||
Please check your Python installation. The error was:
|
||||
$ac_sysconfig_result])
|
||||
if ! $ax_python_devel_optional; then
|
||||
AC_MSG_ERROR([Giving up])
|
||||
fi
|
||||
ax_python_devel_found=no
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ax_python_devel_found = yes; then
|
||||
#
|
||||
# Check for Python include path
|
||||
#
|
||||
AC_MSG_CHECKING([for Python include path])
|
||||
if test -z "$PYTHON_CPPFLAGS"; then
|
||||
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
|
||||
# sysconfig module has different functions
|
||||
python_path=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
print (sysconfig.get_path ('include'));"`
|
||||
plat_python_path=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
print (sysconfig.get_path ('platinclude'));"`
|
||||
else
|
||||
# old distutils way
|
||||
python_path=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
print (sysconfig.get_python_inc ());"`
|
||||
plat_python_path=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
print (sysconfig.get_python_inc (plat_specific=1));"`
|
||||
fi
|
||||
if test -n "${python_path}"; then
|
||||
if test "${plat_python_path}" != "${python_path}"; then
|
||||
python_path="-I$python_path -I$plat_python_path"
|
||||
@@ -182,15 +243,15 @@ variable to configure. See ``configure --help'' for reference.
|
||||
fi
|
||||
fi
|
||||
PYTHON_CPPFLAGS=$python_path
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
|
||||
AC_SUBST([PYTHON_CPPFLAGS])
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
|
||||
AC_SUBST([PYTHON_CPPFLAGS])
|
||||
|
||||
#
|
||||
# Check for Python library path
|
||||
#
|
||||
AC_MSG_CHECKING([for Python library path])
|
||||
if test -z "$PYTHON_LIBS"; then
|
||||
#
|
||||
# Check for Python library path
|
||||
#
|
||||
AC_MSG_CHECKING([for Python library path])
|
||||
if test -z "$PYTHON_LIBS"; then
|
||||
# (makes two attempts to ensure we've got a version number
|
||||
# from the interpreter)
|
||||
ac_python_version=`cat<<EOD | $PYTHON -
|
||||
@@ -208,7 +269,7 @@ EOD`
|
||||
ac_python_version=$PYTHON_VERSION
|
||||
else
|
||||
ac_python_version=`$PYTHON -c "import sys; \
|
||||
print ('.'.join(sys.version.split('.')[[:2]]))"`
|
||||
print ("%d.%d" % sys.version_info[[:2]])"`
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -220,7 +281,7 @@ EOD`
|
||||
ac_python_libdir=`cat<<EOD | $PYTHON -
|
||||
|
||||
# There should be only one
|
||||
import sysconfig
|
||||
$IMPORT_SYSCONFIG
|
||||
e = sysconfig.get_config_var('LIBDIR')
|
||||
if e is not None:
|
||||
print (e)
|
||||
@@ -229,7 +290,7 @@ EOD`
|
||||
# Now, for the library:
|
||||
ac_python_library=`cat<<EOD | $PYTHON -
|
||||
|
||||
import sysconfig
|
||||
$IMPORT_SYSCONFIG
|
||||
c = sysconfig.get_config_vars()
|
||||
if 'LDVERSION' in c:
|
||||
print ('python'+c[['LDVERSION']])
|
||||
@@ -249,88 +310,140 @@ EOD`
|
||||
else
|
||||
# old way: use libpython from python_configdir
|
||||
ac_python_libdir=`$PYTHON -c \
|
||||
"import sysconfig; \
|
||||
"from sysconfig import get_python_lib as f; \
|
||||
import os; \
|
||||
print (os.path.join(sysconfig.get_path('platstdlib'), 'config'));"`
|
||||
print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
|
||||
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
|
||||
fi
|
||||
|
||||
if test -z "PYTHON_LIBS"; then
|
||||
m4_ifvaln([$2],[$2],[
|
||||
AC_MSG_ERROR([
|
||||
AC_MSG_WARN([
|
||||
Cannot determine location of your Python DSO. Please check it was installed with
|
||||
dynamic libraries enabled, or try setting PYTHON_LIBS by hand.
|
||||
])
|
||||
])
|
||||
if ! $ax_python_devel_optional; then
|
||||
AC_MSG_ERROR([Giving up])
|
||||
fi
|
||||
ax_python_devel_found=no
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_LIBS])
|
||||
AC_SUBST([PYTHON_LIBS])
|
||||
|
||||
#
|
||||
# Check for site packages
|
||||
#
|
||||
AC_MSG_CHECKING([for Python site-packages path])
|
||||
if test -z "$PYTHON_SITE_PKG"; then
|
||||
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_lib(0,0));" 2>/dev/null || \
|
||||
$PYTHON -c "import sysconfig; \
|
||||
print (sysconfig.get_path('purelib'));"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_SITE_PKG])
|
||||
AC_SUBST([PYTHON_SITE_PKG])
|
||||
if test $ax_python_devel_found = yes; then
|
||||
AC_MSG_RESULT([$PYTHON_LIBS])
|
||||
AC_SUBST([PYTHON_LIBS])
|
||||
|
||||
#
|
||||
# libraries which must be linked in when embedding
|
||||
#
|
||||
AC_MSG_CHECKING(python extra libraries)
|
||||
if test -z "$PYTHON_EXTRA_LIBS"; then
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "import sysconfig; \
|
||||
#
|
||||
# Check for site packages
|
||||
#
|
||||
AC_MSG_CHECKING([for Python site-packages path])
|
||||
if test -z "$PYTHON_SITE_PKG"; then
|
||||
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
|
||||
PYTHON_SITE_PKG=`$PYTHON -c "
|
||||
$IMPORT_SYSCONFIG;
|
||||
if hasattr(sysconfig, 'get_default_scheme'):
|
||||
scheme = sysconfig.get_default_scheme()
|
||||
else:
|
||||
scheme = sysconfig._get_default_scheme()
|
||||
if scheme == 'posix_local':
|
||||
# Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
|
||||
scheme = 'posix_prefix'
|
||||
prefix = '$prefix'
|
||||
if prefix == 'NONE':
|
||||
prefix = '$ac_default_prefix'
|
||||
sitedir = sysconfig.get_path('purelib', scheme, vars={'base': prefix})
|
||||
print(sitedir)"`
|
||||
else
|
||||
# distutils.sysconfig way
|
||||
PYTHON_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
print (sysconfig.get_python_lib(0,0));"`
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_SITE_PKG])
|
||||
AC_SUBST([PYTHON_SITE_PKG])
|
||||
|
||||
#
|
||||
# Check for platform-specific site packages
|
||||
#
|
||||
AC_MSG_CHECKING([for Python platform specific site-packages path])
|
||||
if test -z "$PYTHON_PLATFORM_SITE_PKG"; then
|
||||
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
|
||||
PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "
|
||||
$IMPORT_SYSCONFIG;
|
||||
if hasattr(sysconfig, 'get_default_scheme'):
|
||||
scheme = sysconfig.get_default_scheme()
|
||||
else:
|
||||
scheme = sysconfig._get_default_scheme()
|
||||
if scheme == 'posix_local':
|
||||
# Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
|
||||
scheme = 'posix_prefix'
|
||||
prefix = '$prefix'
|
||||
if prefix == 'NONE':
|
||||
prefix = '$ac_default_prefix'
|
||||
sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase': prefix})
|
||||
print(sitedir)"`
|
||||
else
|
||||
# distutils.sysconfig way
|
||||
PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
print (sysconfig.get_python_lib(1,0));"`
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_PLATFORM_SITE_PKG])
|
||||
AC_SUBST([PYTHON_PLATFORM_SITE_PKG])
|
||||
|
||||
#
|
||||
# libraries which must be linked in when embedding
|
||||
#
|
||||
AC_MSG_CHECKING(python extra libraries)
|
||||
if test -z "$PYTHON_EXTRA_LIBS"; then
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
conf = sysconfig.get_config_var; \
|
||||
print (conf('LIBS') + ' ' + conf('SYSLIBS'))"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
|
||||
AC_SUBST(PYTHON_EXTRA_LIBS)
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
|
||||
AC_SUBST(PYTHON_EXTRA_LIBS)
|
||||
|
||||
#
|
||||
# linking flags needed when embedding
|
||||
#
|
||||
AC_MSG_CHECKING(python extra linking flags)
|
||||
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
|
||||
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import sysconfig; \
|
||||
#
|
||||
# linking flags needed when embedding
|
||||
#
|
||||
AC_MSG_CHECKING(python extra linking flags)
|
||||
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
|
||||
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "$IMPORT_SYSCONFIG; \
|
||||
conf = sysconfig.get_config_var; \
|
||||
print (conf('LINKFORSHARED'))"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
|
||||
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
|
||||
# Hack for macos, it sticks this in here.
|
||||
PYTHON_EXTRA_LDFLAGS=`echo $PYTHON_EXTRA_LDFLAGS | sed 's/CoreFoundation.*$/CoreFoundation/'`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
|
||||
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
|
||||
|
||||
#
|
||||
# final check to see if everything compiles alright
|
||||
#
|
||||
AC_MSG_CHECKING([consistency of all components of python development environment])
|
||||
# save current global flags
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS $PYTHON_EXTRA_LIBS"
|
||||
LDFLAGS="$ac_save_LDFLAGS $PYTHON_EXTRA_LDFLAGS"
|
||||
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
|
||||
AC_LANG_PUSH([C])
|
||||
AC_LINK_IFELSE([
|
||||
#
|
||||
# final check to see if everything compiles alright
|
||||
#
|
||||
AC_MSG_CHECKING([consistency of all components of python development environment])
|
||||
# save current global flags
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS"
|
||||
LDFLAGS="$ac_save_LDFLAGS $PYTHON_EXTRA_LDFLAGS"
|
||||
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
|
||||
AC_LANG_PUSH([C])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <Python.h>]],
|
||||
[[Py_Initialize();]])
|
||||
],[pythonexists=yes],[pythonexists=no])
|
||||
AC_LANG_POP([C])
|
||||
# turn back to default flags
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
AC_LANG_POP([C])
|
||||
# turn back to default flags
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
|
||||
AC_MSG_RESULT([$pythonexists])
|
||||
AC_MSG_RESULT([$pythonexists])
|
||||
|
||||
if test ! "x$pythonexists" = "xyes"; then
|
||||
m4_ifvaln([$2],[$2],[
|
||||
AC_MSG_FAILURE([
|
||||
if test ! "x$pythonexists" = "xyes"; then
|
||||
AC_MSG_WARN([
|
||||
Could not link test program to Python. Maybe the main Python library has been
|
||||
installed in some non-standard library path. If so, pass it to configure,
|
||||
via the LIBS environment variable.
|
||||
@@ -340,9 +453,13 @@ EOD`
|
||||
You probably have to install the development version of the Python package
|
||||
for your distribution. The exact name of this package varies among them.
|
||||
============================================================================
|
||||
])
|
||||
PYTHON_VERSION=""
|
||||
])
|
||||
])
|
||||
if ! $ax_python_devel_optional; then
|
||||
AC_MSG_ERROR([Giving up])
|
||||
fi
|
||||
ax_python_devel_found=no
|
||||
PYTHON_VERSION=""
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@@ -90,8 +90,8 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [
|
||||
AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]])
|
||||
$7
|
||||
],[dnl ELSE
|
||||
AC_SUBST([$1]_CFLAGS, [])
|
||||
AC_SUBST([$1]_LIBS, [])
|
||||
AC_SUBST([$1]_CFLAGS, [""])
|
||||
AC_SUBST([$1]_LIBS, [""])
|
||||
AC_MSG_WARN([cannot find [$5] via pkg-config or in the standard locations])
|
||||
$8
|
||||
])
|
||||
|
||||
@@ -25,6 +25,8 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_PLUG], [
|
||||
dnl #
|
||||
dnl # 2.6.32 - 4.11: statically allocated bdi in request_queue
|
||||
dnl # 4.12: dynamically allocated bdi in request_queue
|
||||
dnl # 6.11: bdi no longer available through request_queue, so get it from
|
||||
dnl # the gendisk attached to the queue
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_bdi], [
|
||||
@@ -47,6 +49,30 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_BDI], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISK_BDI], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_disk_bdi], [
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/backing-dev.h>
|
||||
], [
|
||||
struct request_queue q;
|
||||
struct gendisk disk;
|
||||
struct backing_dev_info bdi __attribute__ ((unused));
|
||||
q.disk = &disk;
|
||||
q.disk->bdi = &bdi;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISK_BDI], [
|
||||
AC_MSG_CHECKING([whether backing_dev_info is available through queue gendisk])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_disk_bdi], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_DISK_BDI, 1,
|
||||
[backing_dev_info is available through queue gendisk])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.9: added blk_queue_update_readahead(),
|
||||
dnl # 5.15: renamed to disk_update_readahead()
|
||||
@@ -332,7 +358,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_max_hw_sectors], [
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([blk_queue_max_hw_sectors])
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
@@ -355,7 +381,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_max_segments], [
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([blk_queue_max_segments])
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
@@ -377,6 +403,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ], [
|
||||
(void) blk_mq_alloc_tag_set(&tag_set);
|
||||
return BLK_STS_OK;
|
||||
], [])
|
||||
ZFS_LINUX_TEST_SRC([blk_mq_rq_hctx], [
|
||||
#include <linux/blk-mq.h>
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct request rq = {0};
|
||||
struct blk_mq_hw_ctx *hctx = NULL;
|
||||
rq.mq_hctx = hctx;
|
||||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
|
||||
@@ -384,6 +418,13 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_MQ, 1, [block multiqueue is available])
|
||||
AC_MSG_CHECKING([whether block multiqueue hardware context is cached in struct request])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq_rq_hctx], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_MQ_RQ_HCTX, 1, [block multiqueue hardware context is cached in struct request])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
@@ -392,6 +433,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE], [
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_PLUG
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISK_BDI
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_UPDATE_READAHEAD
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE
|
||||
@@ -406,6 +448,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE], [
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_PLUG
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_BDI
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_DISK_BDI
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_UPDATE_READAHEAD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE
|
||||
|
||||
+151
-34
@@ -54,6 +54,26 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_OPEN_BY_PATH], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.9.x API change
|
||||
dnl # bdev_file_open_by_path() replaced bdev_open_by_path(),
|
||||
dnl # and returns struct file*
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_FILE_OPEN_BY_PATH], [
|
||||
ZFS_LINUX_TEST_SRC([bdev_file_open_by_path], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct file *file __attribute__ ((unused)) = NULL;
|
||||
const char *path = "path";
|
||||
fmode_t mode = 0;
|
||||
void *holder = NULL;
|
||||
struct blk_holder_ops h;
|
||||
|
||||
file = bdev_file_open_by_path(path, mode, holder, &h);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH], [
|
||||
AC_MSG_CHECKING([whether blkdev_get_by_path() exists and takes 3 args])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_get_by_path], [
|
||||
@@ -73,7 +93,16 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH], [
|
||||
[bdev_open_by_path() exists])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([blkdev_get_by_path()])
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([whether bdev_file_open_by_path() exists])
|
||||
ZFS_LINUX_TEST_RESULT([bdev_file_open_by_path], [
|
||||
AC_DEFINE(HAVE_BDEV_FILE_OPEN_BY_PATH, 1,
|
||||
[bdev_file_open_by_path() exists])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
ZFS_LINUX_TEST_ERROR([blkdev_get_by_path()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
@@ -149,10 +178,19 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_RELEASE], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.9.x API change
|
||||
dnl #
|
||||
dnl # bdev_release() now private, but because bdev_file_open_by_path() returns
|
||||
dnl # struct file*, we can just use fput(). So the blkdev_put test no longer
|
||||
dnl # fails if not found.
|
||||
dnl #
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_PUT], [
|
||||
AC_MSG_CHECKING([whether blkdev_put() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_put], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_PUT, 1, [blkdev_put() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([whether blkdev_put() accepts void* as arg 2])
|
||||
@@ -168,7 +206,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_PUT], [
|
||||
AC_DEFINE(HAVE_BDEV_RELEASE, 1,
|
||||
[bdev_release() exists])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([blkdev_put()])
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
@@ -496,6 +534,30 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.16 API change
|
||||
dnl # Added bdev_nr_bytes() helper.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_NR_BYTES], [
|
||||
ZFS_LINUX_TEST_SRC([bdev_nr_bytes], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct block_device *bdev = NULL;
|
||||
loff_t nr_bytes __attribute__ ((unused)) = 0;
|
||||
nr_bytes = bdev_nr_bytes(bdev);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_NR_BYTES], [
|
||||
AC_MSG_CHECKING([whether bdev_nr_bytes() is available])
|
||||
ZFS_LINUX_TEST_RESULT([bdev_nr_bytes], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BDEV_NR_BYTES, 1, [bdev_nr_bytes() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.20 API change,
|
||||
dnl # Removed bdevname(), snprintf(.., %pg) should be used.
|
||||
@@ -523,12 +585,29 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEVNAME], [
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.19 API: blkdev_issue_secure_erase()
|
||||
dnl # 4.7 API: __blkdev_issue_discard(..., BLKDEV_DISCARD_SECURE)
|
||||
dnl # 3.10 API: blkdev_issue_discard(..., BLKDEV_DISCARD_SECURE)
|
||||
dnl # TRIM support: discard and secure erase. We make use of asynchronous
|
||||
dnl # functions when available.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_SECURE_ERASE], [
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_secure_erase], [
|
||||
dnl # 3.10:
|
||||
dnl # sync discard: blkdev_issue_discard(..., 0)
|
||||
dnl # sync erase: blkdev_issue_discard(..., BLKDEV_DISCARD_SECURE)
|
||||
dnl # async discard: [not available]
|
||||
dnl # async erase: [not available]
|
||||
dnl #
|
||||
dnl # 4.7:
|
||||
dnl # sync discard: blkdev_issue_discard(..., 0)
|
||||
dnl # sync erase: blkdev_issue_discard(..., BLKDEV_DISCARD_SECURE)
|
||||
dnl # async discard: __blkdev_issue_discard(..., 0)
|
||||
dnl # async erase: __blkdev_issue_discard(..., BLKDEV_DISCARD_SECURE)
|
||||
dnl #
|
||||
dnl # 5.19:
|
||||
dnl # sync discard: blkdev_issue_discard(...)
|
||||
dnl # sync erase: blkdev_issue_secure_erase(...)
|
||||
dnl # async discard: __blkdev_issue_discard(...)
|
||||
dnl # async erase: [not available]
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_DISCARD], [
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_discard_noflags], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct block_device *bdev = NULL;
|
||||
@@ -536,10 +615,33 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_SECURE_ERASE], [
|
||||
sector_t nr_sects = 0;
|
||||
int error __attribute__ ((unused));
|
||||
|
||||
error = blkdev_issue_secure_erase(bdev,
|
||||
error = blkdev_issue_discard(bdev,
|
||||
sector, nr_sects, GFP_KERNEL);
|
||||
])
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_discard_flags], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct block_device *bdev = NULL;
|
||||
sector_t sector = 0;
|
||||
sector_t nr_sects = 0;
|
||||
unsigned long flags = 0;
|
||||
int error __attribute__ ((unused));
|
||||
|
||||
error = blkdev_issue_discard(bdev,
|
||||
sector, nr_sects, GFP_KERNEL, flags);
|
||||
])
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_discard_async_noflags], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct block_device *bdev = NULL;
|
||||
sector_t sector = 0;
|
||||
sector_t nr_sects = 0;
|
||||
struct bio *biop = NULL;
|
||||
int error __attribute__ ((unused));
|
||||
|
||||
error = __blkdev_issue_discard(bdev,
|
||||
sector, nr_sects, GFP_KERNEL, &biop);
|
||||
])
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_discard_async_flags], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
@@ -553,22 +655,52 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_SECURE_ERASE], [
|
||||
error = __blkdev_issue_discard(bdev,
|
||||
sector, nr_sects, GFP_KERNEL, flags, &biop);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_discard_flags], [
|
||||
ZFS_LINUX_TEST_SRC([blkdev_issue_secure_erase], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct block_device *bdev = NULL;
|
||||
sector_t sector = 0;
|
||||
sector_t nr_sects = 0;
|
||||
unsigned long flags = 0;
|
||||
int error __attribute__ ((unused));
|
||||
|
||||
error = blkdev_issue_discard(bdev,
|
||||
sector, nr_sects, GFP_KERNEL, flags);
|
||||
error = blkdev_issue_secure_erase(bdev,
|
||||
sector, nr_sects, GFP_KERNEL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_ISSUE_SECURE_ERASE], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_ISSUE_DISCARD], [
|
||||
AC_MSG_CHECKING([whether blkdev_issue_discard() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_discard_noflags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS, 1,
|
||||
[blkdev_issue_discard() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_MSG_CHECKING([whether blkdev_issue_discard(flags) is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_discard_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_ISSUE_DISCARD_FLAGS, 1,
|
||||
[blkdev_issue_discard(flags) is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_MSG_CHECKING([whether __blkdev_issue_discard() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_discard_async_noflags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS, 1,
|
||||
[__blkdev_issue_discard() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_MSG_CHECKING([whether __blkdev_issue_discard(flags) is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_discard_async_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS, 1,
|
||||
[__blkdev_issue_discard(flags) is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_MSG_CHECKING([whether blkdev_issue_secure_erase() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_secure_erase], [
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -576,24 +708,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_ISSUE_SECURE_ERASE], [
|
||||
[blkdev_issue_secure_erase() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether __blkdev_issue_discard() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_discard_async_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_ISSUE_DISCARD_ASYNC, 1,
|
||||
[__blkdev_issue_discard() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether blkdev_issue_discard() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_issue_discard_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLKDEV_ISSUE_DISCARD, 1,
|
||||
[blkdev_issue_discard() is available])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([blkdev_issue_discard()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
@@ -645,6 +759,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH_4ARG
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_OPEN_BY_PATH
|
||||
ZFS_AC_KERNEL_SRC_BDEV_FILE_OPEN_BY_PATH
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_PUT
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_PUT_HOLDER
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_RELEASE
|
||||
@@ -656,8 +771,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_NR_BYTES
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEVNAME
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_DISCARD
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_KOBJ
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_PART_TO_DEV
|
||||
ZFS_AC_KERNEL_SRC_BLKDEV_DISK_CHECK_MEDIA_CHANGE
|
||||
@@ -676,9 +792,10 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
||||
ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE
|
||||
ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
||||
ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE
|
||||
ZFS_AC_KERNEL_BLKDEV_BDEV_NR_BYTES
|
||||
ZFS_AC_KERNEL_BLKDEV_BDEVNAME
|
||||
ZFS_AC_KERNEL_BLKDEV_GET_ERESTARTSYS
|
||||
ZFS_AC_KERNEL_BLKDEV_ISSUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_BLKDEV_ISSUE_DISCARD
|
||||
ZFS_AC_KERNEL_BLKDEV_BDEV_KOBJ
|
||||
ZFS_AC_KERNEL_BLKDEV_PART_TO_DEV
|
||||
ZFS_AC_KERNEL_BLKDEV_DISK_CHECK_MEDIA_CHANGE
|
||||
|
||||
@@ -4,6 +4,7 @@ dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILEMAP], [
|
||||
ZFS_LINUX_TEST_SRC([filemap_range_has_page], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/pagemap.h>
|
||||
],[
|
||||
struct address_space *mapping = NULL;
|
||||
loff_t lstart = 0;
|
||||
|
||||
@@ -50,6 +50,21 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
|
||||
disk = blk_alloc_disk(NUMA_NO_NODE);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blk_alloc_disk_2arg], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct queue_limits *lim = NULL;
|
||||
struct gendisk *disk __attribute__ ((unused));
|
||||
disk = blk_alloc_disk(lim, NUMA_NO_NODE);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blkdev_queue_limits_features], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct queue_limits *lim = NULL;
|
||||
lim->features = 0;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
@@ -96,6 +111,45 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 6.9 API Change:
|
||||
dnl # blk_alloc_queue() takes a nullable queue_limits arg.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether blk_alloc_disk() exists and takes 2 args])
|
||||
ZFS_LINUX_TEST_RESULT([blk_alloc_disk_2arg], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([HAVE_BLK_ALLOC_DISK_2ARG], 1, [blk_alloc_disk() exists and takes 2 args])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 6.11 API change:
|
||||
dnl # struct queue_limits gains a 'features' field,
|
||||
dnl # used to set flushing options
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether struct queue_limits has a features field])
|
||||
ZFS_LINUX_TEST_RESULT([blkdev_queue_limits_features], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([HAVE_BLKDEV_QUEUE_LIMITS_FEATURES], 1,
|
||||
[struct queue_limits has a features field])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.20 API change,
|
||||
dnl # Removed blk_cleanup_disk(), put_disk() should be used.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
|
||||
[blk_cleanup_disk() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE], [
|
||||
ZFS_LINUX_TEST_SRC([page_size], [
|
||||
#include <linux/mm.h>
|
||||
],[
|
||||
unsigned long s;
|
||||
s = page_size(NULL);
|
||||
])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_SIZE], [
|
||||
AC_MSG_CHECKING([whether page_size() is available])
|
||||
ZFS_LINUX_TEST_RESULT([page_size], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MM_PAGE_SIZE, 1, [page_size() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING], [
|
||||
ZFS_LINUX_TEST_SRC([page_mapping], [
|
||||
#include <linux/pagemap.h>
|
||||
],[
|
||||
struct page *p = NULL;
|
||||
struct address_space *m = page_mapping(NULL);
|
||||
])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_MAPPING], [
|
||||
AC_MSG_CHECKING([whether page_mapping() is available])
|
||||
ZFS_LINUX_TEST_RESULT([page_mapping], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MM_PAGE_MAPPING, 1, [page_mapping() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
@@ -25,3 +25,62 @@ AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 6.11 register_sysctl() enforces that sysctl tables no longer
|
||||
dnl # supply a sentinel end-of-table element. 6.6 introduces
|
||||
dnl # register_sysctl_sz() to enable callers to choose, so we use it if
|
||||
dnl # available for backward compatibility.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ], [
|
||||
ZFS_LINUX_TEST_SRC([has_register_sysctl_sz], [
|
||||
#include <linux/sysctl.h>
|
||||
],[
|
||||
struct ctl_table test_table[] __attribute__((unused)) = {0};
|
||||
register_sysctl_sz("", test_table, 0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ], [
|
||||
AC_MSG_CHECKING([whether register_sysctl_sz exists])
|
||||
ZFS_LINUX_TEST_RESULT([has_register_sysctl_sz], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_REGISTER_SYSCTL_SZ, 1,
|
||||
[register_sysctl_sz exists])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 6.11 makes const the ctl_table arg of proc_handler
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST], [
|
||||
ZFS_LINUX_TEST_SRC([has_proc_handler_ctl_table_const], [
|
||||
#include <linux/sysctl.h>
|
||||
|
||||
static int test_handler(
|
||||
const struct ctl_table *ctl __attribute((unused)),
|
||||
int write __attribute((unused)),
|
||||
void *buffer __attribute((unused)),
|
||||
size_t *lenp __attribute((unused)),
|
||||
loff_t *ppos __attribute((unused)))
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
], [
|
||||
proc_handler *ph __attribute((unused)) =
|
||||
&test_handler;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST], [
|
||||
AC_MSG_CHECKING([whether proc_handler ctl_table arg is const])
|
||||
ZFS_LINUX_TEST_RESULT([has_proc_handler_ctl_table_const], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_PROC_HANDLER_CTL_TABLE_CONST, 1,
|
||||
[proc_handler ctl_table arg is const])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
dnl #
|
||||
dnl # check if kernel provides definitions for given types
|
||||
dnl #
|
||||
|
||||
dnl _ZFS_AC_KERNEL_SRC_TYPE(type)
|
||||
AC_DEFUN([_ZFS_AC_KERNEL_SRC_TYPE], [
|
||||
ZFS_LINUX_TEST_SRC([type_$1], [
|
||||
#include <linux/types.h>
|
||||
],[
|
||||
const $1 __attribute__((unused)) x = ($1) 0;
|
||||
])
|
||||
])
|
||||
|
||||
dnl _ZFS_AC_KERNEL_TYPE(type)
|
||||
AC_DEFUN([_ZFS_AC_KERNEL_TYPE], [
|
||||
AC_MSG_CHECKING([whether kernel defines $1])
|
||||
ZFS_LINUX_TEST_RESULT([type_$1], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_KERNEL_]m4_quote(m4_translit([$1], [a-z], [A-Z])),
|
||||
1, [kernel defines $1])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl ZFS_AC_KERNEL_TYPES([types...])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_TYPES], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_TYPES], [
|
||||
m4_foreach_w([type], [$1], [
|
||||
_ZFS_AC_KERNEL_SRC_TYPE(type)
|
||||
])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_TYPES], [
|
||||
m4_foreach_w([type], [$1], [
|
||||
_ZFS_AC_KERNEL_TYPE(type)
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
ZFS_AC_KERNEL_TYPES([intptr_t])
|
||||
@@ -16,6 +16,9 @@ dnl #
|
||||
dnl # 5.3: VFS copy_file_range() expected to do its own fallback,
|
||||
dnl # generic_copy_file_range() added to support it
|
||||
dnl #
|
||||
dnl # 6.8: generic_copy_file_range() removed, replaced by
|
||||
dnl # splice_copy_file_range()
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_COPY_FILE_RANGE], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_copy_file_range], [
|
||||
#include <linux/fs.h>
|
||||
@@ -72,6 +75,30 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_SPLICE_COPY_FILE_RANGE], [
|
||||
ZFS_LINUX_TEST_SRC([splice_copy_file_range], [
|
||||
#include <linux/splice.h>
|
||||
], [
|
||||
struct file *src_file __attribute__ ((unused)) = NULL;
|
||||
loff_t src_off __attribute__ ((unused)) = 0;
|
||||
struct file *dst_file __attribute__ ((unused)) = NULL;
|
||||
loff_t dst_off __attribute__ ((unused)) = 0;
|
||||
size_t len __attribute__ ((unused)) = 0;
|
||||
splice_copy_file_range(src_file, src_off, dst_file, dst_off,
|
||||
len);
|
||||
])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_SPLICE_COPY_FILE_RANGE], [
|
||||
AC_MSG_CHECKING([whether splice_copy_file_range() is available])
|
||||
ZFS_LINUX_TEST_RESULT([splice_copy_file_range], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFS_SPLICE_COPY_FILE_RANGE, 1,
|
||||
[splice_copy_file_range() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_CLONE_FILE_RANGE], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_clone_file_range], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
@@ -37,6 +37,7 @@ dnl # only once the compilation can be done in parallel significantly
|
||||
dnl # speeding up the process.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_TYPES
|
||||
ZFS_AC_KERNEL_SRC_OBJTOOL
|
||||
ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE
|
||||
ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE
|
||||
@@ -118,6 +119,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||
ZFS_AC_KERNEL_SRC_VFS_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_SPLICE_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_REMAP_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_CLONE_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_DEDUPE_FILE_RANGE
|
||||
@@ -164,8 +166,12 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
|
||||
ZFS_AC_KERNEL_SRC_RECLAIMED
|
||||
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
|
||||
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ
|
||||
ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST
|
||||
ZFS_AC_KERNEL_SRC_COPY_SPLICE_READ
|
||||
ZFS_AC_KERNEL_SRC_SYNC_BDEV
|
||||
ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE
|
||||
ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
||||
@@ -185,6 +191,7 @@ dnl #
|
||||
dnl # Check results of kernel interface tests.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_TYPES
|
||||
ZFS_AC_KERNEL_ACCESS_OK_TYPE
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE
|
||||
ZFS_AC_KERNEL_OBJTOOL
|
||||
@@ -266,6 +273,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||
ZFS_AC_KERNEL_VFS_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_SPLICE_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_REMAP_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_CLONE_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_DEDUPE_FILE_RANGE
|
||||
@@ -312,8 +320,12 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_WRITEPAGE_T
|
||||
ZFS_AC_KERNEL_RECLAIMED
|
||||
ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
|
||||
ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ
|
||||
ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST
|
||||
ZFS_AC_KERNEL_COPY_SPLICE_READ
|
||||
ZFS_AC_KERNEL_SYNC_BDEV
|
||||
ZFS_AC_KERNEL_MM_PAGE_SIZE
|
||||
ZFS_AC_KERNEL_MM_PAGE_MAPPING
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
dnl
|
||||
dnl backtrace(), for userspace assertions. glibc has this directly in libc.
|
||||
dnl FreeBSD and (sometimes) musl have it in a separate -lexecinfo. It's assumed
|
||||
dnl that this will also get the companion function backtrace_symbols().
|
||||
dnl
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER_BACKTRACE], [
|
||||
AX_SAVE_FLAGS
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS([backtrace], [execinfo], [
|
||||
AC_DEFINE(HAVE_BACKTRACE, 1, [backtrace() is available])
|
||||
AC_SUBST([BACKTRACE_LIBS], ["$LIBS"])
|
||||
])
|
||||
AX_RESTORE_FLAGS
|
||||
])
|
||||
@@ -0,0 +1,44 @@
|
||||
dnl
|
||||
dnl Checks for libunwind, which usually does a better job than backtrace() when
|
||||
dnl resolving symbols in the stack backtrace. Newer versions have support for
|
||||
dnl getting info about the object file the function came from, so we look for
|
||||
dnl that too and use it if found.
|
||||
dnl
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBUNWIND], [
|
||||
AC_ARG_WITH([libunwind],
|
||||
AS_HELP_STRING([--with-libunwind],
|
||||
[use libunwind for backtraces in userspace assertions]),
|
||||
[],
|
||||
[with_libunwind=auto])
|
||||
|
||||
AS_IF([test "x$with_libunwind" != "xno"], [
|
||||
ZFS_AC_FIND_SYSTEM_LIBRARY(LIBUNWIND, [libunwind], [libunwind.h], [], [unwind], [], [
|
||||
dnl unw_get_elf_filename() is sometimes a macro, other
|
||||
dnl times a proper symbol, so we can't just do a link
|
||||
dnl check; we need to include the header properly.
|
||||
AX_SAVE_FLAGS
|
||||
CFLAGS="$CFLAGS $LIBUNWIND_CFLAGS"
|
||||
LIBS="$LIBS $LIBUNWIND_LIBS"
|
||||
AC_MSG_CHECKING([for unw_get_elf_filename in libunwind])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
], [
|
||||
unw_get_elf_filename(0, 0, 0, 0);
|
||||
])
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_LIBUNWIND_ELF, 1,
|
||||
[libunwind has unw_get_elf_filename])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
AX_RESTORE_FLAGS
|
||||
], [
|
||||
AS_IF([test "x$with_libunwind" = "xyes"], [
|
||||
AC_MSG_FAILURE([--with-libunwind was given, but libunwind is not available, try installing libunwind-devel])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
+3
-1
@@ -26,12 +26,14 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
|
||||
ZFS_AC_CONFIG_USER_AIO_H
|
||||
ZFS_AC_CONFIG_USER_CLOCK_GETTIME
|
||||
ZFS_AC_CONFIG_USER_PAM
|
||||
ZFS_AC_CONFIG_USER_BACKTRACE
|
||||
ZFS_AC_CONFIG_USER_LIBUNWIND
|
||||
ZFS_AC_CONFIG_USER_RUNSTATEDIR
|
||||
ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
|
||||
ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
|
||||
ZFS_AC_CONFIG_USER_ZFSEXEC
|
||||
|
||||
AC_CHECK_FUNCS([issetugid mlockall strlcat strlcpy])
|
||||
AC_CHECK_FUNCS([execvpe issetugid mlockall strlcat strlcpy gettid])
|
||||
|
||||
AC_SUBST(RM)
|
||||
])
|
||||
|
||||
+5
-3
@@ -578,13 +578,15 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
|
||||
|
||||
AC_MSG_CHECKING([default shell])
|
||||
case "$VENDOR" in
|
||||
gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";;
|
||||
alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";;
|
||||
*) DEFAULT_INIT_SHELL="/bin/sh" ;;
|
||||
gentoo|alpine) DEFAULT_INIT_SHELL=/sbin/openrc-run
|
||||
IS_SYSV_RC=false ;;
|
||||
*) DEFAULT_INIT_SHELL=/bin/sh
|
||||
IS_SYSV_RC=true ;;
|
||||
esac
|
||||
|
||||
AC_MSG_RESULT([$DEFAULT_INIT_SHELL])
|
||||
AC_SUBST(DEFAULT_INIT_SHELL)
|
||||
AC_SUBST(IS_SYSV_RC)
|
||||
|
||||
AC_MSG_CHECKING([default nfs server init script])
|
||||
AS_IF([test "$VENDOR" = "debian"],
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
/zfs
|
||||
/zpool
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
nodist_bashcompletion_DATA = %D%/zfs
|
||||
SUBSTFILES += $(nodist_bashcompletion_DATA)
|
||||
nodist_bashcompletion_DATA = %D%/zfs %D%/zpool
|
||||
COMPLETION_FILES = %D%/zfs
|
||||
SUBSTFILES += $(COMPLETION_FILES)
|
||||
|
||||
SHELLCHECKSCRIPTS += $(nodist_bashcompletion_DATA)
|
||||
$(call SHELLCHECK_OPTS,$(nodist_bashcompletion_DATA)): SHELLCHECK_SHELL = bash
|
||||
SHELLCHECKSCRIPTS += $(COMPLETION_FILES)
|
||||
$(call SHELLCHECK_OPTS,$(COMPLETION_FILES)): SHELLCHECK_SHELL = bash
|
||||
|
||||
%D%/zpool: %D%/zfs
|
||||
$(LN_S) zfs $@
|
||||
|
||||
@@ -189,7 +189,7 @@ Depends: dkms (>> 2.1.1.2-5),
|
||||
file,
|
||||
libc6-dev | libc-dev,
|
||||
lsb-release,
|
||||
python3-distutils | libpython3-stdlib (<< 3.6.4),
|
||||
python3 (>> 3.12) | python3-distutils | libpython3-stdlib (<< 3.6.4),
|
||||
${misc:Depends},
|
||||
${perl:Depends}
|
||||
Recommends: openzfs-zfs-zed, openzfs-zfsutils (>= ${source:Version}), ${linux:Recommends}
|
||||
|
||||
@@ -7,11 +7,7 @@ DESCRIPTION
|
||||
|
||||
They have been tested successfully on:
|
||||
|
||||
* Debian GNU/Linux Wheezy
|
||||
* Debian GNU/Linux Jessie
|
||||
* Ubuntu Trusty
|
||||
* CentOS 6.0
|
||||
* CentOS 6.6
|
||||
* Debian GNU/Linux Bookworm
|
||||
* Gentoo
|
||||
|
||||
SUPPORT
|
||||
|
||||
@@ -307,7 +307,7 @@ do_start()
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
if [ ! -e /sbin/openrc-run ]
|
||||
if @IS_SYSV_RC@
|
||||
then
|
||||
case "$1" in
|
||||
start)
|
||||
|
||||
@@ -104,7 +104,7 @@ do_stop()
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
if [ ! -e /sbin/openrc-run ]
|
||||
if @IS_SYSV_RC@
|
||||
then
|
||||
case "$1" in
|
||||
start)
|
||||
|
||||
@@ -114,7 +114,7 @@ do_stop()
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
if [ ! -e /sbin/openrc-run ]
|
||||
if @IS_SYSV_RC@
|
||||
then
|
||||
case "$1" in
|
||||
start)
|
||||
|
||||
@@ -57,7 +57,8 @@ do_stop()
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
if [ ! -e /sbin/openrc-run ]; then
|
||||
if @IS_SYSV_RC@
|
||||
then
|
||||
case "$1" in
|
||||
start)
|
||||
do_start
|
||||
|
||||
@@ -93,7 +93,8 @@ do_reload()
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
if [ ! -e /sbin/openrc-run ]; then
|
||||
if @IS_SYSV_RC@
|
||||
then
|
||||
case "$1" in
|
||||
start)
|
||||
do_start
|
||||
|
||||
+4
-2
@@ -21,7 +21,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2022 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright Joyent, Inc.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
* Copyright (c) 2016, Intel Corporation.
|
||||
@@ -157,6 +157,8 @@ typedef enum zfs_error {
|
||||
EZFS_CKSUM, /* insufficient replicas */
|
||||
EZFS_RESUME_EXISTS, /* Resume on existing dataset without force */
|
||||
EZFS_SHAREFAILED, /* filesystem share failed */
|
||||
EZFS_RAIDZ_EXPAND_IN_PROGRESS, /* a raidz is currently expanding */
|
||||
EZFS_ASHIFT_MISMATCH, /* can't add vdevs with different ashifts */
|
||||
EZFS_UNKNOWN
|
||||
} zfs_error_t;
|
||||
|
||||
@@ -260,7 +262,7 @@ _LIBZFS_H boolean_t zpool_skip_pool(const char *);
|
||||
_LIBZFS_H int zpool_create(libzfs_handle_t *, const char *, nvlist_t *,
|
||||
nvlist_t *, nvlist_t *);
|
||||
_LIBZFS_H int zpool_destroy(zpool_handle_t *, const char *);
|
||||
_LIBZFS_H int zpool_add(zpool_handle_t *, nvlist_t *);
|
||||
_LIBZFS_H int zpool_add(zpool_handle_t *, nvlist_t *, boolean_t check_ashift);
|
||||
|
||||
typedef struct splitflags {
|
||||
/* do not split, but return the config that would be split off */
|
||||
|
||||
@@ -4,8 +4,6 @@ noinst_HEADERS = \
|
||||
\
|
||||
%D%/spl/acl/acl_common.h \
|
||||
\
|
||||
%D%/spl/rpc/xdr.h \
|
||||
\
|
||||
%D%/spl/sys/ia32/asm_linkage.h \
|
||||
\
|
||||
%D%/spl/sys/acl.h \
|
||||
@@ -80,7 +78,9 @@ noinst_HEADERS = \
|
||||
%D%/spl/sys/zmod.h \
|
||||
%D%/spl/sys/zone.h \
|
||||
\
|
||||
%D%/zfs/sys/arc_os.h \
|
||||
%D%/zfs/sys/freebsd_crypto.h \
|
||||
%D%/zfs/sys/freebsd_event.h \
|
||||
%D%/zfs/sys/vdev_os.h \
|
||||
%D%/zfs/sys/zfs_bootenv_os.h \
|
||||
%D%/zfs/sys/zfs_context_os.h \
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
|
||||
#ifndef _OPENSOLARIS_RPC_XDR_H_
|
||||
#define _OPENSOLARIS_RPC_XDR_H_
|
||||
|
||||
#include <rpc/types.h>
|
||||
#include_next <rpc/xdr.h>
|
||||
|
||||
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/*
|
||||
* Taken from sys/xdr/xdr_mem.c.
|
||||
*
|
||||
* FreeBSD's userland XDR doesn't implement control method (only the kernel),
|
||||
* but OpenSolaris nvpair still depend on it, so we have to implement it here.
|
||||
*/
|
||||
static __inline bool_t
|
||||
xdrmem_control(XDR *xdrs, int request, void *info)
|
||||
{
|
||||
xdr_bytesrec *xptr;
|
||||
|
||||
switch (request) {
|
||||
case XDR_GET_BYTES_AVAIL:
|
||||
xptr = (xdr_bytesrec *)info;
|
||||
xptr->xc_is_last_record = TRUE;
|
||||
xptr->xc_num_avail = xdrs->x_handy;
|
||||
return (TRUE);
|
||||
default:
|
||||
assert(!"unexpected request");
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
#undef XDR_CONTROL
|
||||
#define XDR_CONTROL(xdrs, req, op) \
|
||||
(((xdrs)->x_ops->x_control == NULL) ? \
|
||||
xdrmem_control((xdrs), (req), (op)) : \
|
||||
(*(xdrs)->x_ops->x_control)(xdrs, req, op))
|
||||
|
||||
#endif /* !_KERNEL && !_STANDALONE */
|
||||
|
||||
#endif /* !_OPENSOLARIS_RPC_XDR_H_ */
|
||||
@@ -138,7 +138,8 @@ typedef int enum_t;
|
||||
#define readdir64 readdir
|
||||
#define dirent64 dirent
|
||||
#endif
|
||||
#define P2ALIGN(x, align) ((x) & -(align))
|
||||
// Deprecated. Use P2ALIGN_TYPED instead.
|
||||
// #define P2ALIGN(x, align) ((x) & -(align))
|
||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||
#define P2PHASE(x, align) ((x) & ((align) - 1))
|
||||
|
||||
@@ -39,12 +39,14 @@
|
||||
* ASSERT3U() - Assert unsigned X OP Y is true, if not panic.
|
||||
* ASSERT3P() - Assert pointer X OP Y is true, if not panic.
|
||||
* ASSERT0() - Assert value is zero, if not panic.
|
||||
* ASSERT0P() - Assert pointer is null, if not panic.
|
||||
* VERIFY() - Verify X is true, if not panic.
|
||||
* VERIFY3B() - Verify boolean X OP Y is true, if not panic.
|
||||
* VERIFY3S() - Verify signed X OP Y is true, if not panic.
|
||||
* VERIFY3U() - Verify unsigned X OP Y is true, if not panic.
|
||||
* VERIFY3P() - Verify pointer X OP Y is true, if not panic.
|
||||
* VERIFY0() - Verify value is zero, if not panic.
|
||||
* VERIFY0P() - Verify pointer is null, if not panic.
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DEBUG_H
|
||||
@@ -89,8 +91,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%d " #OP " %d)\n", \
|
||||
(boolean_t)(_verify3_left), \
|
||||
(boolean_t)(_verify3_right)); \
|
||||
(boolean_t)_verify3_left, \
|
||||
(boolean_t)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
||||
@@ -100,8 +102,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%lld " #OP " %lld)\n", \
|
||||
(long long) (_verify3_left), \
|
||||
(long long) (_verify3_right)); \
|
||||
(long long)_verify3_left, \
|
||||
(long long)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY3U(LEFT, OP, RIGHT) do { \
|
||||
@@ -111,8 +113,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%llu " #OP " %llu)\n", \
|
||||
(unsigned long long) (_verify3_left), \
|
||||
(unsigned long long) (_verify3_right)); \
|
||||
(unsigned long long)_verify3_left, \
|
||||
(unsigned long long)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY3P(LEFT, OP, RIGHT) do { \
|
||||
@@ -121,19 +123,27 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
if (unlikely(!(_verify3_left OP _verify3_right))) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%px " #OP " %px)\n", \
|
||||
(void *) (_verify3_left), \
|
||||
(void *) (_verify3_right)); \
|
||||
"failed (%p " #OP " %p)\n", \
|
||||
(void *)_verify3_left, \
|
||||
(void *)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY0(RIGHT) do { \
|
||||
const int64_t _verify3_left = (int64_t)(0); \
|
||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||
if (unlikely(!(_verify3_left == _verify3_right))) \
|
||||
const int64_t _verify0_right = (int64_t)(RIGHT); \
|
||||
if (unlikely(!(0 == _verify0_right))) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY0(0 == " #RIGHT ") " \
|
||||
"VERIFY0(" #RIGHT ") " \
|
||||
"failed (0 == %lld)\n", \
|
||||
(long long) (_verify3_right)); \
|
||||
(long long)_verify0_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY0P(RIGHT) do { \
|
||||
const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
|
||||
if (unlikely(!(0 == _verify0_right))) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY0P(" #RIGHT ") " \
|
||||
"failed (NULL == %p)\n", \
|
||||
(void *)_verify0_right); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@@ -151,6 +161,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
#define ASSERT3P(x, y, z) \
|
||||
((void) sizeof ((uintptr_t)(x)), (void) sizeof ((uintptr_t)(z)))
|
||||
#define ASSERT0(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define ASSERT0P(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define IMPLY(A, B) \
|
||||
((void) sizeof ((uintptr_t)(A)), (void) sizeof ((uintptr_t)(B)))
|
||||
#define EQUIV(A, B) \
|
||||
@@ -166,6 +177,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
#define ASSERT3U VERIFY3U
|
||||
#define ASSERT3P VERIFY3P
|
||||
#define ASSERT0 VERIFY0
|
||||
#define ASSERT0P VERIFY0P
|
||||
#define ASSERT VERIFY
|
||||
#define IMPLY(A, B) \
|
||||
((void)(likely((!(A)) || (B)) || \
|
||||
|
||||
@@ -31,13 +31,14 @@
|
||||
|
||||
#include_next <sys/sdt.h>
|
||||
#ifdef KDTRACE_HOOKS
|
||||
/* CSTYLED */
|
||||
/* BEGIN CSTYLED */
|
||||
SDT_PROBE_DECLARE(sdt, , , set__error);
|
||||
|
||||
#define SET_ERROR(err) \
|
||||
((sdt_sdt___set__error->id ? \
|
||||
(*sdt_probe_func)(sdt_sdt___set__error->id, \
|
||||
(uintptr_t)err, 0, 0, 0, 0) : 0), err)
|
||||
#define SET_ERROR(err) ({ \
|
||||
SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \
|
||||
err; \
|
||||
})
|
||||
/* END CSTYLED */
|
||||
#else
|
||||
#define SET_ERROR(err) (err)
|
||||
#endif
|
||||
|
||||
@@ -191,7 +191,8 @@ extern unsigned char bcd_to_byte[256];
|
||||
* eg, P2ALIGN(0x1234, 0x100) == 0x1200 (0x12*align)
|
||||
* eg, P2ALIGN(0x5600, 0x100) == 0x5600 (0x56*align)
|
||||
*/
|
||||
#define P2ALIGN(x, align) ((x) & -(align))
|
||||
// Deprecated. Use P2ALIGN_TYPED instead.
|
||||
// #define P2ALIGN(x, align) ((x) & -(align))
|
||||
|
||||
/*
|
||||
* return x % (mod) align
|
||||
|
||||
@@ -5,6 +5,7 @@ kernel_linux_HEADERS = \
|
||||
%D%/kernel/linux/compiler_compat.h \
|
||||
%D%/kernel/linux/dcache_compat.h \
|
||||
%D%/kernel/linux/kmap_compat.h \
|
||||
%D%/kernel/linux/mm_compat.h \
|
||||
%D%/kernel/linux/mod_compat.h \
|
||||
%D%/kernel/linux/page_compat.h \
|
||||
%D%/kernel/linux/percpu_compat.h \
|
||||
@@ -46,6 +47,7 @@ kernel_sys_HEADERS = \
|
||||
|
||||
kernel_spl_rpcdir = $(kerneldir)/spl/rpc
|
||||
kernel_spl_rpc_HEADERS = \
|
||||
%D%/spl/rpc/types.h \
|
||||
%D%/spl/rpc/xdr.h
|
||||
|
||||
kernel_spl_sysdir = $(kerneldir)/spl/sys
|
||||
|
||||
@@ -57,6 +57,11 @@ blk_queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 6.11 API
|
||||
* Setting the flush flags directly is no longer possible; flush flags are set
|
||||
* on the queue_limits structure and passed to blk_disk_alloc(). In this case
|
||||
* we remove this function entirely.
|
||||
*
|
||||
* 4.7 API,
|
||||
* The blk_queue_write_cache() interface has replaced blk_queue_flush()
|
||||
* interface. However, the new interface is GPL-only thus we implement
|
||||
@@ -68,39 +73,43 @@ blk_queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
* new one is GPL-only. Thus if the GPL-only version is detected we
|
||||
* implement our own trivial helper.
|
||||
*/
|
||||
#if !defined(HAVE_BLK_ALLOC_DISK_2ARG) || \
|
||||
!defined(HAVE_BLKDEV_QUEUE_LIMITS_FEATURES)
|
||||
static inline void
|
||||
blk_queue_set_write_cache(struct request_queue *q, bool wc, bool fua)
|
||||
blk_queue_set_write_cache(struct request_queue *q, bool on)
|
||||
{
|
||||
#if defined(HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY)
|
||||
if (wc)
|
||||
if (on) {
|
||||
blk_queue_flag_set(QUEUE_FLAG_WC, q);
|
||||
else
|
||||
blk_queue_flag_clear(QUEUE_FLAG_WC, q);
|
||||
if (fua)
|
||||
blk_queue_flag_set(QUEUE_FLAG_FUA, q);
|
||||
else
|
||||
} else {
|
||||
blk_queue_flag_clear(QUEUE_FLAG_WC, q);
|
||||
blk_queue_flag_clear(QUEUE_FLAG_FUA, q);
|
||||
}
|
||||
#elif defined(HAVE_BLK_QUEUE_WRITE_CACHE)
|
||||
blk_queue_write_cache(q, wc, fua);
|
||||
blk_queue_write_cache(q, on, on);
|
||||
#elif defined(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY)
|
||||
if (wc)
|
||||
q->flush_flags |= REQ_FLUSH;
|
||||
if (fua)
|
||||
q->flush_flags |= REQ_FUA;
|
||||
if (on)
|
||||
q->flush_flags |= REQ_FLUSH | REQ_FUA;
|
||||
else
|
||||
q->flush_flags &= ~(REQ_FLUSH | REQ_FUA);
|
||||
#elif defined(HAVE_BLK_QUEUE_FLUSH)
|
||||
blk_queue_flush(q, (wc ? REQ_FLUSH : 0) | (fua ? REQ_FUA : 0));
|
||||
blk_queue_flush(q, on ? (REQ_FLUSH | REQ_FUA) : 0);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
}
|
||||
#endif /* !HAVE_BLK_ALLOC_DISK_2ARG || !HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */
|
||||
|
||||
static inline void
|
||||
blk_queue_set_read_ahead(struct request_queue *q, unsigned long ra_pages)
|
||||
{
|
||||
#if !defined(HAVE_BLK_QUEUE_UPDATE_READAHEAD) && \
|
||||
!defined(HAVE_DISK_UPDATE_READAHEAD)
|
||||
#ifdef HAVE_BLK_QUEUE_BDI_DYNAMIC
|
||||
#if defined(HAVE_BLK_QUEUE_BDI_DYNAMIC)
|
||||
q->backing_dev_info->ra_pages = ra_pages;
|
||||
#elif defined(HAVE_BLK_QUEUE_DISK_BDI)
|
||||
q->disk->bdi->ra_pages = ra_pages;
|
||||
#else
|
||||
q->backing_dev_info.ra_pages = ra_pages;
|
||||
#endif
|
||||
@@ -563,9 +572,11 @@ static inline boolean_t
|
||||
bdev_discard_supported(struct block_device *bdev)
|
||||
{
|
||||
#if defined(HAVE_BDEV_MAX_DISCARD_SECTORS)
|
||||
return (!!bdev_max_discard_sectors(bdev));
|
||||
return (bdev_max_discard_sectors(bdev) > 0 &&
|
||||
bdev_discard_granularity(bdev) > 0);
|
||||
#elif defined(HAVE_BLK_QUEUE_DISCARD)
|
||||
return (!!blk_queue_discard(bdev_get_queue(bdev)));
|
||||
return (blk_queue_discard(bdev_get_queue(bdev)) > 0 &&
|
||||
bdev_get_queue(bdev)->limits.discard_granularity > 0);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or https://opensource.org/licenses/CDDL-1.0.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2023, 2024, Klara Inc.
|
||||
* Copyright (c) 2024, Rob Norris <robn@despairlabs.com>
|
||||
*/
|
||||
|
||||
#ifndef _ZFS_MM_COMPAT_H
|
||||
#define _ZFS_MM_COMPAT_H
|
||||
|
||||
#include <linux/mm.h>
|
||||
#include <linux/pagemap.h>
|
||||
|
||||
/* 5.4 introduced page_size(). Older kernels can use a trivial macro instead */
|
||||
#ifndef HAVE_MM_PAGE_SIZE
|
||||
#define page_size(p) ((unsigned long)(PAGE_SIZE << compound_order(p)))
|
||||
#endif
|
||||
|
||||
/* 6.11 removed page_mapping(). A simple wrapper around folio_mapping() works */
|
||||
#ifndef HAVE_MM_PAGE_MAPPING
|
||||
#define page_mapping(p) folio_mapping(page_folio(p))
|
||||
#endif
|
||||
|
||||
#endif /* _ZFS_MM_COMPAT_H */
|
||||
@@ -68,6 +68,7 @@ enum scope_prefix_types {
|
||||
zfs_trim,
|
||||
zfs_txg,
|
||||
zfs_vdev,
|
||||
zfs_vdev_disk,
|
||||
zfs_vdev_file,
|
||||
zfs_vdev_mirror,
|
||||
zfs_vnops,
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc.
|
||||
* Written by Ricardo Correia <Ricardo.M.Correia@Sun.COM>
|
||||
*
|
||||
* This file is part of the SPL, Solaris Porting Layer.
|
||||
*
|
||||
* The SPL is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* The SPL is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the SPL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _SPL_RPC_TYPES_H
|
||||
#define _SPL_RPC_TYPES_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Just enough to support rpc/xdr.h */
|
||||
|
||||
typedef int bool_t;
|
||||
|
||||
#endif /* SPL_RPC_TYPES_H */
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef int bool_t;
|
||||
|
||||
/*
|
||||
* XDR enums and types.
|
||||
*/
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
* ASSERT3U() - Assert unsigned X OP Y is true, if not panic.
|
||||
* ASSERT3P() - Assert pointer X OP Y is true, if not panic.
|
||||
* ASSERT0() - Assert value is zero, if not panic.
|
||||
* ASSERT0P() - Assert pointer is null, if not panic.
|
||||
* VERIFY() - Verify X is true, if not panic.
|
||||
* VERIFY3B() - Verify boolean X OP Y is true, if not panic.
|
||||
* VERIFY3S() - Verify signed X OP Y is true, if not panic.
|
||||
* VERIFY3U() - Verify unsigned X OP Y is true, if not panic.
|
||||
* VERIFY3P() - Verify pointer X OP Y is true, if not panic.
|
||||
* VERIFY0() - Verify value is zero, if not panic.
|
||||
* VERIFY0P() - Verify pointer is null, if not panic.
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DEBUG_H
|
||||
@@ -93,8 +95,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%d " #OP " %d)\n", \
|
||||
(boolean_t)(_verify3_left), \
|
||||
(boolean_t)(_verify3_right)); \
|
||||
(boolean_t)_verify3_left, \
|
||||
(boolean_t)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY3S(LEFT, OP, RIGHT) do { \
|
||||
@@ -104,8 +106,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%lld " #OP " %lld)\n", \
|
||||
(long long)(_verify3_left), \
|
||||
(long long)(_verify3_right)); \
|
||||
(long long)_verify3_left, \
|
||||
(long long)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY3U(LEFT, OP, RIGHT) do { \
|
||||
@@ -115,8 +117,8 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%llu " #OP " %llu)\n", \
|
||||
(unsigned long long)(_verify3_left), \
|
||||
(unsigned long long)(_verify3_right)); \
|
||||
(unsigned long long)_verify3_left, \
|
||||
(unsigned long long)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY3P(LEFT, OP, RIGHT) do { \
|
||||
@@ -126,18 +128,26 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%px " #OP " %px)\n", \
|
||||
(void *) (_verify3_left), \
|
||||
(void *) (_verify3_right)); \
|
||||
(void *)_verify3_left, \
|
||||
(void *)_verify3_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY0(RIGHT) do { \
|
||||
const int64_t _verify3_left = (int64_t)(0); \
|
||||
const int64_t _verify3_right = (int64_t)(RIGHT); \
|
||||
if (unlikely(!(_verify3_left == _verify3_right))) \
|
||||
const int64_t _verify0_right = (int64_t)(RIGHT); \
|
||||
if (unlikely(!(0 == _verify0_right))) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY0(0 == " #RIGHT ") " \
|
||||
"VERIFY0(" #RIGHT ") " \
|
||||
"failed (0 == %lld)\n", \
|
||||
(long long) (_verify3_right)); \
|
||||
(long long)_verify0_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY0P(RIGHT) do { \
|
||||
const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
|
||||
if (unlikely(!(0 == _verify0_right))) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY0P(" #RIGHT ") " \
|
||||
"failed (NULL == %px)\n", \
|
||||
(void *)_verify0_right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY_IMPLY(A, B) \
|
||||
@@ -165,6 +175,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
#define ASSERT3P(x, y, z) \
|
||||
((void) sizeof ((uintptr_t)(x)), (void) sizeof ((uintptr_t)(z)))
|
||||
#define ASSERT0(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define ASSERT0P(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define IMPLY(A, B) \
|
||||
((void) sizeof ((uintptr_t)(A)), (void) sizeof ((uintptr_t)(B)))
|
||||
#define EQUIV(A, B) \
|
||||
@@ -180,6 +191,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
#define ASSERT3U VERIFY3U
|
||||
#define ASSERT3P VERIFY3P
|
||||
#define ASSERT0 VERIFY0
|
||||
#define ASSERT0P VERIFY0P
|
||||
#define ASSERT VERIFY
|
||||
#define IMPLY VERIFY_IMPLY
|
||||
#define EQUIV VERIFY_EQUIV
|
||||
|
||||
@@ -192,22 +192,25 @@ extern void spl_kmem_reap(void);
|
||||
extern uint64_t spl_kmem_cache_inuse(kmem_cache_t *cache);
|
||||
extern uint64_t spl_kmem_cache_entry_size(kmem_cache_t *cache);
|
||||
|
||||
#ifndef SPL_KMEM_CACHE_IMPLEMENTING
|
||||
/*
|
||||
* Macros for the kmem_cache_* API expected by ZFS and SPL clients. We don't
|
||||
* define them inside spl-kmem-cache.c, as that uses the kernel's incompatible
|
||||
* kmem_cache_* facilities to implement ours.
|
||||
*/
|
||||
|
||||
/* Avoid conflicts with kernel names that might be implemented as macros. */
|
||||
#undef kmem_cache_alloc
|
||||
|
||||
#define kmem_cache_create(name, size, align, ctor, dtor, rclm, priv, vmp, fl) \
|
||||
spl_kmem_cache_create(name, size, align, ctor, dtor, rclm, priv, vmp, fl)
|
||||
#define kmem_cache_set_move(skc, move) spl_kmem_cache_set_move(skc, move)
|
||||
#define kmem_cache_destroy(skc) spl_kmem_cache_destroy(skc)
|
||||
/*
|
||||
* This is necessary to be compatible with other kernel modules
|
||||
* or in-tree filesystem that may define kmem_cache_alloc,
|
||||
* like bcachefs does it now.
|
||||
*/
|
||||
#ifdef kmem_cache_alloc
|
||||
#undef kmem_cache_alloc
|
||||
#endif
|
||||
#define kmem_cache_alloc(skc, flags) spl_kmem_cache_alloc(skc, flags)
|
||||
#define kmem_cache_free(skc, obj) spl_kmem_cache_free(skc, obj)
|
||||
#define kmem_cache_reap_now(skc) spl_kmem_cache_reap_now(skc)
|
||||
#define kmem_reap() spl_kmem_reap()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following functions are only available for internal use.
|
||||
|
||||
@@ -159,7 +159,8 @@ makedev(unsigned int major, unsigned int minor)
|
||||
/*
|
||||
* Compatibility macros/typedefs needed for Solaris -> Linux port
|
||||
*/
|
||||
#define P2ALIGN(x, align) ((x) & -(align))
|
||||
// Deprecated. Use P2ALIGN_TYPED instead.
|
||||
// #define P2ALIGN(x, align) ((x) & -(align))
|
||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||
#define P2PHASE(x, align) ((x) & ((align) - 1))
|
||||
|
||||
@@ -104,7 +104,7 @@ typedef struct taskq {
|
||||
/* list node for the cpu hotplug callback */
|
||||
struct hlist_node tq_hp_cb_node;
|
||||
boolean_t tq_hp_support;
|
||||
unsigned long lastshouldstop; /* when to purge dynamic */
|
||||
unsigned long lastspawnstop; /* when to purge dynamic */
|
||||
} taskq_t;
|
||||
|
||||
typedef struct taskq_ent {
|
||||
|
||||
@@ -38,7 +38,9 @@ typedef unsigned long ulong_t;
|
||||
typedef unsigned long long u_longlong_t;
|
||||
typedef long long longlong_t;
|
||||
|
||||
#ifndef HAVE_KERNEL_INTPTR_T
|
||||
typedef long intptr_t;
|
||||
#endif
|
||||
typedef unsigned long long rlim64_t;
|
||||
|
||||
typedef struct task_struct kthread_t;
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
snprintf(__get_str(msg), TRACE_DBUF_MSG_MAX, \
|
||||
DBUF_TP_PRINTK_FMT, DBUF_TP_PRINTK_ARGS); \
|
||||
} else { \
|
||||
__assign_str(os_spa, "NULL") \
|
||||
__assign_str(os_spa, "NULL"); \
|
||||
__entry->ds_object = 0; \
|
||||
__entry->db_object = 0; \
|
||||
__entry->db_level = 0; \
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
__field(uint64_t, zl_parse_lr_seq) \
|
||||
__field(uint64_t, zl_parse_blk_count) \
|
||||
__field(uint64_t, zl_parse_lr_count) \
|
||||
__field(uint64_t, zl_cur_used) \
|
||||
__field(uint64_t, zl_cur_size) \
|
||||
__field(uint64_t, zl_cur_left) \
|
||||
__field(uint64_t, zl_cur_max) \
|
||||
__field(clock_t, zl_replay_time) \
|
||||
__field(uint64_t, zl_replay_blks)
|
||||
|
||||
@@ -72,7 +74,9 @@
|
||||
__entry->zl_parse_lr_seq = zilog->zl_parse_lr_seq; \
|
||||
__entry->zl_parse_blk_count = zilog->zl_parse_blk_count;\
|
||||
__entry->zl_parse_lr_count = zilog->zl_parse_lr_count; \
|
||||
__entry->zl_cur_used = zilog->zl_cur_used; \
|
||||
__entry->zl_cur_size = zilog->zl_cur_size; \
|
||||
__entry->zl_cur_left = zilog->zl_cur_left; \
|
||||
__entry->zl_cur_max = zilog->zl_cur_max; \
|
||||
__entry->zl_replay_time = zilog->zl_replay_time; \
|
||||
__entry->zl_replay_blks = zilog->zl_replay_blks;
|
||||
|
||||
@@ -82,7 +86,8 @@
|
||||
"replay %u stop_sync %u logbias %u sync %u " \
|
||||
"parse_error %u parse_blk_seq %llu parse_lr_seq %llu " \
|
||||
"parse_blk_count %llu parse_lr_count %llu " \
|
||||
"cur_used %llu replay_time %lu replay_blks %llu }"
|
||||
"cur_size %llu cur_left %llu cur_max %llu replay_time %lu " \
|
||||
"replay_blks %llu }"
|
||||
|
||||
#define ZILOG_TP_PRINTK_ARGS \
|
||||
__entry->zl_lr_seq, __entry->zl_commit_lr_seq, \
|
||||
@@ -92,7 +97,8 @@
|
||||
__entry->zl_stop_sync, __entry->zl_logbias, __entry->zl_sync, \
|
||||
__entry->zl_parse_error, __entry->zl_parse_blk_seq, \
|
||||
__entry->zl_parse_lr_seq, __entry->zl_parse_blk_count, \
|
||||
__entry->zl_parse_lr_count, __entry->zl_cur_used, \
|
||||
__entry->zl_parse_lr_count, __entry->zl_cur_size, \
|
||||
__entry->zl_cur_left, __entry->zl_cur_max, \
|
||||
__entry->zl_replay_time, __entry->zl_replay_blks
|
||||
|
||||
#define ITX_TP_STRUCT_ENTRY \
|
||||
|
||||
@@ -79,6 +79,9 @@ typedef struct abd {
|
||||
|
||||
typedef int abd_iter_func_t(void *buf, size_t len, void *priv);
|
||||
typedef int abd_iter_func2_t(void *bufa, void *bufb, size_t len, void *priv);
|
||||
#if defined(__linux__) && defined(_KERNEL)
|
||||
typedef int abd_iter_page_func_t(struct page *, size_t, size_t, void *);
|
||||
#endif
|
||||
|
||||
extern int zfs_abd_scatter_enabled;
|
||||
|
||||
@@ -125,6 +128,10 @@ void abd_release_ownership_of_buf(abd_t *);
|
||||
int abd_iterate_func(abd_t *, size_t, size_t, abd_iter_func_t *, void *);
|
||||
int abd_iterate_func2(abd_t *, abd_t *, size_t, size_t, size_t,
|
||||
abd_iter_func2_t *, void *);
|
||||
#if defined(__linux__) && defined(_KERNEL)
|
||||
int abd_iterate_page_func(abd_t *, size_t, size_t, abd_iter_page_func_t *,
|
||||
void *);
|
||||
#endif
|
||||
void abd_copy_off(abd_t *, abd_t *, size_t, size_t, size_t);
|
||||
void abd_copy_from_buf_off(abd_t *, const void *, size_t, size_t);
|
||||
void abd_copy_to_buf_off(void *, abd_t *, size_t, size_t);
|
||||
@@ -213,6 +220,8 @@ void abd_fini(void);
|
||||
|
||||
/*
|
||||
* Linux ABD bio functions
|
||||
* Note: these are only needed to support vdev_classic. See comment in
|
||||
* vdev_disk.c.
|
||||
*/
|
||||
#if defined(__linux__) && defined(_KERNEL)
|
||||
unsigned int abd_bio_map_off(struct bio *, abd_t *, unsigned int, size_t);
|
||||
|
||||
+23
-3
@@ -21,6 +21,7 @@
|
||||
/*
|
||||
* Copyright (c) 2014 by Chunwei Chen. All rights reserved.
|
||||
* Copyright (c) 2016, 2019 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2023, 2024, Klara Inc.
|
||||
*/
|
||||
|
||||
#ifndef _ABD_IMPL_H
|
||||
@@ -38,12 +39,30 @@ typedef enum abd_stats_op {
|
||||
ABDSTAT_DECR /* Decrease abdstat values */
|
||||
} abd_stats_op_t;
|
||||
|
||||
struct scatterlist; /* forward declaration */
|
||||
/* forward declarations */
|
||||
struct scatterlist;
|
||||
struct page;
|
||||
|
||||
struct abd_iter {
|
||||
/* public interface */
|
||||
void *iter_mapaddr; /* addr corresponding to iter_pos */
|
||||
size_t iter_mapsize; /* length of data valid at mapaddr */
|
||||
union {
|
||||
/* for abd_iter_map()/abd_iter_unmap() */
|
||||
struct {
|
||||
/* addr corresponding to iter_pos */
|
||||
void *iter_mapaddr;
|
||||
/* length of data valid at mapaddr */
|
||||
size_t iter_mapsize;
|
||||
};
|
||||
/* for abd_iter_page() */
|
||||
struct {
|
||||
/* current page */
|
||||
struct page *iter_page;
|
||||
/* offset of data in page */
|
||||
size_t iter_page_doff;
|
||||
/* size of data in page */
|
||||
size_t iter_page_dsize;
|
||||
};
|
||||
};
|
||||
|
||||
/* private */
|
||||
abd_t *iter_abd; /* ABD being iterated through */
|
||||
@@ -78,6 +97,7 @@ boolean_t abd_iter_at_end(struct abd_iter *);
|
||||
void abd_iter_advance(struct abd_iter *, size_t);
|
||||
void abd_iter_map(struct abd_iter *);
|
||||
void abd_iter_unmap(struct abd_iter *);
|
||||
void abd_iter_page(struct abd_iter *);
|
||||
|
||||
/*
|
||||
* Helper macros
|
||||
|
||||
+3
-2
@@ -739,8 +739,6 @@ void *dmu_buf_remove_user(dmu_buf_t *db, dmu_buf_user_t *user);
|
||||
void *dmu_buf_get_user(dmu_buf_t *db);
|
||||
|
||||
objset_t *dmu_buf_get_objset(dmu_buf_t *db);
|
||||
dnode_t *dmu_buf_dnode_enter(dmu_buf_t *db);
|
||||
void dmu_buf_dnode_exit(dmu_buf_t *db);
|
||||
|
||||
/* Block until any in-progress dmu buf user evictions complete. */
|
||||
void dmu_buf_user_evict_wait(void);
|
||||
@@ -889,6 +887,9 @@ extern uint_t zfs_max_recordsize;
|
||||
*/
|
||||
void dmu_prefetch(objset_t *os, uint64_t object, int64_t level, uint64_t offset,
|
||||
uint64_t len, enum zio_priority pri);
|
||||
void dmu_prefetch_by_dnode(dnode_t *dn, int64_t level, uint64_t offset,
|
||||
uint64_t len, enum zio_priority pri);
|
||||
void dmu_prefetch_dnode(objset_t *os, uint64_t object, enum zio_priority pri);
|
||||
|
||||
typedef struct dmu_object_info {
|
||||
/* All sizes are in bytes unless otherwise indicated. */
|
||||
|
||||
@@ -132,6 +132,7 @@ struct objset {
|
||||
zfs_logbias_op_t os_logbias;
|
||||
zfs_cache_type_t os_primary_cache;
|
||||
zfs_cache_type_t os_secondary_cache;
|
||||
zfs_prefetch_type_t os_prefetch;
|
||||
zfs_sync_type_t os_sync;
|
||||
zfs_redundant_metadata_type_t os_redundant_metadata;
|
||||
uint64_t os_recordsize;
|
||||
|
||||
@@ -45,18 +45,24 @@ typedef struct zfetch {
|
||||
int zf_numstreams; /* number of zstream_t's */
|
||||
} zfetch_t;
|
||||
|
||||
typedef struct zsrange {
|
||||
uint16_t start;
|
||||
uint16_t end;
|
||||
} zsrange_t;
|
||||
|
||||
#define ZFETCH_RANGES 9 /* Fits zstream_t into 128 bytes */
|
||||
|
||||
typedef struct zstream {
|
||||
list_node_t zs_node; /* link for zf_stream */
|
||||
uint64_t zs_blkid; /* expect next access at this blkid */
|
||||
uint_t zs_atime; /* time last prefetch issued */
|
||||
zsrange_t zs_ranges[ZFETCH_RANGES]; /* ranges from future */
|
||||
unsigned int zs_pf_dist; /* data prefetch distance in bytes */
|
||||
unsigned int zs_ipf_dist; /* L1 prefetch distance in bytes */
|
||||
uint64_t zs_pf_start; /* first data block to prefetch */
|
||||
uint64_t zs_pf_end; /* data block to prefetch up to */
|
||||
uint64_t zs_ipf_start; /* first data block to prefetch L1 */
|
||||
uint64_t zs_ipf_end; /* data block to prefetch L1 up to */
|
||||
|
||||
list_node_t zs_node; /* link for zf_stream */
|
||||
hrtime_t zs_atime; /* time last prefetch issued */
|
||||
zfetch_t *zs_fetch; /* parent fetch */
|
||||
boolean_t zs_missed; /* stream saw cache misses */
|
||||
boolean_t zs_more; /* need more distant prefetch */
|
||||
zfs_refcount_t zs_callers; /* number of pending callers */
|
||||
@@ -74,7 +80,7 @@ void dmu_zfetch_init(zfetch_t *, struct dnode *);
|
||||
void dmu_zfetch_fini(zfetch_t *);
|
||||
zstream_t *dmu_zfetch_prepare(zfetch_t *, uint64_t, uint64_t, boolean_t,
|
||||
boolean_t);
|
||||
void dmu_zfetch_run(zstream_t *, boolean_t, boolean_t);
|
||||
void dmu_zfetch_run(zfetch_t *, zstream_t *, boolean_t, boolean_t);
|
||||
void dmu_zfetch(zfetch_t *, uint64_t, uint64_t, boolean_t, boolean_t,
|
||||
boolean_t);
|
||||
|
||||
|
||||
@@ -173,6 +173,7 @@ typedef struct dsl_scan {
|
||||
dsl_scan_phys_t scn_phys; /* on disk representation of scan */
|
||||
dsl_scan_phys_t scn_phys_cached;
|
||||
avl_tree_t scn_queue; /* queue of datasets to scan */
|
||||
kmutex_t scn_queue_lock; /* serializes scn_queue inserts */
|
||||
uint64_t scn_queues_pending; /* outstanding data to issue */
|
||||
/* members needed for syncing error scrub status to disk */
|
||||
dsl_errorscrub_phys_t errorscrub_phys;
|
||||
|
||||
@@ -82,6 +82,8 @@ extern "C" {
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_CKSUM_T "vdev_cksum_t"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_IO_N "vdev_io_n"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_IO_T "vdev_io_t"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_SLOW_IO_N "vdev_slow_io_n"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_SLOW_IO_T "vdev_slow_io_t"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_DELAYS "vdev_delays"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_GUID "parent_guid"
|
||||
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_TYPE "parent_type"
|
||||
|
||||
+13
-1
@@ -21,7 +21,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013, 2017 Joyent, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Integros [integros.com]
|
||||
@@ -191,6 +191,7 @@ typedef enum {
|
||||
ZFS_PROP_REDACTED,
|
||||
ZFS_PROP_REDACT_SNAPS,
|
||||
ZFS_PROP_SNAPSHOTS_CHANGED,
|
||||
ZFS_PROP_PREFETCH,
|
||||
ZFS_NUM_PROPS
|
||||
} zfs_prop_t;
|
||||
|
||||
@@ -363,6 +364,9 @@ typedef enum {
|
||||
VDEV_PROP_CHECKSUM_T,
|
||||
VDEV_PROP_IO_N,
|
||||
VDEV_PROP_IO_T,
|
||||
VDEV_PROP_RAIDZ_EXPANDING,
|
||||
VDEV_PROP_SLOW_IO_N,
|
||||
VDEV_PROP_SLOW_IO_T,
|
||||
VDEV_NUM_PROPS
|
||||
} vdev_prop_t;
|
||||
|
||||
@@ -543,6 +547,12 @@ typedef enum zfs_key_location {
|
||||
ZFS_KEYLOCATION_LOCATIONS
|
||||
} zfs_keylocation_t;
|
||||
|
||||
typedef enum {
|
||||
ZFS_PREFETCH_NONE = 0,
|
||||
ZFS_PREFETCH_METADATA = 1,
|
||||
ZFS_PREFETCH_ALL = 2
|
||||
} zfs_prefetch_type_t;
|
||||
|
||||
#define DEFAULT_PBKDF2_ITERATIONS 350000
|
||||
#define MIN_PBKDF2_ITERATIONS 100000
|
||||
|
||||
@@ -1569,6 +1579,8 @@ typedef enum {
|
||||
ZFS_ERR_NOT_USER_NAMESPACE,
|
||||
ZFS_ERR_RESUME_EXISTS,
|
||||
ZFS_ERR_CRYPTO_NOTSUP,
|
||||
ZFS_ERR_RAIDZ_EXPAND_IN_PROGRESS,
|
||||
ZFS_ERR_ASHIFT_MISMATCH,
|
||||
} zfs_errno_t;
|
||||
|
||||
/*
|
||||
|
||||
@@ -82,12 +82,15 @@ int multilist_is_empty(multilist_t *);
|
||||
unsigned int multilist_get_num_sublists(multilist_t *);
|
||||
unsigned int multilist_get_random_index(multilist_t *);
|
||||
|
||||
multilist_sublist_t *multilist_sublist_lock(multilist_t *, unsigned int);
|
||||
void multilist_sublist_lock(multilist_sublist_t *);
|
||||
multilist_sublist_t *multilist_sublist_lock_idx(multilist_t *, unsigned int);
|
||||
multilist_sublist_t *multilist_sublist_lock_obj(multilist_t *, void *);
|
||||
void multilist_sublist_unlock(multilist_sublist_t *);
|
||||
|
||||
void multilist_sublist_insert_head(multilist_sublist_t *, void *);
|
||||
void multilist_sublist_insert_tail(multilist_sublist_t *, void *);
|
||||
void multilist_sublist_insert_after(multilist_sublist_t *, void *, void *);
|
||||
void multilist_sublist_insert_before(multilist_sublist_t *, void *, void *);
|
||||
void multilist_sublist_move_forward(multilist_sublist_t *mls, void *obj);
|
||||
void multilist_sublist_remove(multilist_sublist_t *, void *);
|
||||
int multilist_sublist_is_empty(multilist_sublist_t *);
|
||||
|
||||
+9
-3
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2021 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
|
||||
* Copyright 2013 Saso Kiselkov. All rights reserved.
|
||||
@@ -769,7 +769,7 @@ extern int bpobj_enqueue_free_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx);
|
||||
|
||||
#define SPA_ASYNC_CONFIG_UPDATE 0x01
|
||||
#define SPA_ASYNC_REMOVE 0x02
|
||||
#define SPA_ASYNC_PROBE 0x04
|
||||
#define SPA_ASYNC_FAULT_VDEV 0x04
|
||||
#define SPA_ASYNC_RESILVER_DONE 0x08
|
||||
#define SPA_ASYNC_RESILVER 0x10
|
||||
#define SPA_ASYNC_AUTOEXPAND 0x20
|
||||
@@ -784,7 +784,7 @@ extern int bpobj_enqueue_free_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx);
|
||||
#define SPA_ASYNC_DETACH_SPARE 0x4000
|
||||
|
||||
/* device manipulation */
|
||||
extern int spa_vdev_add(spa_t *spa, nvlist_t *nvroot);
|
||||
extern int spa_vdev_add(spa_t *spa, nvlist_t *nvroot, boolean_t ashift_check);
|
||||
extern int spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot,
|
||||
int replacing, int rebuild);
|
||||
extern int spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid,
|
||||
@@ -966,6 +966,10 @@ extern int spa_import_progress_set_max_txg(uint64_t pool_guid,
|
||||
uint64_t max_txg);
|
||||
extern int spa_import_progress_set_state(uint64_t pool_guid,
|
||||
spa_load_state_t spa_load_state);
|
||||
extern void spa_import_progress_set_notes(spa_t *spa,
|
||||
const char *fmt, ...) __printflike(2, 3);
|
||||
extern void spa_import_progress_set_notes_nolog(spa_t *spa,
|
||||
const char *fmt, ...) __printflike(2, 3);
|
||||
|
||||
/* Pool configuration locks */
|
||||
extern int spa_config_tryenter(spa_t *spa, int locks, const void *tag,
|
||||
@@ -1109,6 +1113,8 @@ extern uint32_t spa_get_hostid(spa_t *spa);
|
||||
extern void spa_activate_allocation_classes(spa_t *, dmu_tx_t *);
|
||||
extern boolean_t spa_livelist_delete_check(spa_t *spa);
|
||||
|
||||
extern boolean_t spa_mmp_remote_host_activity(spa_t *spa);
|
||||
|
||||
extern spa_mode_t spa_mode(spa_t *spa);
|
||||
extern uint64_t zfs_strtonum(const char *str, char **nptr);
|
||||
|
||||
|
||||
@@ -50,20 +50,20 @@ extern "C" {
|
||||
#define MMP_SEQ_VALID_BIT 0x02
|
||||
#define MMP_FAIL_INT_VALID_BIT 0x04
|
||||
|
||||
#define MMP_VALID(ubp) (ubp->ub_magic == UBERBLOCK_MAGIC && \
|
||||
ubp->ub_mmp_magic == MMP_MAGIC)
|
||||
#define MMP_INTERVAL_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \
|
||||
#define MMP_VALID(ubp) ((ubp)->ub_magic == UBERBLOCK_MAGIC && \
|
||||
(ubp)->ub_mmp_magic == MMP_MAGIC)
|
||||
#define MMP_INTERVAL_VALID(ubp) (MMP_VALID(ubp) && ((ubp)->ub_mmp_config & \
|
||||
MMP_INTERVAL_VALID_BIT))
|
||||
#define MMP_SEQ_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \
|
||||
#define MMP_SEQ_VALID(ubp) (MMP_VALID(ubp) && ((ubp)->ub_mmp_config & \
|
||||
MMP_SEQ_VALID_BIT))
|
||||
#define MMP_FAIL_INT_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \
|
||||
#define MMP_FAIL_INT_VALID(ubp) (MMP_VALID(ubp) && ((ubp)->ub_mmp_config & \
|
||||
MMP_FAIL_INT_VALID_BIT))
|
||||
|
||||
#define MMP_INTERVAL(ubp) ((ubp->ub_mmp_config & 0x00000000FFFFFF00) \
|
||||
#define MMP_INTERVAL(ubp) (((ubp)->ub_mmp_config & 0x00000000FFFFFF00) \
|
||||
>> 8)
|
||||
#define MMP_SEQ(ubp) ((ubp->ub_mmp_config & 0x0000FFFF00000000) \
|
||||
#define MMP_SEQ(ubp) (((ubp)->ub_mmp_config & 0x0000FFFF00000000) \
|
||||
>> 32)
|
||||
#define MMP_FAIL_INT(ubp) ((ubp->ub_mmp_config & 0xFFFF000000000000) \
|
||||
#define MMP_FAIL_INT(ubp) (((ubp)->ub_mmp_config & 0xFFFF000000000000) \
|
||||
>> 48)
|
||||
|
||||
#define MMP_INTERVAL_SET(write) \
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2017, Intel Corporation.
|
||||
* Copyright (c) 2023, Klara Inc.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_VDEV_IMPL_H
|
||||
@@ -273,7 +274,7 @@ struct vdev {
|
||||
txg_list_t vdev_dtl_list; /* per-txg dirty DTL lists */
|
||||
txg_node_t vdev_txg_node; /* per-txg dirty vdev linkage */
|
||||
boolean_t vdev_remove_wanted; /* async remove wanted? */
|
||||
boolean_t vdev_probe_wanted; /* async probe wanted? */
|
||||
boolean_t vdev_fault_wanted; /* async faulted wanted? */
|
||||
list_node_t vdev_config_dirty_node; /* config dirty list */
|
||||
list_node_t vdev_state_dirty_node; /* state dirty list */
|
||||
uint64_t vdev_deflate_ratio; /* deflation ratio (x512) */
|
||||
@@ -453,12 +454,14 @@ struct vdev {
|
||||
zfs_ratelimit_t vdev_checksum_rl;
|
||||
|
||||
/*
|
||||
* Checksum and IO thresholds for tuning ZED
|
||||
* Vdev properties for tuning ZED or zfsd
|
||||
*/
|
||||
uint64_t vdev_checksum_n;
|
||||
uint64_t vdev_checksum_t;
|
||||
uint64_t vdev_io_n;
|
||||
uint64_t vdev_io_t;
|
||||
uint64_t vdev_slow_io_n;
|
||||
uint64_t vdev_slow_io_t;
|
||||
};
|
||||
|
||||
#define VDEV_PAD_SIZE (8 << 10)
|
||||
|
||||
@@ -253,6 +253,9 @@ int zap_add_by_dnode(dnode_t *dn, const char *key,
|
||||
int zap_add_uint64(objset_t *ds, uint64_t zapobj, const uint64_t *key,
|
||||
int key_numints, int integer_size, uint64_t num_integers,
|
||||
const void *val, dmu_tx_t *tx);
|
||||
int zap_add_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
|
||||
int key_numints, int integer_size, uint64_t num_integers,
|
||||
const void *val, dmu_tx_t *tx);
|
||||
|
||||
/*
|
||||
* Set the attribute with the given name to the given value. If an
|
||||
@@ -267,6 +270,9 @@ int zap_update(objset_t *ds, uint64_t zapobj, const char *name,
|
||||
int zap_update_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
|
||||
int key_numints,
|
||||
int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx);
|
||||
int zap_update_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
|
||||
int key_numints,
|
||||
int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx);
|
||||
|
||||
/*
|
||||
* Get the length (in integers) and the integer size of the specified
|
||||
@@ -292,6 +298,8 @@ int zap_remove_norm(objset_t *ds, uint64_t zapobj, const char *name,
|
||||
int zap_remove_by_dnode(dnode_t *dn, const char *name, dmu_tx_t *tx);
|
||||
int zap_remove_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
|
||||
int key_numints, dmu_tx_t *tx);
|
||||
int zap_remove_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
|
||||
int key_numints, dmu_tx_t *tx);
|
||||
|
||||
/*
|
||||
* Returns (in *count) the number of attributes in the specified zap
|
||||
|
||||
@@ -145,6 +145,7 @@ typedef struct zap {
|
||||
dmu_buf_user_t zap_dbu;
|
||||
objset_t *zap_objset;
|
||||
uint64_t zap_object;
|
||||
dnode_t *zap_dnode;
|
||||
struct dmu_buf *zap_dbuf;
|
||||
krwlock_t zap_rwlock;
|
||||
boolean_t zap_ismicro;
|
||||
|
||||
@@ -47,7 +47,7 @@ struct zap_stats;
|
||||
* entries - header space (2*chunksize)
|
||||
*/
|
||||
#define ZAP_LEAF_NUMCHUNKS_BS(bs) \
|
||||
(((1<<(bs)) - 2*ZAP_LEAF_HASH_NUMENTRIES_BS(bs)) / \
|
||||
(((1U << (bs)) - 2 * ZAP_LEAF_HASH_NUMENTRIES_BS(bs)) / \
|
||||
ZAP_LEAF_CHUNKSIZE - 2)
|
||||
|
||||
#define ZAP_LEAF_NUMCHUNKS(l) (ZAP_LEAF_NUMCHUNKS_BS(((l)->l_bs)))
|
||||
@@ -80,7 +80,7 @@ struct zap_stats;
|
||||
* chunks per entry (3).
|
||||
*/
|
||||
#define ZAP_LEAF_HASH_SHIFT_BS(bs) ((bs) - 5)
|
||||
#define ZAP_LEAF_HASH_NUMENTRIES_BS(bs) (1 << ZAP_LEAF_HASH_SHIFT_BS(bs))
|
||||
#define ZAP_LEAF_HASH_NUMENTRIES_BS(bs) (1U << ZAP_LEAF_HASH_SHIFT_BS(bs))
|
||||
#define ZAP_LEAF_HASH_SHIFT(l) (ZAP_LEAF_HASH_SHIFT_BS(((l)->l_bs)))
|
||||
#define ZAP_LEAF_HASH_NUMENTRIES(l) (ZAP_LEAF_HASH_NUMENTRIES_BS(((l)->l_bs)))
|
||||
|
||||
@@ -132,7 +132,7 @@ typedef struct zap_leaf_phys {
|
||||
* with the ZAP_LEAF_CHUNK() macro.
|
||||
*/
|
||||
|
||||
uint16_t l_hash[1];
|
||||
uint16_t l_hash[];
|
||||
} zap_leaf_phys_t;
|
||||
|
||||
typedef union zap_leaf_chunk {
|
||||
@@ -163,7 +163,7 @@ typedef struct zap_leaf {
|
||||
dmu_buf_user_t l_dbu;
|
||||
krwlock_t l_rwlock;
|
||||
uint64_t l_blkid; /* 1<<ZAP_BLOCK_SHIFT byte block off */
|
||||
int l_bs; /* block size shift */
|
||||
uint_t l_bs; /* block size shift */
|
||||
dmu_buf_t *l_dbuf;
|
||||
} zap_leaf_t;
|
||||
|
||||
@@ -243,7 +243,7 @@ extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh,
|
||||
*/
|
||||
|
||||
extern void zap_leaf_init(zap_leaf_t *l, boolean_t sort);
|
||||
extern void zap_leaf_byteswap(zap_leaf_phys_t *buf, int len);
|
||||
extern void zap_leaf_byteswap(zap_leaf_phys_t *buf, size_t len);
|
||||
extern void zap_leaf_split(zap_leaf_t *l, zap_leaf_t *nl, boolean_t sort);
|
||||
extern void zap_leaf_stats(struct zap *zap, zap_leaf_t *l,
|
||||
struct zap_stats *zs);
|
||||
|
||||
@@ -181,7 +181,7 @@ typedef struct zil_vdev_node {
|
||||
avl_node_t zv_node; /* AVL tree linkage */
|
||||
} zil_vdev_node_t;
|
||||
|
||||
#define ZIL_PREV_BLKS 16
|
||||
#define ZIL_BURSTS 8
|
||||
|
||||
/*
|
||||
* Stable storage intent log management structure. One per dataset.
|
||||
@@ -216,14 +216,18 @@ struct zilog {
|
||||
uint64_t zl_parse_lr_count; /* number of log records parsed */
|
||||
itxg_t zl_itxg[TXG_SIZE]; /* intent log txg chains */
|
||||
list_t zl_itx_commit_list; /* itx list to be committed */
|
||||
uint64_t zl_cur_used; /* current commit log size used */
|
||||
uint64_t zl_cur_size; /* current burst full size */
|
||||
uint64_t zl_cur_left; /* current burst remaining size */
|
||||
uint64_t zl_cur_max; /* biggest record in current burst */
|
||||
list_t zl_lwb_list; /* in-flight log write list */
|
||||
avl_tree_t zl_bp_tree; /* track bps during log parse */
|
||||
clock_t zl_replay_time; /* lbolt of when replay started */
|
||||
uint64_t zl_replay_blks; /* number of log blocks replayed */
|
||||
zil_header_t zl_old_header; /* debugging aid */
|
||||
uint_t zl_prev_blks[ZIL_PREV_BLKS]; /* size - sector rounded */
|
||||
uint_t zl_parallel; /* workload is multi-threaded */
|
||||
uint_t zl_prev_rotor; /* rotor for zl_prev[] */
|
||||
uint_t zl_prev_opt[ZIL_BURSTS]; /* optimal block size */
|
||||
uint_t zl_prev_min[ZIL_BURSTS]; /* minimal first block size */
|
||||
txg_node_t zl_dirty_link; /* protected by dp_dirty_zilogs list */
|
||||
uint64_t zl_dirty_max_txg; /* highest txg used to dirty zilog */
|
||||
|
||||
|
||||
@@ -1175,8 +1175,8 @@ efi_use_whole_disk(int fd)
|
||||
* (for performance reasons). The alignment should match the
|
||||
* alignment used by the "zpool_label_disk" function.
|
||||
*/
|
||||
limit = P2ALIGN(efi_label->efi_last_lba - nblocks - EFI_MIN_RESV_SIZE,
|
||||
PARTITION_END_ALIGNMENT);
|
||||
limit = P2ALIGN_TYPED(efi_label->efi_last_lba - nblocks -
|
||||
EFI_MIN_RESV_SIZE, PARTITION_END_ALIGNMENT, diskaddr_t);
|
||||
if (data_start + data_size != limit || resv_start != limit)
|
||||
sync_needed = B_TRUE;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include $(srcdir)/%D%/include/Makefile.am
|
||||
|
||||
libspl_assert_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)
|
||||
libspl_assert_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS) $(LIBUNWIND_CFLAGS)
|
||||
libspl_la_CFLAGS = $(libspl_assert_la_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES += libspl_assert.la libspl.la
|
||||
@@ -43,3 +43,9 @@ libspl_la_LIBADD = \
|
||||
libspl_assert.la
|
||||
|
||||
libspl_la_LIBADD += $(LIBATOMIC_LIBS) $(LIBCLOCK_GETTIME)
|
||||
|
||||
libspl_assert_la_LIBADD = $(BACKTRACE_LIBS) $(LIBUNWIND_LIBS)
|
||||
|
||||
if BUILD_FREEBSD
|
||||
libspl_assert_la_LIBADD += -lpthread
|
||||
endif
|
||||
|
||||
+110
-2
@@ -22,8 +22,96 @@
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2024, Rob Norris <robn@despairlabs.com>
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <errno.h>
|
||||
#include <sys/prctl.h>
|
||||
#ifdef HAVE_GETTID
|
||||
#define libspl_gettid() gettid()
|
||||
#else
|
||||
#include <sys/syscall.h>
|
||||
#define libspl_gettid() ((pid_t)syscall(__NR_gettid))
|
||||
#endif
|
||||
#define libspl_getprogname() (program_invocation_short_name)
|
||||
#define libspl_getthreadname(buf, len) \
|
||||
prctl(PR_GET_NAME, (unsigned long)(buf), 0, 0, 0)
|
||||
#elif defined(__FreeBSD__) || defined(__APPLE__)
|
||||
#if !defined(__APPLE__)
|
||||
#include <pthread_np.h>
|
||||
#define libspl_gettid() pthread_getthreadid_np()
|
||||
#endif
|
||||
#define libspl_getprogname() getprogname()
|
||||
#define libspl_getthreadname(buf, len) \
|
||||
pthread_getname_np(pthread_self(), buf, len);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBUNWIND)
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
|
||||
static inline void
|
||||
libspl_dump_backtrace(void)
|
||||
{
|
||||
unw_context_t uc;
|
||||
unw_cursor_t cp;
|
||||
unw_word_t ip, off;
|
||||
char funcname[128];
|
||||
#ifdef HAVE_LIBUNWIND_ELF
|
||||
char objname[128];
|
||||
unw_word_t objoff;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "Call trace:\n");
|
||||
unw_getcontext(&uc);
|
||||
unw_init_local(&cp, &uc);
|
||||
while (unw_step(&cp) > 0) {
|
||||
unw_get_reg(&cp, UNW_REG_IP, &ip);
|
||||
unw_get_proc_name(&cp, funcname, sizeof (funcname), &off);
|
||||
#ifdef HAVE_LIBUNWIND_ELF
|
||||
unw_get_elf_filename(&cp, objname, sizeof (objname), &objoff);
|
||||
fprintf(stderr, " [0x%08lx] %s+0x%2lx (in %s +0x%2lx)\n",
|
||||
ip, funcname, off, objname, objoff);
|
||||
#else
|
||||
fprintf(stderr, " [0x%08lx] %s+0x%2lx\n", ip, funcname, off);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#elif defined(HAVE_BACKTRACE)
|
||||
#include <execinfo.h>
|
||||
|
||||
static inline void
|
||||
libspl_dump_backtrace(void)
|
||||
{
|
||||
void *btptrs[100];
|
||||
size_t nptrs = backtrace(btptrs, 100);
|
||||
char **bt = backtrace_symbols(btptrs, nptrs);
|
||||
fprintf(stderr, "Call trace:\n");
|
||||
for (size_t i = 0; i < nptrs; i++)
|
||||
fprintf(stderr, " %s\n", bt[i]);
|
||||
free(bt);
|
||||
}
|
||||
#else
|
||||
#define libspl_dump_backtrace()
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
static inline uint64_t
|
||||
libspl_gettid(void)
|
||||
{
|
||||
uint64_t tid;
|
||||
|
||||
if (pthread_threadid_np(NULL, &tid) != 0)
|
||||
tid = 0;
|
||||
|
||||
return (tid);
|
||||
}
|
||||
#endif
|
||||
|
||||
static boolean_t libspl_assert_ok = B_FALSE;
|
||||
|
||||
@@ -33,21 +121,41 @@ libspl_set_assert_ok(boolean_t val)
|
||||
libspl_assert_ok = val;
|
||||
}
|
||||
|
||||
static pthread_mutex_t assert_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
/* printf version of libspl_assert */
|
||||
void
|
||||
libspl_assertf(const char *file, const char *func, int line,
|
||||
const char *format, ...)
|
||||
{
|
||||
pthread_mutex_lock(&assert_lock);
|
||||
|
||||
va_list args;
|
||||
char tname[64];
|
||||
|
||||
libspl_getthreadname(tname, sizeof (tname));
|
||||
|
||||
fprintf(stderr, "ASSERT at %s:%d:%s()\n", file, line, func);
|
||||
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "\n"
|
||||
" PID: %-8u COMM: %s\n"
|
||||
#if defined(__APPLE__)
|
||||
" TID: %-8" PRIu64 " NAME: %s\n",
|
||||
#else
|
||||
" TID: %-8u NAME: %s\n",
|
||||
#endif
|
||||
getpid(), libspl_getprogname(),
|
||||
libspl_gettid(), tname);
|
||||
|
||||
libspl_dump_backtrace();
|
||||
|
||||
#if !__has_feature(attribute_analyzer_noreturn) && !defined(__COVERITY__)
|
||||
if (libspl_assert_ok) {
|
||||
pthread_mutex_unlock(&assert_lock);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -110,8 +110,8 @@ do { \
|
||||
const uintptr_t __right = (uintptr_t)(RIGHT); \
|
||||
if (!(__left OP __right)) \
|
||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
|
||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
||||
"%s %s %s (%p %s %p)", #LEFT, #OP, #RIGHT, \
|
||||
(void *)__left, #OP, (void *)__right); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY0(LEFT) \
|
||||
@@ -123,6 +123,15 @@ do { \
|
||||
(u_longlong_t)__left); \
|
||||
} while (0)
|
||||
|
||||
#define VERIFY0P(LEFT) \
|
||||
do { \
|
||||
const uintptr_t __left = (uintptr_t)(LEFT); \
|
||||
if (!(__left == 0)) \
|
||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"%s == 0 (%p == 0)", #LEFT, \
|
||||
(void *)__left); \
|
||||
} while (0)
|
||||
|
||||
#ifdef assert
|
||||
#undef assert
|
||||
#endif
|
||||
@@ -137,6 +146,7 @@ do { \
|
||||
#define ASSERT3P(x, y, z) \
|
||||
((void) sizeof ((uintptr_t)(x)), (void) sizeof ((uintptr_t)(z)))
|
||||
#define ASSERT0(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define ASSERT0P(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define ASSERT(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define assert(x) ((void) sizeof ((uintptr_t)(x)))
|
||||
#define IMPLY(A, B) \
|
||||
@@ -149,6 +159,7 @@ do { \
|
||||
#define ASSERT3U VERIFY3U
|
||||
#define ASSERT3P VERIFY3P
|
||||
#define ASSERT0 VERIFY0
|
||||
#define ASSERT0P VERIFY0P
|
||||
#define ASSERT VERIFY
|
||||
#define assert VERIFY
|
||||
#define IMPLY(A, B) \
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
extern size_t spl_pagesize(void);
|
||||
#define PAGESIZE (spl_pagesize())
|
||||
|
||||
#ifndef HAVE_EXECVPE
|
||||
extern int execvpe(const char *name, char * const argv[], char * const envp[]);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
/*
|
||||
* Compatibility macros/typedefs needed for Solaris -> Linux port
|
||||
*/
|
||||
#define P2ALIGN(x, align) ((x) & -(align))
|
||||
// Deprecated. Use P2ALIGN_TYPED instead.
|
||||
// #define P2ALIGN(x, align) ((x) & -(align))
|
||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||
#define P2BOUNDARY(off, len, align) \
|
||||
|
||||
+10
-4
@@ -505,14 +505,20 @@ uu_list_walk(uu_list_t *lp, uu_walk_fn_t *func, void *private, uint32_t flags)
|
||||
}
|
||||
|
||||
if (lp->ul_debug || robust) {
|
||||
uu_list_walk_t my_walk;
|
||||
uu_list_walk_t *my_walk;
|
||||
void *e;
|
||||
|
||||
list_walk_init(&my_walk, lp, flags);
|
||||
my_walk = uu_zalloc(sizeof (*my_walk));
|
||||
if (my_walk == NULL)
|
||||
return (-1);
|
||||
|
||||
list_walk_init(my_walk, lp, flags);
|
||||
while (status == UU_WALK_NEXT &&
|
||||
(e = uu_list_walk_next(&my_walk)) != NULL)
|
||||
(e = uu_list_walk_next(my_walk)) != NULL)
|
||||
status = (*func)(e, private);
|
||||
list_walk_fini(&my_walk);
|
||||
list_walk_fini(my_walk);
|
||||
|
||||
uu_free(my_walk);
|
||||
} else {
|
||||
if (!reverse) {
|
||||
for (np = lp->ul_null_node.uln_next;
|
||||
|
||||
+68
-16
@@ -1112,14 +1112,11 @@
|
||||
<var-decl name='prev' type-id='b03eadb4' visibility='default'/>
|
||||
</data-member>
|
||||
</class-decl>
|
||||
<class-decl name='list' size-in-bits='256' is-struct='yes' visibility='default' id='e824dae9'>
|
||||
<class-decl name='list' size-in-bits='192' is-struct='yes' visibility='default' id='e824dae9'>
|
||||
<data-member access='public' layout-offset-in-bits='0'>
|
||||
<var-decl name='list_size' type-id='b59d7dce' visibility='default'/>
|
||||
</data-member>
|
||||
<data-member access='public' layout-offset-in-bits='64'>
|
||||
<var-decl name='list_offset' type-id='b59d7dce' visibility='default'/>
|
||||
</data-member>
|
||||
<data-member access='public' layout-offset-in-bits='128'>
|
||||
<data-member access='public' layout-offset-in-bits='64'>
|
||||
<var-decl name='list_head' type-id='b0b5e45e' visibility='default'/>
|
||||
</data-member>
|
||||
</class-decl>
|
||||
@@ -1870,7 +1867,8 @@
|
||||
<enumerator name='ZFS_PROP_REDACTED' value='93'/>
|
||||
<enumerator name='ZFS_PROP_REDACT_SNAPS' value='94'/>
|
||||
<enumerator name='ZFS_PROP_SNAPSHOTS_CHANGED' value='95'/>
|
||||
<enumerator name='ZFS_NUM_PROPS' value='96'/>
|
||||
<enumerator name='ZFS_PROP_PREFETCH' value='96'/>
|
||||
<enumerator name='ZFS_NUM_PROPS' value='97'/>
|
||||
</enum-decl>
|
||||
<typedef-decl name='zfs_prop_t' type-id='4b000d60' id='58603c44'/>
|
||||
<enum-decl name='zprop_source_t' naming-typedef-id='a2256d42' id='5903f80e'>
|
||||
@@ -2878,6 +2876,9 @@
|
||||
</function-type>
|
||||
</abi-instr>
|
||||
<abi-instr address-size='64' path='lib/libzfs/libzfs_crypto.c' language='LANG_C99'>
|
||||
<array-type-def dimensions='1' type-id='38b51b3c' size-in-bits='832' id='02b72c00'>
|
||||
<subrange length='13' type-id='7359adad' id='487fded1'/>
|
||||
</array-type-def>
|
||||
<array-type-def dimensions='1' type-id='fb7c6451' size-in-bits='256' id='64177143'>
|
||||
<subrange length='32' type-id='7359adad' id='ae5bde82'/>
|
||||
</array-type-def>
|
||||
@@ -2890,6 +2891,10 @@
|
||||
<class-decl name='_IO_codecvt' is-struct='yes' visibility='default' is-declaration-only='yes' id='a4036571'/>
|
||||
<class-decl name='_IO_marker' is-struct='yes' visibility='default' is-declaration-only='yes' id='010ae0b9'/>
|
||||
<class-decl name='_IO_wide_data' is-struct='yes' visibility='default' is-declaration-only='yes' id='79bd3751'/>
|
||||
<class-decl name='__locale_data' is-struct='yes' visibility='default' is-declaration-only='yes' id='23de8b96'/>
|
||||
<array-type-def dimensions='1' type-id='80f4b756' size-in-bits='832' id='39e6f84a'>
|
||||
<subrange length='13' type-id='7359adad' id='487fded1'/>
|
||||
</array-type-def>
|
||||
<array-type-def dimensions='1' type-id='95e97e5e' size-in-bits='896' id='47394ee0'>
|
||||
<subrange length='28' type-id='7359adad' id='3db583d7'/>
|
||||
</array-type-def>
|
||||
@@ -3010,6 +3015,24 @@
|
||||
<typedef-decl name='__clock_t' type-id='bd54fe1a' id='4d66c6d7'/>
|
||||
<typedef-decl name='__ssize_t' type-id='bd54fe1a' id='41060289'/>
|
||||
<typedef-decl name='FILE' type-id='ec1ed955' id='aa12d1ba'/>
|
||||
<class-decl name='__locale_struct' size-in-bits='1856' is-struct='yes' visibility='default' id='90cc1ce3'>
|
||||
<data-member access='public' layout-offset-in-bits='0'>
|
||||
<var-decl name='__locales' type-id='02b72c00' visibility='default'/>
|
||||
</data-member>
|
||||
<data-member access='public' layout-offset-in-bits='832'>
|
||||
<var-decl name='__ctype_b' type-id='31347b7a' visibility='default'/>
|
||||
</data-member>
|
||||
<data-member access='public' layout-offset-in-bits='896'>
|
||||
<var-decl name='__ctype_tolower' type-id='6d60f45d' visibility='default'/>
|
||||
</data-member>
|
||||
<data-member access='public' layout-offset-in-bits='960'>
|
||||
<var-decl name='__ctype_toupper' type-id='6d60f45d' visibility='default'/>
|
||||
</data-member>
|
||||
<data-member access='public' layout-offset-in-bits='1024'>
|
||||
<var-decl name='__names' type-id='39e6f84a' visibility='default'/>
|
||||
</data-member>
|
||||
</class-decl>
|
||||
<typedef-decl name='__locale_t' type-id='f01e1813' id='b7ac9b5f'/>
|
||||
<class-decl name='__sigset_t' size-in-bits='1024' is-struct='yes' naming-typedef-id='b9c97942' visibility='default' id='2616147f'>
|
||||
<data-member access='public' layout-offset-in-bits='0'>
|
||||
<var-decl name='__val' type-id='d2baa450' visibility='default'/>
|
||||
@@ -3025,6 +3048,7 @@
|
||||
</data-member>
|
||||
</union-decl>
|
||||
<typedef-decl name='__sigval_t' type-id='a094b870' id='eabacd01'/>
|
||||
<typedef-decl name='locale_t' type-id='b7ac9b5f' id='973a4f8d'/>
|
||||
<class-decl name='siginfo_t' size-in-bits='1024' is-struct='yes' naming-typedef-id='cb681f62' visibility='default' id='d8149419'>
|
||||
<data-member access='public' layout-offset-in-bits='0'>
|
||||
<var-decl name='si_signo' type-id='95e97e5e' visibility='default'/>
|
||||
@@ -3260,9 +3284,13 @@
|
||||
<pointer-type-def type-id='bb4788fa' size-in-bits='64' id='cecf4ea7'/>
|
||||
<pointer-type-def type-id='010ae0b9' size-in-bits='64' id='e4c6fa61'/>
|
||||
<pointer-type-def type-id='79bd3751' size-in-bits='64' id='c65a1f29'/>
|
||||
<pointer-type-def type-id='23de8b96' size-in-bits='64' id='38b51b3c'/>
|
||||
<pointer-type-def type-id='90cc1ce3' size-in-bits='64' id='f01e1813'/>
|
||||
<qualified-type-def type-id='9b23c9ad' restrict='yes' id='8c85230f'/>
|
||||
<qualified-type-def type-id='80f4b756' restrict='yes' id='9d26089a'/>
|
||||
<pointer-type-def type-id='80f4b756' size-in-bits='64' id='7d3cd834'/>
|
||||
<qualified-type-def type-id='95e97e5e' const='yes' id='2448a865'/>
|
||||
<pointer-type-def type-id='2448a865' size-in-bits='64' id='6d60f45d'/>
|
||||
<qualified-type-def type-id='aca3bac8' const='yes' id='2498fd78'/>
|
||||
<pointer-type-def type-id='2498fd78' size-in-bits='64' id='eed6c816'/>
|
||||
<qualified-type-def type-id='eed6c816' restrict='yes' id='a431a9da'/>
|
||||
@@ -3295,6 +3323,7 @@
|
||||
<class-decl name='_IO_codecvt' is-struct='yes' visibility='default' is-declaration-only='yes' id='a4036571'/>
|
||||
<class-decl name='_IO_marker' is-struct='yes' visibility='default' is-declaration-only='yes' id='010ae0b9'/>
|
||||
<class-decl name='_IO_wide_data' is-struct='yes' visibility='default' is-declaration-only='yes' id='79bd3751'/>
|
||||
<class-decl name='__locale_data' is-struct='yes' visibility='default' is-declaration-only='yes' id='23de8b96'/>
|
||||
<function-decl name='zpool_get_prop_int' mangled-name='zpool_get_prop_int' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='zpool_get_prop_int'>
|
||||
<parameter type-id='4c81de99'/>
|
||||
<parameter type-id='5d0c23fb'/>
|
||||
@@ -3399,6 +3428,10 @@
|
||||
<function-decl name='dlerror' visibility='default' binding='global' size-in-bits='64'>
|
||||
<return type-id='26a90f95'/>
|
||||
</function-decl>
|
||||
<function-decl name='uselocale' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='973a4f8d'/>
|
||||
<return type-id='973a4f8d'/>
|
||||
</function-decl>
|
||||
<function-decl name='PKCS5_PBKDF2_HMAC_SHA1' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='80f4b756'/>
|
||||
<parameter type-id='95e97e5e'/>
|
||||
@@ -3482,8 +3515,9 @@
|
||||
<parameter type-id='80f4b756'/>
|
||||
<return type-id='26a90f95'/>
|
||||
</function-decl>
|
||||
<function-decl name='strerror' visibility='default' binding='global' size-in-bits='64'>
|
||||
<function-decl name='strerror_l' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='95e97e5e'/>
|
||||
<parameter type-id='973a4f8d'/>
|
||||
<return type-id='26a90f95'/>
|
||||
</function-decl>
|
||||
<function-decl name='tcgetattr' visibility='default' binding='global' size-in-bits='64'>
|
||||
@@ -3840,12 +3874,18 @@
|
||||
<qualified-type-def type-id='9c313c2d' const='yes' id='c3b7ba7d'/>
|
||||
<pointer-type-def type-id='c3b7ba7d' size-in-bits='64' id='713a56f5'/>
|
||||
<pointer-type-def type-id='01a1b934' size-in-bits='64' id='566b3f52'/>
|
||||
<qualified-type-def type-id='566b3f52' restrict='yes' id='c878edd6'/>
|
||||
<pointer-type-def type-id='566b3f52' size-in-bits='64' id='82d4e9e8'/>
|
||||
<qualified-type-def type-id='82d4e9e8' restrict='yes' id='aa19c230'/>
|
||||
<pointer-type-def type-id='7e291ce6' size-in-bits='64' id='ca64ff60'/>
|
||||
<pointer-type-def type-id='9da381c4' size-in-bits='64' id='cb785ebf'/>
|
||||
<pointer-type-def type-id='1b055409' size-in-bits='64' id='9d424d31'/>
|
||||
<pointer-type-def type-id='8e0af06e' size-in-bits='64' id='053457bd'/>
|
||||
<pointer-type-def type-id='857bb57e' size-in-bits='64' id='75be733c'/>
|
||||
<pointer-type-def type-id='a63d15a3' size-in-bits='64' id='a195f4a3'/>
|
||||
<qualified-type-def type-id='a195f4a3' restrict='yes' id='33518961'/>
|
||||
<pointer-type-def type-id='a195f4a3' size-in-bits='64' id='e80ff3ab'/>
|
||||
<qualified-type-def type-id='e80ff3ab' restrict='yes' id='8f2c7109'/>
|
||||
<pointer-type-def type-id='eae6431d' size-in-bits='64' id='0d41d328'/>
|
||||
<pointer-type-def type-id='7a6844eb' size-in-bits='64' id='18c91f9e'/>
|
||||
<pointer-type-def type-id='dddf6ca2' size-in-bits='64' id='d915a820'/>
|
||||
@@ -4278,9 +4318,13 @@
|
||||
<parameter type-id='9d424d31'/>
|
||||
<return type-id='95e97e5e'/>
|
||||
</function-decl>
|
||||
<function-decl name='getgrnam' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='80f4b756'/>
|
||||
<return type-id='566b3f52'/>
|
||||
<function-decl name='getgrnam_r' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='9d26089a'/>
|
||||
<parameter type-id='c878edd6'/>
|
||||
<parameter type-id='266fe297'/>
|
||||
<parameter type-id='b59d7dce'/>
|
||||
<parameter type-id='aa19c230'/>
|
||||
<return type-id='95e97e5e'/>
|
||||
</function-decl>
|
||||
<function-decl name='hasmntopt' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='48bea5ec'/>
|
||||
@@ -4304,9 +4348,13 @@
|
||||
<parameter type-id='18c91f9e'/>
|
||||
<return type-id='95e97e5e'/>
|
||||
</function-decl>
|
||||
<function-decl name='getpwnam' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='80f4b756'/>
|
||||
<return type-id='a195f4a3'/>
|
||||
<function-decl name='getpwnam_r' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='9d26089a'/>
|
||||
<parameter type-id='33518961'/>
|
||||
<parameter type-id='266fe297'/>
|
||||
<parameter type-id='b59d7dce'/>
|
||||
<parameter type-id='8f2c7109'/>
|
||||
<return type-id='95e97e5e'/>
|
||||
</function-decl>
|
||||
<function-decl name='strtol' visibility='default' binding='global' size-in-bits='64'>
|
||||
<parameter type-id='9d26089a'/>
|
||||
@@ -5671,7 +5719,10 @@
|
||||
<enumerator name='VDEV_PROP_CHECKSUM_T' value='43'/>
|
||||
<enumerator name='VDEV_PROP_IO_N' value='44'/>
|
||||
<enumerator name='VDEV_PROP_IO_T' value='45'/>
|
||||
<enumerator name='VDEV_NUM_PROPS' value='46'/>
|
||||
<enumerator name='VDEV_PROP_RAIDZ_EXPANDING' value='46'/>
|
||||
<enumerator name='VDEV_PROP_SLOW_IO_N' value='47'/>
|
||||
<enumerator name='VDEV_PROP_SLOW_IO_T' value='48'/>
|
||||
<enumerator name='VDEV_NUM_PROPS' value='49'/>
|
||||
</enum-decl>
|
||||
<typedef-decl name='vdev_prop_t' type-id='1573bec8' id='5aa5c90c'/>
|
||||
<class-decl name='zpool_load_policy' size-in-bits='256' is-struct='yes' visibility='default' id='2f65b36f'>
|
||||
@@ -6242,6 +6293,7 @@
|
||||
<function-decl name='zpool_add' mangled-name='zpool_add' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='zpool_add'>
|
||||
<parameter type-id='4c81de99' name='zhp'/>
|
||||
<parameter type-id='5ce45b60' name='nvroot'/>
|
||||
<parameter type-id='c19b74c3' name='ashift_check'/>
|
||||
<return type-id='95e97e5e'/>
|
||||
</function-decl>
|
||||
<function-decl name='zpool_export' mangled-name='zpool_export' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='zpool_export'>
|
||||
@@ -6693,7 +6745,7 @@
|
||||
<enumerator name='LZC_SEND_FLAG_RAW' value='8'/>
|
||||
<enumerator name='LZC_SEND_FLAG_SAVED' value='16'/>
|
||||
</enum-decl>
|
||||
<class-decl name='ddt_key' size-in-bits='320' is-struct='yes' visibility='default' id='e0a4a1cb'>
|
||||
<class-decl name='ddt_key_t' size-in-bits='320' is-struct='yes' naming-typedef-id='67f6d2cf' visibility='default' id='5fae1718'>
|
||||
<data-member access='public' layout-offset-in-bits='0'>
|
||||
<var-decl name='ddk_cksum' type-id='39730d0b' visibility='default'/>
|
||||
</data-member>
|
||||
@@ -6701,7 +6753,7 @@
|
||||
<var-decl name='ddk_prop' type-id='9c313c2d' visibility='default'/>
|
||||
</data-member>
|
||||
</class-decl>
|
||||
<typedef-decl name='ddt_key_t' type-id='e0a4a1cb' id='67f6d2cf'/>
|
||||
<typedef-decl name='ddt_key_t' type-id='5fae1718' id='67f6d2cf'/>
|
||||
<enum-decl name='dmu_object_type' id='04b3b0b9'>
|
||||
<underlying-type type-id='9cac1fee'/>
|
||||
<enumerator name='DMU_OT_NONE' value='0'/>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*
|
||||
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
|
||||
* Copyright (c) 2018 Datto Inc.
|
||||
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
|
||||
@@ -1724,7 +1724,7 @@ zpool_discard_checkpoint(zpool_handle_t *zhp)
|
||||
* necessary verification to ensure that the vdev specification is well-formed.
|
||||
*/
|
||||
int
|
||||
zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
|
||||
zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot, boolean_t check_ashift)
|
||||
{
|
||||
zfs_cmd_t zc = {"\0"};
|
||||
int ret;
|
||||
@@ -1756,6 +1756,7 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
|
||||
|
||||
zcmd_write_conf_nvlist(hdl, &zc, nvroot);
|
||||
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
|
||||
zc.zc_flags = check_ashift;
|
||||
|
||||
if (zfs_ioctl(hdl, ZFS_IOC_VDEV_ADD, &zc) != 0) {
|
||||
switch (errno) {
|
||||
@@ -1899,7 +1900,8 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
|
||||
(void) nvlist_lookup_int64(nv, ZPOOL_CONFIG_REWIND_TIME, &loss);
|
||||
|
||||
if (localtime_r((time_t *)&rewindto, &t) != NULL &&
|
||||
strftime(timestr, 128, "%c", &t) != 0) {
|
||||
ctime_r((time_t *)&rewindto, timestr) != NULL) {
|
||||
timestr[24] = 0;
|
||||
if (dryrun) {
|
||||
(void) printf(dgettext(TEXT_DOMAIN,
|
||||
"Would be able to return %s "
|
||||
@@ -1961,7 +1963,8 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
|
||||
"Recovery is possible, but will result in some data loss.\n"));
|
||||
|
||||
if (localtime_r((time_t *)&rewindto, &t) != NULL &&
|
||||
strftime(timestr, 128, "%c", &t) != 0) {
|
||||
ctime_r((time_t *)&rewindto, timestr) != NULL) {
|
||||
timestr[24] = 0;
|
||||
(void) printf(dgettext(TEXT_DOMAIN,
|
||||
"\tReturning the pool to its state as of %s\n"
|
||||
"\tshould correct the problem. "),
|
||||
@@ -5224,6 +5227,8 @@ zpool_get_vdev_prop_value(nvlist_t *nvprop, vdev_prop_t prop, char *prop_name,
|
||||
case VDEV_PROP_CHECKSUM_T:
|
||||
case VDEV_PROP_IO_N:
|
||||
case VDEV_PROP_IO_T:
|
||||
case VDEV_PROP_SLOW_IO_N:
|
||||
case VDEV_PROP_SLOW_IO_T:
|
||||
if (intval == UINT64_MAX) {
|
||||
(void) strlcpy(buf, "-", len);
|
||||
} else {
|
||||
|
||||
@@ -1053,6 +1053,7 @@ send_progress_thread(void *arg)
|
||||
}
|
||||
}
|
||||
pthread_cleanup_pop(B_TRUE);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static boolean_t
|
||||
@@ -2169,7 +2170,8 @@ out:
|
||||
static int
|
||||
send_conclusion_record(int fd, zio_cksum_t *zc)
|
||||
{
|
||||
dmu_replay_record_t drr = { 0 };
|
||||
dmu_replay_record_t drr;
|
||||
memset(&drr, 0, sizeof (dmu_replay_record_t));
|
||||
drr.drr_type = DRR_END;
|
||||
if (zc != NULL)
|
||||
drr.drr_u.drr_end.drr_checksum = *zc;
|
||||
@@ -2271,7 +2273,8 @@ send_prelim_records(zfs_handle_t *zhp, const char *from, int fd,
|
||||
}
|
||||
|
||||
if (!dryrun) {
|
||||
dmu_replay_record_t drr = { 0 };
|
||||
dmu_replay_record_t drr;
|
||||
memset(&drr, 0, sizeof (dmu_replay_record_t));
|
||||
/* write first begin record */
|
||||
drr.drr_type = DRR_BEGIN;
|
||||
drr.drr_u.drr_begin.drr_magic = DMU_BACKUP_MAGIC;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2020 Joyent, Inc. All rights reserved.
|
||||
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2011, 2024 by Delphix. All rights reserved.
|
||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
|
||||
* Copyright (c) 2017 Datto Inc.
|
||||
* Copyright (c) 2020 The FreeBSD Foundation
|
||||
@@ -317,6 +317,9 @@ libzfs_error_description(libzfs_handle_t *hdl)
|
||||
case EZFS_RESUME_EXISTS:
|
||||
return (dgettext(TEXT_DOMAIN, "Resuming recv on existing "
|
||||
"dataset without force"));
|
||||
case EZFS_ASHIFT_MISMATCH:
|
||||
return (dgettext(TEXT_DOMAIN, "adding devices with "
|
||||
"different physical sector sizes is not allowed"));
|
||||
case EZFS_UNKNOWN:
|
||||
return (dgettext(TEXT_DOMAIN, "unknown error"));
|
||||
default:
|
||||
@@ -763,6 +766,9 @@ zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
|
||||
case ZFS_ERR_IOC_ARG_BADTYPE:
|
||||
zfs_verror(hdl, EZFS_IOC_NOTSUPPORTED, fmt, ap);
|
||||
break;
|
||||
case ZFS_ERR_ASHIFT_MISMATCH:
|
||||
zfs_verror(hdl, EZFS_ASHIFT_MISMATCH, fmt, ap);
|
||||
break;
|
||||
default:
|
||||
zfs_error_aux(hdl, "%s", strerror(error));
|
||||
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
|
||||
@@ -1699,7 +1705,9 @@ zprop_parse_value(libzfs_handle_t *hdl, nvpair_t *elem, int prop,
|
||||
(prop == VDEV_PROP_CHECKSUM_N ||
|
||||
prop == VDEV_PROP_CHECKSUM_T ||
|
||||
prop == VDEV_PROP_IO_N ||
|
||||
prop == VDEV_PROP_IO_T)) {
|
||||
prop == VDEV_PROP_IO_T ||
|
||||
prop == VDEV_PROP_SLOW_IO_N ||
|
||||
prop == VDEV_PROP_SLOW_IO_T)) {
|
||||
*ivalp = UINT64_MAX;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
#define ZFS_KMOD "openzfs"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_EXECVPE
|
||||
/* FreeBSD prior to 15 lacks execvpe */
|
||||
static int
|
||||
execvPe(const char *name, const char *path, char * const *argv,
|
||||
char * const *envp)
|
||||
@@ -192,6 +193,7 @@ execvpe(const char *name, char * const argv[], char * const envp[])
|
||||
|
||||
return (execvPe(name, path, argv, envp));
|
||||
}
|
||||
#endif /* !HAVE_EXECVPE */
|
||||
|
||||
static __thread char errbuf[ERRBUFLEN];
|
||||
|
||||
|
||||
@@ -268,11 +268,22 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name)
|
||||
if (start_block == MAXOFFSET_T)
|
||||
start_block = NEW_START_BLOCK;
|
||||
slice_size -= start_block;
|
||||
slice_size = P2ALIGN(slice_size, PARTITION_END_ALIGNMENT);
|
||||
slice_size = P2ALIGN_TYPED(slice_size, PARTITION_END_ALIGNMENT,
|
||||
uint64_t);
|
||||
|
||||
vtoc->efi_parts[0].p_start = start_block;
|
||||
vtoc->efi_parts[0].p_size = slice_size;
|
||||
|
||||
if (vtoc->efi_parts[0].p_size * vtoc->efi_lbasize < SPA_MINDEVSIZE) {
|
||||
(void) close(fd);
|
||||
efi_free(vtoc);
|
||||
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
|
||||
"label '%s': partition would be less than the minimum "
|
||||
"device size (64M)"), path);
|
||||
return (zfs_error(hdl, EZFS_LABELFAILED, errbuf));
|
||||
}
|
||||
|
||||
/*
|
||||
* Why we use V_USR: V_BACKUP confuses users, and is considered
|
||||
* disposable by some EFI utilities (since EFI doesn't have a backup
|
||||
|
||||
+2
-2
@@ -62,7 +62,6 @@ dist_man_MANS = \
|
||||
%D%/man8/zfs-userspace.8 \
|
||||
%D%/man8/zfs-wait.8 \
|
||||
%D%/man8/zfs_ids_to_path.8 \
|
||||
%D%/man8/zfs_prepare_disk.8 \
|
||||
%D%/man8/zgenhostid.8 \
|
||||
%D%/man8/zinject.8 \
|
||||
%D%/man8/zpool.8 \
|
||||
@@ -115,7 +114,8 @@ endif
|
||||
|
||||
nodist_man_MANS = \
|
||||
%D%/man8/zed.8 \
|
||||
%D%/man8/zfs-mount-generator.8
|
||||
%D%/man8/zfs-mount-generator.8 \
|
||||
%D%/man8/zfs_prepare_disk.8
|
||||
|
||||
dist_noinst_DATA += $(dist_noinst_man_MANS) $(dist_man_MANS)
|
||||
|
||||
|
||||
+4
-14
@@ -186,18 +186,8 @@ reading it could cause a lock-up if the list grow too large
|
||||
without limiting the output.
|
||||
"(truncated)" will be shown if the list is larger than the limit.
|
||||
.
|
||||
.It Sy spl_taskq_thread_timeout_ms Ns = Ns Sy 10000 Pq uint
|
||||
(Linux-only)
|
||||
How long a taskq has to have had no work before we tear it down.
|
||||
Previously, we would tear down a dynamic taskq worker as soon
|
||||
as we noticed it had no work, but it was observed that this led
|
||||
to a lot of churn in tearing down things we then immediately
|
||||
spawned anew.
|
||||
In practice, it seems any nonzero value will remove the vast
|
||||
majority of this churn, while the nontrivially larger value
|
||||
was chosen to help filter out the little remaining churn on
|
||||
a mostly idle system.
|
||||
Setting this value to
|
||||
.Sy 0
|
||||
will revert to the previous behavior.
|
||||
.It Sy spl_taskq_thread_timeout_ms Ns = Ns Sy 5000 Pq uint
|
||||
Minimum idle threads exit interval for dynamic taskqs.
|
||||
Smaller values allow idle threads exit more often and potentially be
|
||||
respawned again on demand, causing more churn.
|
||||
.El
|
||||
|
||||
+88
-17
@@ -2,6 +2,7 @@
|
||||
.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
|
||||
.\" Copyright (c) 2019, 2021 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2019 Datto Inc.
|
||||
.\" Copyright (c) 2023, 2024 Klara, Inc.
|
||||
.\" The contents of this file are subject to the terms of the Common Development
|
||||
.\" and Distribution License (the "License"). You may not use this file except
|
||||
.\" in compliance with the License. You can obtain a copy of the license at
|
||||
@@ -15,7 +16,7 @@
|
||||
.\" own identifying information:
|
||||
.\" Portions Copyright [yyyy] [name of copyright owner]
|
||||
.\"
|
||||
.Dd July 21, 2023
|
||||
.Dd January 9, 2024
|
||||
.Dt ZFS 4
|
||||
.Os
|
||||
.
|
||||
@@ -120,20 +121,26 @@ Controls whether buffers present on special vdevs are eligible for caching
|
||||
into L2ARC.
|
||||
If set to 1, exclude dbufs on special vdevs from being cached to L2ARC.
|
||||
.
|
||||
.It Sy l2arc_mfuonly Ns = Ns Sy 0 Ns | Ns 1 Pq int
|
||||
.It Sy l2arc_mfuonly Ns = Ns Sy 0 Ns | Ns 1 Ns | Ns 2 Pq int
|
||||
Controls whether only MFU metadata and data are cached from ARC into L2ARC.
|
||||
This may be desired to avoid wasting space on L2ARC when reading/writing large
|
||||
amounts of data that are not expected to be accessed more than once.
|
||||
.Pp
|
||||
The default is off,
|
||||
The default is 0,
|
||||
meaning both MRU and MFU data and metadata are cached.
|
||||
When turning off this feature, some MRU buffers will still be present
|
||||
in ARC and eventually cached on L2ARC.
|
||||
When turning off this feature (setting it to 0), some MRU buffers will
|
||||
still be present in ARC and eventually cached on L2ARC.
|
||||
.No If Sy l2arc_noprefetch Ns = Ns Sy 0 ,
|
||||
some prefetched buffers will be cached to L2ARC, and those might later
|
||||
transition to MRU, in which case the
|
||||
.Sy l2arc_mru_asize No arcstat will not be Sy 0 .
|
||||
.Pp
|
||||
Setting it to 1 means to L2 cache only MFU data and metadata.
|
||||
.Pp
|
||||
Setting it to 2 means to L2 cache all metadata (MRU+MFU) but
|
||||
only MFU data (ie: MRU data are not cached). This can be the right setting
|
||||
to cache as much metadata as possible even when having high data turnover.
|
||||
.Pp
|
||||
Regardless of
|
||||
.Sy l2arc_noprefetch ,
|
||||
some MFU buffers might be evicted from ARC,
|
||||
@@ -244,12 +251,25 @@ For blocks that could be forced to be a gang block (due to
|
||||
.Sy metaslab_force_ganging ) ,
|
||||
force this many of them to be gang blocks.
|
||||
.
|
||||
.It Sy zfs_ddt_zap_default_bs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
|
||||
.It Sy brt_zap_prefetch Ns = Ns Sy 1 Ns | Ns 0 Pq int
|
||||
Controls prefetching BRT records for blocks which are going to be cloned.
|
||||
.
|
||||
.It Sy brt_zap_default_bs Ns = Ns Sy 12 Po 4 KiB Pc Pq int
|
||||
Default BRT ZAP data block size as a power of 2. Note that changing this after
|
||||
creating a BRT on the pool will not affect existing BRTs, only newly created
|
||||
ones.
|
||||
.
|
||||
.It Sy brt_zap_default_ibs Ns = Ns Sy 12 Po 4 KiB Pc Pq int
|
||||
Default BRT ZAP indirect block size as a power of 2. Note that changing this
|
||||
after creating a BRT on the pool will not affect existing BRTs, only newly
|
||||
created ones.
|
||||
.
|
||||
.It Sy ddt_zap_default_bs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
|
||||
Default DDT ZAP data block size as a power of 2. Note that changing this after
|
||||
creating a DDT on the pool will not affect existing DDTs, only newly created
|
||||
ones.
|
||||
.
|
||||
.It Sy zfs_ddt_zap_default_ibs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
|
||||
.It Sy ddt_zap_default_ibs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
|
||||
Default DDT ZAP indirect block size as a power of 2. Note that changing this
|
||||
after creating a DDT on the pool will not affect existing DDTs, only newly
|
||||
created ones.
|
||||
@@ -530,6 +550,10 @@ However, this is limited by
|
||||
Maximum micro ZAP size.
|
||||
A micro ZAP is upgraded to a fat ZAP, once it grows beyond the specified size.
|
||||
.
|
||||
.It Sy zfetch_hole_shift Ns = Ns Sy 2 Pq uint
|
||||
Log2 fraction of holes in speculative prefetch stream allowed for it to
|
||||
proceed.
|
||||
.
|
||||
.It Sy zfetch_min_distance Ns = Ns Sy 4194304 Ns B Po 4 MiB Pc Pq uint
|
||||
Min bytes to prefetch per stream.
|
||||
Prefetch distance starts from the demand access size and quickly grows to
|
||||
@@ -544,6 +568,13 @@ Max bytes to prefetch per stream.
|
||||
.It Sy zfetch_max_idistance Ns = Ns Sy 67108864 Ns B Po 64 MiB Pc Pq uint
|
||||
Max bytes to prefetch indirects for per stream.
|
||||
.
|
||||
.It Sy zfetch_max_reorder Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq uint
|
||||
Requests within this byte distance from the current prefetch stream position
|
||||
are considered parts of the stream, reordered due to parallel processing.
|
||||
Such requests do not advance the stream position immediately unless
|
||||
.Sy zfetch_hole_shift
|
||||
fill threshold is reached, but saved to fill holes in the stream later.
|
||||
.
|
||||
.It Sy zfetch_max_streams Ns = Ns Sy 8 Pq uint
|
||||
Max number of streams per zfetch (prefetch streams per file).
|
||||
.
|
||||
@@ -798,7 +829,7 @@ Note that this should not be set below the ZED thresholds
|
||||
(currently 10 checksums over 10 seconds)
|
||||
or else the daemon may not trigger any action.
|
||||
.
|
||||
.It Sy zfs_commit_timeout_pct Ns = Ns Sy 5 Ns % Pq uint
|
||||
.It Sy zfs_commit_timeout_pct Ns = Ns Sy 10 Ns % Pq uint
|
||||
This controls the amount of time that a ZIL block (lwb) will remain "open"
|
||||
when it isn't "full", and it has a thread waiting for it to be committed to
|
||||
stable storage.
|
||||
@@ -1345,6 +1376,42 @@ _
|
||||
4 Driver No driver retries on driver errors.
|
||||
.TE
|
||||
.
|
||||
.It Sy zfs_vdev_disk_max_segs Ns = Ns Sy 0 Pq uint
|
||||
Maximum number of segments to add to a BIO (min 4).
|
||||
If this is higher than the maximum allowed by the device queue or the kernel
|
||||
itself, it will be clamped.
|
||||
Setting it to zero will cause the kernel's ideal size to be used.
|
||||
This parameter only applies on Linux.
|
||||
This parameter is ignored if
|
||||
.Sy zfs_vdev_disk_classic Ns = Ns Sy 1 .
|
||||
.
|
||||
.It Sy zfs_vdev_disk_classic Ns = Ns 0 Ns | Ns Sy 1 Pq uint
|
||||
Controls the method used to submit IO to the Linux block layer
|
||||
(default
|
||||
.Sy 1 "classic" Ns
|
||||
)
|
||||
.Pp
|
||||
If set to 1, the "classic" method is used.
|
||||
This is the method that has been in use since the earliest versions of
|
||||
ZFS-on-Linux.
|
||||
It has known issues with highly fragmented IO requests and is less efficient on
|
||||
many workloads, but it well known and well understood.
|
||||
.Pp
|
||||
If set to 0, the "new" method is used.
|
||||
This method is available since 2.2.4 and should resolve all known issues and be
|
||||
far more efficient, but has not had as much testing.
|
||||
In the 2.2.x series, this parameter defaults to 1, to use the "classic" method.
|
||||
.Pp
|
||||
It is not recommended that you change it except on advice from the OpenZFS
|
||||
developers.
|
||||
If you do change it, please also open a bug report describing why you did so,
|
||||
including the workload involved and any error messages.
|
||||
.Pp
|
||||
This parameter and the "classic" submission method will be removed in a future
|
||||
release of OpenZFS once we have total confidence in the new method.
|
||||
.Pp
|
||||
This parameter only applies on Linux, and can only be set at module load time.
|
||||
.
|
||||
.It Sy zfs_expire_snapshot Ns = Ns Sy 300 Ns s Pq int
|
||||
Time before expiring
|
||||
.Pa .zfs/snapshot .
|
||||
@@ -2169,13 +2236,6 @@ This sets the maximum number of write bytes logged via WR_COPIED.
|
||||
It tunes a tradeoff between additional memory copy and possibly worse log
|
||||
space efficiency vs additional range lock/unlock.
|
||||
.
|
||||
.It Sy zil_min_commit_timeout Ns = Ns Sy 5000 Pq u64
|
||||
This sets the minimum delay in nanoseconds ZIL care to delay block commit,
|
||||
waiting for more records.
|
||||
If ZIL writes are too fast, kernel may not be able sleep for so short interval,
|
||||
increasing log latency above allowed by
|
||||
.Sy zfs_commit_timeout_pct .
|
||||
.
|
||||
.It Sy zil_nocacheflush Ns = Ns Sy 0 Ns | Ns 1 Pq int
|
||||
Disable the cache flush commands that are normally sent to disk by
|
||||
the ZIL after an LWB write has completed.
|
||||
@@ -2270,8 +2330,8 @@ Prioritize requeued I/O.
|
||||
.
|
||||
.It Sy zio_taskq_batch_pct Ns = Ns Sy 80 Ns % Pq uint
|
||||
Percentage of online CPUs which will run a worker thread for I/O.
|
||||
These workers are responsible for I/O work such as compression and
|
||||
checksum calculations.
|
||||
These workers are responsible for I/O work such as compression, encryption,
|
||||
checksum and parity calculations.
|
||||
Fractional number of CPUs will be rounded down.
|
||||
.Pp
|
||||
The default value of
|
||||
@@ -2279,6 +2339,7 @@ The default value of
|
||||
was chosen to avoid using all CPUs which can result in
|
||||
latency issues and inconsistent application performance,
|
||||
especially when slower compression and/or checksumming is enabled.
|
||||
Set value only applies to pools imported/created after that.
|
||||
.
|
||||
.It Sy zio_taskq_batch_tpq Ns = Ns Sy 0 Pq uint
|
||||
Number of worker threads per taskq.
|
||||
@@ -2288,16 +2349,19 @@ while higher reduces lock contention.
|
||||
If
|
||||
.Sy 0 ,
|
||||
generate a system-dependent value close to 6 threads per taskq.
|
||||
Set value only applies to pools imported/created after that.
|
||||
.
|
||||
.It Sy zio_taskq_read Ns = Ns Sy fixed,1,8 null scale null Pq charp
|
||||
Set the queue and thread configuration for the IO read queues.
|
||||
This is an advanced debugging parameter.
|
||||
Don't change this unless you understand what it does.
|
||||
Set values only apply to pools imported/created after that.
|
||||
.
|
||||
.It Sy zio_taskq_write Ns = Ns Sy batch fixed,1,5 scale fixed,1,5 Pq charp
|
||||
Set the queue and thread configuration for the IO write queues.
|
||||
This is an advanced debugging parameter.
|
||||
Don't change this unless you understand what it does.
|
||||
Set values only apply to pools imported/created after that.
|
||||
.
|
||||
.It Sy zvol_inhibit_dev Ns = Ns Sy 0 Ns | Ns 1 Pq uint
|
||||
Do not create zvol device nodes.
|
||||
@@ -2333,6 +2397,13 @@ The number of requests which can be handled concurrently is controlled by
|
||||
is ignored when running on a kernel that supports block multiqueue
|
||||
.Pq Li blk-mq .
|
||||
.
|
||||
.It Sy zvol_num_taskqs Ns = Ns Sy 0 Pq uint
|
||||
Number of zvol taskqs.
|
||||
If
|
||||
.Sy 0
|
||||
(the default) then scaling is done internally to prefer 6 threads per taskq.
|
||||
This only applies on Linux.
|
||||
.
|
||||
.It Sy zvol_threads Ns = Ns Sy 0 Pq uint
|
||||
The number of system wide threads to use for processing zvol block IOs.
|
||||
If
|
||||
|
||||
@@ -154,7 +154,7 @@ defaults to the current kernel release.
|
||||
.
|
||||
.It Sy bootfs.rollback Ns Op Sy = Ns Ar snapshot-name
|
||||
Execute
|
||||
.Nm zfs Cm snapshot Fl Rf Ar boot-dataset Ns Sy @ Ns Ar snapshot-name
|
||||
.Nm zfs Cm rollback Fl Rf Ar boot-dataset Ns Sy @ Ns Ar snapshot-name
|
||||
before pivoting to the real root.
|
||||
.Ar snapshot-name
|
||||
defaults to the current kernel release.
|
||||
|
||||
@@ -44,7 +44,7 @@ section, below.
|
||||
Every vdev has a set of properties that export statistics about the vdev
|
||||
as well as control various behaviors.
|
||||
Properties are not inherited from top-level vdevs, with the exception of
|
||||
checksum_n, checksum_t, io_n, and io_t.
|
||||
checksum_n, checksum_t, io_n, io_t, slow_io_n, and slow_io_t.
|
||||
.Pp
|
||||
The values of numeric properties can be specified using human-readable suffixes
|
||||
.Po for example,
|
||||
@@ -117,7 +117,7 @@ If this device is currently being removed from the pool
|
||||
.Pp
|
||||
The following native properties can be used to change the behavior of a vdev.
|
||||
.Bl -tag -width "allocating"
|
||||
.It Sy checksum_n , checksum_t , io_n , io_t
|
||||
.It Sy checksum_n , checksum_t , io_n , io_t , slow_io_n , slow_io_t
|
||||
Tune the fault management daemon by specifying checksum/io thresholds of <N>
|
||||
errors in <T> seconds, respectively.
|
||||
These properties can be set on leaf and top-level vdevs.
|
||||
@@ -127,7 +127,13 @@ If the property is only set on the top-level vdev, this value will be used.
|
||||
The value of these properties do not persist across vdev replacement.
|
||||
For this reason, it is advisable to set the property on the top-level vdev -
|
||||
not on the leaf vdev itself.
|
||||
The default values are 10 errors in 600 seconds.
|
||||
The default values for
|
||||
.Sy OpenZFS on Linux
|
||||
are 10 errors in 600 seconds.
|
||||
For
|
||||
.Sy OpenZFS on FreeBSD
|
||||
defaults see
|
||||
.Xr zfsd 8 .
|
||||
.It Sy comment
|
||||
A text comment up to 8192 characters long
|
||||
.It Sy bootsize
|
||||
|
||||
@@ -1613,6 +1613,23 @@ If this property is set to
|
||||
then only metadata is cached.
|
||||
The default value is
|
||||
.Sy all .
|
||||
.It Sy prefetch Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
|
||||
Controls what speculative prefetch does.
|
||||
If this property is set to
|
||||
.Sy all ,
|
||||
then both user data and metadata are prefetched.
|
||||
If this property is set to
|
||||
.Sy none ,
|
||||
then neither user data nor metadata are prefetched.
|
||||
If this property is set to
|
||||
.Sy metadata ,
|
||||
then only metadata are prefetched.
|
||||
The default value is
|
||||
.Sy all .
|
||||
.Pp
|
||||
Please note that the module parameter zfs_disable_prefetch=1 can
|
||||
be used to totally disable speculative prefetch, bypassing anything
|
||||
this property does.
|
||||
.It Sy setuid Ns = Ns Sy on Ns | Ns Sy off
|
||||
Controls whether the setuid bit is respected for the file system.
|
||||
The default value is
|
||||
|
||||
@@ -260,8 +260,8 @@ sufficient replicas exist to continue functioning.
|
||||
The underlying conditions are as follows:
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
The number of checksum errors exceeds acceptable levels and the device is
|
||||
degraded as an indication that something may be wrong.
|
||||
The number of checksum errors or slow I/Os exceeds acceptable levels and the
|
||||
device is degraded as an indication that something may be wrong.
|
||||
ZFS continues to use the device as necessary.
|
||||
.It
|
||||
The number of I/O errors exceeds acceptable levels.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user