mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Compare commits
207 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b18d7df37 | |||
| 4fe5f9016f | |||
| e6142ac0f2 | |||
| ea15efd4c9 | |||
| 5c474614ff | |||
| 3d09d3809b | |||
| 76354f945e | |||
| 590ababea2 | |||
| 009ff83548 | |||
| 4e55349857 | |||
| 0cbed7f026 | |||
| 6e8c4dc460 | |||
| 06b473a8ae | |||
| ba2cf53545 | |||
| cf2a3464e9 | |||
| 43135b3746 | |||
| 6f42372635 | |||
| fc6700425a | |||
| e1b0704568 | |||
| d7c076c793 | |||
| e4185a03de | |||
| b06256a997 | |||
| f427973159 | |||
| 4bc401b30f | |||
| b19477898c | |||
| d1436d58a7 | |||
| 13bfad0c96 | |||
| 49f065d5a4 | |||
| ebc8e360d5 | |||
| d4e04cc145 | |||
| f3bf67d04d | |||
| 3916ac5a56 | |||
| 9bb3d57b03 | |||
| 9e36832d31 | |||
| 504aae708e | |||
| 1be3cba381 | |||
| 0fd9a28de8 | |||
| 7eaaa6f32e | |||
| 543b0c644a | |||
| 82be309780 | |||
| 0a37abc206 | |||
| c7dc6f3ab3 | |||
| 756c58cf71 | |||
| 70d2e938b5 | |||
| 9aec34703e | |||
| 16777b7dee | |||
| da6a7f0239 | |||
| 5b8f560713 | |||
| 0d55a0957f | |||
| bb04f9c195 | |||
| 421f8a2be0 | |||
| f28e58b479 | |||
| b051968de3 | |||
| e05c965d5b | |||
| 9791683901 | |||
| 180c41e0b7 | |||
| 1c27877ab2 | |||
| d01290f44d | |||
| 1074834f77 | |||
| 603ae6a8c0 | |||
| 363d7332f2 | |||
| bf01567e4e | |||
| 78072b7936 | |||
| 7f7c15c678 | |||
| fb244566c2 | |||
| 0f256176d9 | |||
| 6455859ee7 | |||
| 7ad0ae91d5 | |||
| 856d185dc2 | |||
| 4d658bda32 | |||
| d2233a08fa | |||
| 2525b71c68 | |||
| 85ff6a23f4 | |||
| ba8a5a882d | |||
| 73b5231187 | |||
| 388ef045b2 | |||
| 9cf46ddedc | |||
| 85204e30dd | |||
| e74055920e | |||
| 19ea83c594 | |||
| 922244cc23 | |||
| 48be45cd2d | |||
| 36fe63042c | |||
| c9ac5ec178 | |||
| bc21c56c2d | |||
| 6fed191975 | |||
| e688774ea6 | |||
| 7191f049d5 | |||
| 20e124dd71 | |||
| ef0b539581 | |||
| 6657800745 | |||
| 880a37aa35 | |||
| 1545f7c59d | |||
| 2c7549fb6f | |||
| edaec84225 | |||
| 618206c0b9 | |||
| 1253fcc70a | |||
| ca0f9b7473 | |||
| 5187a14f54 | |||
| 123aa2fc14 | |||
| 7e1b772edd | |||
| c6eaa8b7f9 | |||
| 635603a1c2 | |||
| 635bf1c37c | |||
| 09015c212f | |||
| 601dd2a504 | |||
| c19a6512fd | |||
| 8c8f84472b | |||
| e08b98e983 | |||
| c54ee4c0d3 | |||
| e416b165ff | |||
| c99b304f01 | |||
| 33cd5f2997 | |||
| f1ba5478a3 | |||
| 90bc5ca5e1 | |||
| 8af362c3e9 | |||
| 8139355dce | |||
| 5e78137f28 | |||
| 5a1bf9e8b1 | |||
| b43893de86 | |||
| 05e2a4cfc9 | |||
| 5f67022bf7 | |||
| 0be40959fe | |||
| ff3e2e3c70 | |||
| 35155c0132 | |||
| 62c034f6d4 | |||
| 988b040476 | |||
| 055238d2eb | |||
| ec5d76e853 | |||
| 8498a2f3f8 | |||
| 3ec97ba6f1 | |||
| 444df1051c | |||
| b8bd3ec2af | |||
| 5986c5c687 | |||
| 088f97b921 | |||
| 8747ee4513 | |||
| 43258fb78c | |||
| 4818563f85 | |||
| ffe29e7e3d | |||
| cea50025fd | |||
| 27dda98b88 | |||
| 8c9c049502 | |||
| 5cb46afcf1 | |||
| 068c5495f0 | |||
| 7e93917309 | |||
| 4ff90260c0 | |||
| 18d335d830 | |||
| 2af76a25ab | |||
| 36be89b8e5 | |||
| 7a7da11671 | |||
| f6a70187d2 | |||
| d632608210 | |||
| 500977eed2 | |||
| 5097eb6ac9 | |||
| 6673ef3f6f | |||
| 7572926bc5 | |||
| 8e1f209fa1 | |||
| 48d8b249c9 | |||
| 8c01eb1c4a | |||
| bcfa65802c | |||
| 10e8abf1af | |||
| 44ae857ca4 | |||
| eaf8e3b779 | |||
| cac5f924ce | |||
| 35c8730d1a | |||
| 619fda527a | |||
| ebdb770554 | |||
| 0302546b8d | |||
| 2f1f18a6b4 | |||
| 16f42e1b6d | |||
| f785ce65c1 | |||
| 0c6ccc99b2 | |||
| be6ae01435 | |||
| 9ad6f69a03 | |||
| 3b47c941eb | |||
| 7ed41d292b | |||
| 0189eb4762 | |||
| f64ef7317a | |||
| b72548575e | |||
| b7c9207fbd | |||
| dcaa460d6d | |||
| db58aa717b | |||
| ed235deffd | |||
| 72dbc01e7f | |||
| c75d3968bd | |||
| dfa4d3d986 | |||
| b78d32cc25 | |||
| dd6d0bdbb3 | |||
| 9d4ca81b6f | |||
| 93fd9101c9 | |||
| 5549a537dd | |||
| 628fd31d26 | |||
| d38e4ee142 | |||
| 0b96952eef | |||
| 376ca4649b | |||
| 66398a4da3 | |||
| 77d59a6d63 | |||
| 1d4faef7a5 | |||
| cc8df1f117 | |||
| 66c8b2f65a | |||
| f3f46b0e45 | |||
| 350646563f | |||
| d47ee5ad1c | |||
| e625030c11 | |||
| cbb9154958 | |||
| 8805abb8fc | |||
| bee5738f77 |
@@ -51,7 +51,7 @@ configure option should be set. This will enable additional correctness
|
|||||||
checks and all the ASSERTs to help quickly catch potential issues.
|
checks and all the ASSERTs to help quickly catch potential issues.
|
||||||
|
|
||||||
In addition, there are numerous utilities and debugging files which
|
In addition, there are numerous utilities and debugging files which
|
||||||
provide visibility in to the inner workings of ZFS. The most useful
|
provide visibility into the inner workings of ZFS. The most useful
|
||||||
of these tools are discussed in detail on the [debugging ZFS wiki
|
of these tools are discussed in detail on the [debugging ZFS wiki
|
||||||
page](https://github.com/zfsonlinux/zfs/wiki/Debugging).
|
page](https://github.com/zfsonlinux/zfs/wiki/Debugging).
|
||||||
|
|
||||||
|
|||||||
+1
-12
@@ -36,6 +36,7 @@ Makefile.in
|
|||||||
# Top level generated files specific to this top level dir
|
# Top level generated files specific to this top level dir
|
||||||
#
|
#
|
||||||
/bin
|
/bin
|
||||||
|
/build
|
||||||
/configure
|
/configure
|
||||||
/config.log
|
/config.log
|
||||||
/config.status
|
/config.status
|
||||||
@@ -62,15 +63,3 @@ cscope.*
|
|||||||
*.orig
|
*.orig
|
||||||
*.log
|
*.log
|
||||||
venv
|
venv
|
||||||
|
|
||||||
#
|
|
||||||
# Module leftovers
|
|
||||||
#
|
|
||||||
/module/avl/zavl.mod
|
|
||||||
/module/icp/icp.mod
|
|
||||||
/module/lua/zlua.mod
|
|
||||||
/module/nvpair/znvpair.mod
|
|
||||||
/module/spl/spl.mod
|
|
||||||
/module/unicode/zunicode.mod
|
|
||||||
/module/zcommon/zcommon.mod
|
|
||||||
/module/zfs/zfs.mod
|
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ notable exceptions and their respective licenses include:
|
|||||||
* AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
|
* AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
|
||||||
* PBKDF2 Implementation: lib/libzfs/THIRDPARTYLICENSE.openssl
|
* PBKDF2 Implementation: lib/libzfs/THIRDPARTYLICENSE.openssl
|
||||||
* SPL Implementation: module/spl/THIRDPARTYLICENSE.gplv2
|
* SPL Implementation: module/spl/THIRDPARTYLICENSE.gplv2
|
||||||
|
* GCM Implementaion: module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
|
||||||
|
* GCM Implementaion: module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
|
||||||
|
* GHASH Implementaion: module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
|
||||||
|
* GHASH Implementaion: module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
|
||||||
|
|
||||||
This product includes software developed by the OpenSSL Project for use
|
This product includes software developed by the OpenSSL Project for use
|
||||||
in the OpenSSL Toolkit (http://www.openssl.org/)
|
in the OpenSSL Toolkit (http://www.openssl.org/)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 0.8.2
|
Version: 0.8.4
|
||||||
Release: 1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS on Linux
|
Author: OpenZFS on Linux
|
||||||
Linux-Maximum: 5.3
|
Linux-Maximum: 5.6
|
||||||
Linux-Minimum: 2.6.32
|
Linux-Minimum: 2.6.32
|
||||||
|
|||||||
+14
-8
@@ -25,11 +25,16 @@ EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
|
|||||||
EXTRA_DIST += CODE_OF_CONDUCT.md
|
EXTRA_DIST += CODE_OF_CONDUCT.md
|
||||||
|
|
||||||
# Include all the extra licensing information for modules
|
# Include all the extra licensing information for modules
|
||||||
EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE module/icp/algs/skein/THIRDPARTYLICENSE.descrip
|
EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
|
||||||
EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
|
EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
|
||||||
EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
|
EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
|
||||||
EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2 module/spl/THIRDPARTYLICENSE.gplv2.descrip
|
EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
|
||||||
EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash module/zfs/THIRDPARTYLICENSE.cityhash.descrip
|
EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
|
||||||
|
EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
|
||||||
|
EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2
|
||||||
|
EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2.descrip
|
||||||
|
EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
|
||||||
|
EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
|
||||||
|
|
||||||
@CODE_COVERAGE_RULES@
|
@CODE_COVERAGE_RULES@
|
||||||
|
|
||||||
@@ -39,8 +44,9 @@ gitrev:
|
|||||||
|
|
||||||
BUILT_SOURCES = gitrev
|
BUILT_SOURCES = gitrev
|
||||||
|
|
||||||
|
# Double-colon rules are allowed; there are multiple independent definitions.
|
||||||
distclean-local::
|
distclean-local::
|
||||||
-$(RM) -R autom4te*.cache
|
-$(RM) -R autom4te*.cache build
|
||||||
-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
|
-find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
|
||||||
-o -name .pc -o -name .hg -o -name .git \) -prune -o \
|
-o -name .pc -o -name .hg -o -name .git \) -prune -o \
|
||||||
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
||||||
@@ -87,8 +93,8 @@ commitcheck:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cstyle:
|
cstyle:
|
||||||
@find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
|
@find ${top_srcdir} -name build -prune -o -name '*.[hc]' \
|
||||||
! -name '*.mod.c' -type f \
|
! -name 'zfs_config.*' ! -name '*.mod.c' -type f \
|
||||||
-exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
|
-exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
|
||||||
|
|
||||||
shellcheck:
|
shellcheck:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python2
|
#!/usr/bin/env python2
|
||||||
#
|
#
|
||||||
# $Id: arc_summary.pl,v 388:e27800740aa2 2011-07-08 02:53:29Z jhell $
|
# $Id: arc_summary.pl,v 388:e27800740aa2 2011-07-08 02:53:29Z jhell $
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 Ben Rockwood <benr@cuddletech.com>,
|
# Copyright (c) 2008 Ben Rockwood <benr@cuddletech.com>,
|
||||||
# Copyright (c) 2010 Martin Matuska <mm@FreeBSD.org>,
|
# Copyright (c) 2010 Martin Matuska <mm@FreeBSD.org>,
|
||||||
@@ -43,7 +43,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
DECRIPTION = 'Print ARC and other statistics for ZFS on Linux'
|
DESCRIPTION = 'Print ARC and other statistics for ZFS on Linux'
|
||||||
INDENT = ' '*8
|
INDENT = ' '*8
|
||||||
LINE_LENGTH = 72
|
LINE_LENGTH = 72
|
||||||
PROC_PATH = '/proc/spl/kstat/zfs/'
|
PROC_PATH = '/proc/spl/kstat/zfs/'
|
||||||
@@ -65,7 +65,7 @@ SECTION_PATHS = {'arc': 'arcstats',
|
|||||||
'zfetch': 'zfetchstats',
|
'zfetch': 'zfetchstats',
|
||||||
'zil': 'zil'}
|
'zil': 'zil'}
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description=DECRIPTION)
|
parser = argparse.ArgumentParser(description=DESCRIPTION)
|
||||||
parser.add_argument('-a', '--alternate', action='store_true', default=False,
|
parser.add_argument('-a', '--alternate', action='store_true', default=False,
|
||||||
help='use alternate formatting for tunables and SPL',
|
help='use alternate formatting for tunables and SPL',
|
||||||
dest='alt')
|
dest='alt')
|
||||||
@@ -284,7 +284,7 @@ def get_spl_tunables(PATH):
|
|||||||
|
|
||||||
|
|
||||||
def get_descriptions(request):
|
def get_descriptions(request):
|
||||||
"""Get the decriptions of the Solaris Porting Layer (SPL) or the
|
"""Get the descriptions of the Solaris Porting Layer (SPL) or the
|
||||||
tunables, return with minimal formatting.
|
tunables, return with minimal formatting.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -677,10 +677,10 @@ def section_l2arc(kstats_dict):
|
|||||||
prt_1('L2ARC breakdown:', f_hits(l2_access_total))
|
prt_1('L2ARC breakdown:', f_hits(l2_access_total))
|
||||||
prt_i2('Hit ratio:',
|
prt_i2('Hit ratio:',
|
||||||
f_perc(arc_stats['l2_hits'], l2_access_total),
|
f_perc(arc_stats['l2_hits'], l2_access_total),
|
||||||
f_bytes(arc_stats['l2_hits']))
|
f_hits(arc_stats['l2_hits']))
|
||||||
prt_i2('Miss ratio:',
|
prt_i2('Miss ratio:',
|
||||||
f_perc(arc_stats['l2_misses'], l2_access_total),
|
f_perc(arc_stats['l2_misses'], l2_access_total),
|
||||||
f_bytes(arc_stats['l2_misses']))
|
f_hits(arc_stats['l2_misses']))
|
||||||
prt_i1('Feeds:', f_hits(arc_stats['l2_feeds']))
|
prt_i1('Feeds:', f_hits(arc_stats['l2_feeds']))
|
||||||
|
|
||||||
print()
|
print()
|
||||||
@@ -708,7 +708,7 @@ def section_l2arc(kstats_dict):
|
|||||||
|
|
||||||
def section_spl(*_):
|
def section_spl(*_):
|
||||||
"""Print the SPL parameters, if requested with alternative format
|
"""Print the SPL parameters, if requested with alternative format
|
||||||
and/or decriptions. This does not use kstats.
|
and/or descriptions. This does not use kstats.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
spls = get_spl_tunables(SPL_PATH)
|
spls = get_spl_tunables(SPL_PATH)
|
||||||
@@ -725,7 +725,7 @@ def section_spl(*_):
|
|||||||
try:
|
try:
|
||||||
print(INDENT+'#', descriptions[key])
|
print(INDENT+'#', descriptions[key])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print(INDENT+'# (No decription found)') # paranoid
|
print(INDENT+'# (No description found)') # paranoid
|
||||||
|
|
||||||
print(format_raw_line(key, value))
|
print(format_raw_line(key, value))
|
||||||
|
|
||||||
@@ -734,7 +734,7 @@ def section_spl(*_):
|
|||||||
|
|
||||||
def section_tunables(*_):
|
def section_tunables(*_):
|
||||||
"""Print the tunables, if requested with alternative format and/or
|
"""Print the tunables, if requested with alternative format and/or
|
||||||
decriptions. This does not use kstasts.
|
descriptions. This does not use kstasts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
tunables = get_spl_tunables(TUNABLES_PATH)
|
tunables = get_spl_tunables(TUNABLES_PATH)
|
||||||
@@ -751,7 +751,7 @@ def section_tunables(*_):
|
|||||||
try:
|
try:
|
||||||
print(INDENT+'#', descriptions[key])
|
print(INDENT+'#', descriptions[key])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print(INDENT+'# (No decription found)') # paranoid
|
print(INDENT+'# (No description found)') # paranoid
|
||||||
|
|
||||||
print(format_raw_line(key, value))
|
print(format_raw_line(key, value))
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
dist_bin_SCRIPTS = arcstat
|
dist_bin_SCRIPTS = arcstat
|
||||||
|
|
||||||
#
|
#
|
||||||
# The arcstat script is compatibile with both Python 2.6 and 3.4.
|
# The arcstat script is compatible with both Python 2.6 and 3.4.
|
||||||
# As such the python 3 shebang can be replaced at install time when
|
# As such the python 3 shebang can be replaced at install time when
|
||||||
# targeting a python 2 system. This allows us to maintain a single
|
# targeting a python 2 system. This allows us to maintain a single
|
||||||
# version of the source.
|
# version of the source.
|
||||||
#
|
#
|
||||||
if USING_PYTHON_2
|
if USING_PYTHON_2
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
sed --in-place 's|^#!/usr/bin/python3|#!/usr/bin/python2|' \
|
sed --in-place 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
|
||||||
$(DESTDIR)$(bindir)/arcstat
|
$(DESTDIR)$(bindir)/arcstat
|
||||||
endif
|
endif
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Print out ZFS ARC Statistics exported via kstat(1)
|
# Print out ZFS ARC Statistics exported via kstat(1)
|
||||||
# For a definition of fields, or usage, use arctstat.pl -v
|
# For a definition of fields, or usage, use arctstat.pl -v
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
dist_bin_SCRIPTS = dbufstat
|
dist_bin_SCRIPTS = dbufstat
|
||||||
|
|
||||||
#
|
#
|
||||||
# The dbufstat script is compatibile with both Python 2.6 and 3.4.
|
# The dbufstat script is compatible with both Python 2.6 and 3.4.
|
||||||
# As such the python 3 shebang can be replaced at install time when
|
# As such the python 3 shebang can be replaced at install time when
|
||||||
# targeting a python 2 system. This allows us to maintain a single
|
# targeting a python 2 system. This allows us to maintain a single
|
||||||
# version of the source.
|
# version of the source.
|
||||||
#
|
#
|
||||||
if USING_PYTHON_2
|
if USING_PYTHON_2
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
sed --in-place 's|^#!/usr/bin/python3|#!/usr/bin/python2|' \
|
sed --in-place 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
|
||||||
$(DESTDIR)$(bindir)/dbufstat
|
$(DESTDIR)$(bindir)/dbufstat
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Print out statistics for all cached dmu buffers. This information
|
# Print out statistics for all cached dmu buffers. This information
|
||||||
# is available through the dbufs kstat and may be post-processed as
|
# is available through the dbufs kstat and may be post-processed as
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# fsck.zfs: A fsck helper to accomidate distributions that expect
|
# fsck.zfs: A fsck helper to accommodate distributions that expect
|
||||||
# to be able to execute a fsck on all filesystem types. Currently
|
# to be able to execute a fsck on all filesystem types. Currently
|
||||||
# this script does nothing but it could be extended to act as a
|
# this script does nothing but it could be extended to act as a
|
||||||
# compatibility wrapper for 'zpool scrub'.
|
# compatibility wrapper for 'zpool scrub'.
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ main(int argc, char **argv)
|
|||||||
zfsutil = 1;
|
zfsutil = 1;
|
||||||
|
|
||||||
if ((g_zfs = libzfs_init()) == NULL) {
|
if ((g_zfs = libzfs_init()) == NULL) {
|
||||||
(void) fprintf(stderr, "%s", libzfs_error_init(errno));
|
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
||||||
return (MOUNT_SYSERR);
|
return (MOUNT_SYSERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -102,7 +102,7 @@ Usage: vdev_id [-h]
|
|||||||
vdev_id <-d device> [-c config_file] [-p phys_per_port]
|
vdev_id <-d device> [-c config_file] [-p phys_per_port]
|
||||||
[-g sas_direct|sas_switch|scsi] [-m]
|
[-g sas_direct|sas_switch|scsi] [-m]
|
||||||
|
|
||||||
-c specify name of alernate config file [default=$CONFIG]
|
-c specify name of an alternative config file [default=$CONFIG]
|
||||||
-d specify basename of device (i.e. sda)
|
-d specify basename of device (i.e. sda)
|
||||||
-e Create enclose device symlinks only (/dev/by-enclosure)
|
-e Create enclose device symlinks only (/dev/by-enclosure)
|
||||||
-g Storage network topology [default="$TOPOLOGY"]
|
-g Storage network topology [default="$TOPOLOGY"]
|
||||||
|
|||||||
+155
-62
@@ -26,6 +26,7 @@
|
|||||||
* Copyright 2016 Nexenta Systems, Inc.
|
* Copyright 2016 Nexenta Systems, Inc.
|
||||||
* Copyright (c) 2017, 2018 Lawrence Livermore National Security, LLC.
|
* Copyright (c) 2017, 2018 Lawrence Livermore National Security, LLC.
|
||||||
* Copyright (c) 2015, 2017, Intel Corporation.
|
* Copyright (c) 2015, 2017, Intel Corporation.
|
||||||
|
* Copyright (c) 2019 Datto Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -109,7 +110,7 @@ typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
|
|||||||
|
|
||||||
uint64_t *zopt_object = NULL;
|
uint64_t *zopt_object = NULL;
|
||||||
static unsigned zopt_objects = 0;
|
static unsigned zopt_objects = 0;
|
||||||
uint64_t max_inflight = 1000;
|
uint64_t max_inflight_bytes = 256 * 1024 * 1024; /* 256MB */
|
||||||
static int leaked_objects = 0;
|
static int leaked_objects = 0;
|
||||||
static range_tree_t *mos_refd_objs;
|
static range_tree_t *mos_refd_objs;
|
||||||
|
|
||||||
@@ -1449,6 +1450,12 @@ snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp)
|
|||||||
(u_longlong_t)BP_GET_FILL(bp),
|
(u_longlong_t)BP_GET_FILL(bp),
|
||||||
(u_longlong_t)bp->blk_birth,
|
(u_longlong_t)bp->blk_birth,
|
||||||
(u_longlong_t)BP_PHYSICAL_BIRTH(bp));
|
(u_longlong_t)BP_PHYSICAL_BIRTH(bp));
|
||||||
|
(void) snprintf(blkbuf + strlen(blkbuf),
|
||||||
|
buflen - strlen(blkbuf), " cksum=%llx:%llx:%llx:%llx",
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[0],
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[1],
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[2],
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2408,7 +2415,7 @@ static const char *objset_types[DMU_OST_NUMTYPES] = {
|
|||||||
static void
|
static void
|
||||||
dump_dir(objset_t *os)
|
dump_dir(objset_t *os)
|
||||||
{
|
{
|
||||||
dmu_objset_stats_t dds;
|
dmu_objset_stats_t dds = { 0 };
|
||||||
uint64_t object, object_count;
|
uint64_t object, object_count;
|
||||||
uint64_t refdbytes, usedobjs, scratch;
|
uint64_t refdbytes, usedobjs, scratch;
|
||||||
char numbuf[32];
|
char numbuf[32];
|
||||||
@@ -3449,7 +3456,7 @@ zdb_blkptr_done(zio_t *zio)
|
|||||||
abd_free(zio->io_abd);
|
abd_free(zio->io_abd);
|
||||||
|
|
||||||
mutex_enter(&spa->spa_scrub_lock);
|
mutex_enter(&spa->spa_scrub_lock);
|
||||||
spa->spa_load_verify_ios--;
|
spa->spa_load_verify_bytes -= BP_GET_PSIZE(bp);
|
||||||
cv_broadcast(&spa->spa_scrub_io_cv);
|
cv_broadcast(&spa->spa_scrub_io_cv);
|
||||||
|
|
||||||
if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
|
if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
|
||||||
@@ -3520,9 +3527,9 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
|||||||
flags |= ZIO_FLAG_SPECULATIVE;
|
flags |= ZIO_FLAG_SPECULATIVE;
|
||||||
|
|
||||||
mutex_enter(&spa->spa_scrub_lock);
|
mutex_enter(&spa->spa_scrub_lock);
|
||||||
while (spa->spa_load_verify_ios > max_inflight)
|
while (spa->spa_load_verify_bytes > max_inflight_bytes)
|
||||||
cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock);
|
cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock);
|
||||||
spa->spa_load_verify_ios++;
|
spa->spa_load_verify_bytes += size;
|
||||||
mutex_exit(&spa->spa_scrub_lock);
|
mutex_exit(&spa->spa_scrub_lock);
|
||||||
|
|
||||||
zio_nowait(zio_read(NULL, spa, bp, abd, size,
|
zio_nowait(zio_read(NULL, spa, bp, abd, size,
|
||||||
@@ -4285,6 +4292,7 @@ dump_block_stats(spa_t *spa)
|
|||||||
ZIO_FLAG_GODFATHER);
|
ZIO_FLAG_GODFATHER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ASSERT0(spa->spa_load_verify_bytes);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Done after zio_wait() since zcb_haderrors is modified in
|
* Done after zio_wait() since zcb_haderrors is modified in
|
||||||
@@ -4778,7 +4786,7 @@ zdb_set_skip_mmp(char *target)
|
|||||||
* the name of the target pool.
|
* the name of the target pool.
|
||||||
*
|
*
|
||||||
* Note that the checkpointed state's pool name will be the name of
|
* Note that the checkpointed state's pool name will be the name of
|
||||||
* the original pool with the above suffix appened to it. In addition,
|
* the original pool with the above suffix appended to it. In addition,
|
||||||
* if the target is not a pool name (e.g. a path to a dataset) then
|
* if the target is not a pool name (e.g. a path to a dataset) then
|
||||||
* the new_path parameter is populated with the updated path to
|
* the new_path parameter is populated with the updated path to
|
||||||
* reflect the fact that we are looking into the checkpointed state.
|
* reflect the fact that we are looking into the checkpointed state.
|
||||||
@@ -5445,9 +5453,9 @@ dump_zpool(spa_t *spa)
|
|||||||
#define ZDB_FLAG_BSWAP 0x0004
|
#define ZDB_FLAG_BSWAP 0x0004
|
||||||
#define ZDB_FLAG_GBH 0x0008
|
#define ZDB_FLAG_GBH 0x0008
|
||||||
#define ZDB_FLAG_INDIRECT 0x0010
|
#define ZDB_FLAG_INDIRECT 0x0010
|
||||||
#define ZDB_FLAG_PHYS 0x0020
|
#define ZDB_FLAG_RAW 0x0020
|
||||||
#define ZDB_FLAG_RAW 0x0040
|
#define ZDB_FLAG_PRINT_BLKPTR 0x0040
|
||||||
#define ZDB_FLAG_PRINT_BLKPTR 0x0080
|
#define ZDB_FLAG_VERBOSE 0x0080
|
||||||
|
|
||||||
static int flagbits[256];
|
static int flagbits[256];
|
||||||
|
|
||||||
@@ -5578,11 +5586,30 @@ name:
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean_t
|
||||||
|
zdb_parse_block_sizes(char *sizes, uint64_t *lsize, uint64_t *psize)
|
||||||
|
{
|
||||||
|
char *s0, *s1;
|
||||||
|
|
||||||
|
if (sizes == NULL)
|
||||||
|
return (B_FALSE);
|
||||||
|
|
||||||
|
s0 = strtok(sizes, "/");
|
||||||
|
if (s0 == NULL)
|
||||||
|
return (B_FALSE);
|
||||||
|
s1 = strtok(NULL, "/");
|
||||||
|
*lsize = strtoull(s0, NULL, 16);
|
||||||
|
*psize = s1 ? strtoull(s1, NULL, 16) : *lsize;
|
||||||
|
return (*lsize >= *psize && *psize > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ZIO_COMPRESS_MASK(alg) (1ULL << (ZIO_COMPRESS_##alg))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read a block from a pool and print it out. The syntax of the
|
* Read a block from a pool and print it out. The syntax of the
|
||||||
* block descriptor is:
|
* block descriptor is:
|
||||||
*
|
*
|
||||||
* pool:vdev_specifier:offset:size[:flags]
|
* pool:vdev_specifier:offset:[lsize/]psize[:flags]
|
||||||
*
|
*
|
||||||
* pool - The name of the pool you wish to read from
|
* pool - The name of the pool you wish to read from
|
||||||
* vdev_specifier - Which vdev (see comment for zdb_vdev_lookup)
|
* vdev_specifier - Which vdev (see comment for zdb_vdev_lookup)
|
||||||
@@ -5590,15 +5617,14 @@ name:
|
|||||||
* size - Amount of data to read, in hex, in bytes
|
* size - Amount of data to read, in hex, in bytes
|
||||||
* flags - A string of characters specifying options
|
* flags - A string of characters specifying options
|
||||||
* b: Decode a blkptr at given offset within block
|
* b: Decode a blkptr at given offset within block
|
||||||
* *c: Calculate and display checksums
|
* c: Calculate and display checksums
|
||||||
* d: Decompress data before dumping
|
* d: Decompress data before dumping
|
||||||
* e: Byteswap data before dumping
|
* e: Byteswap data before dumping
|
||||||
* g: Display data as a gang block header
|
* g: Display data as a gang block header
|
||||||
* i: Display as an indirect block
|
* i: Display as an indirect block
|
||||||
* p: Do I/O to physical offset
|
|
||||||
* r: Dump raw data to stdout
|
* r: Dump raw data to stdout
|
||||||
|
* v: Verbose
|
||||||
*
|
*
|
||||||
* * = not yet implemented
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
zdb_read_block(char *thing, spa_t *spa)
|
zdb_read_block(char *thing, spa_t *spa)
|
||||||
@@ -5606,13 +5632,12 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
blkptr_t blk, *bp = &blk;
|
blkptr_t blk, *bp = &blk;
|
||||||
dva_t *dva = bp->blk_dva;
|
dva_t *dva = bp->blk_dva;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
uint64_t offset = 0, size = 0, psize = 0, lsize = 0, blkptr_offset = 0;
|
uint64_t offset = 0, psize = 0, lsize = 0, blkptr_offset = 0;
|
||||||
zio_t *zio;
|
zio_t *zio;
|
||||||
vdev_t *vd;
|
vdev_t *vd;
|
||||||
abd_t *pabd;
|
abd_t *pabd;
|
||||||
void *lbuf, *buf;
|
void *lbuf, *buf;
|
||||||
const char *s, *vdev;
|
char *s, *p, *dup, *vdev, *flagstr, *sizes;
|
||||||
char *p, *dup, *flagstr;
|
|
||||||
int i, error;
|
int i, error;
|
||||||
boolean_t borrowed = B_FALSE;
|
boolean_t borrowed = B_FALSE;
|
||||||
|
|
||||||
@@ -5621,18 +5646,14 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
vdev = s ? s : "";
|
vdev = s ? s : "";
|
||||||
s = strtok(NULL, ":");
|
s = strtok(NULL, ":");
|
||||||
offset = strtoull(s ? s : "", NULL, 16);
|
offset = strtoull(s ? s : "", NULL, 16);
|
||||||
|
sizes = strtok(NULL, ":");
|
||||||
s = strtok(NULL, ":");
|
s = strtok(NULL, ":");
|
||||||
size = strtoull(s ? s : "", NULL, 16);
|
flagstr = strdup(s ? s : "");
|
||||||
s = strtok(NULL, ":");
|
|
||||||
if (s)
|
|
||||||
flagstr = strdup(s);
|
|
||||||
else
|
|
||||||
flagstr = strdup("");
|
|
||||||
|
|
||||||
s = NULL;
|
s = NULL;
|
||||||
if (size == 0)
|
if (!zdb_parse_block_sizes(sizes, &lsize, &psize))
|
||||||
s = "size must not be zero";
|
s = "invalid size(s)";
|
||||||
if (!IS_P2ALIGNED(size, DEV_BSIZE))
|
if (!IS_P2ALIGNED(psize, DEV_BSIZE) || !IS_P2ALIGNED(lsize, DEV_BSIZE))
|
||||||
s = "size must be a multiple of sector size";
|
s = "size must be a multiple of sector size";
|
||||||
if (!IS_P2ALIGNED(offset, DEV_BSIZE))
|
if (!IS_P2ALIGNED(offset, DEV_BSIZE))
|
||||||
s = "offset must be a multiple of sector size";
|
s = "offset must be a multiple of sector size";
|
||||||
@@ -5688,9 +5709,6 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
vd->vdev_ops->vdev_op_type);
|
vd->vdev_ops->vdev_op_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
psize = size;
|
|
||||||
lsize = size;
|
|
||||||
|
|
||||||
pabd = abd_alloc_for_io(SPA_MAXBLOCKSIZE, B_FALSE);
|
pabd = abd_alloc_for_io(SPA_MAXBLOCKSIZE, B_FALSE);
|
||||||
lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
||||||
|
|
||||||
@@ -5747,30 +5765,41 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
* We don't know how the data was compressed, so just try
|
* We don't know how the data was compressed, so just try
|
||||||
* every decompress function at every inflated blocksize.
|
* every decompress function at every inflated blocksize.
|
||||||
*/
|
*/
|
||||||
enum zio_compress c;
|
|
||||||
void *lbuf2 = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
void *lbuf2 = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
|
||||||
|
int cfuncs[ZIO_COMPRESS_FUNCTIONS] = { 0 };
|
||||||
|
int *cfuncp = cfuncs;
|
||||||
|
uint64_t maxlsize = SPA_MAXBLOCKSIZE;
|
||||||
|
uint64_t mask = ZIO_COMPRESS_MASK(ON) | ZIO_COMPRESS_MASK(OFF) |
|
||||||
|
ZIO_COMPRESS_MASK(INHERIT) | ZIO_COMPRESS_MASK(EMPTY) |
|
||||||
|
(getenv("ZDB_NO_ZLE") ? ZIO_COMPRESS_MASK(ZLE) : 0);
|
||||||
|
*cfuncp++ = ZIO_COMPRESS_LZ4;
|
||||||
|
*cfuncp++ = ZIO_COMPRESS_LZJB;
|
||||||
|
mask |= ZIO_COMPRESS_MASK(LZ4) | ZIO_COMPRESS_MASK(LZJB);
|
||||||
|
for (int c = 0; c < ZIO_COMPRESS_FUNCTIONS; c++)
|
||||||
|
if (((1ULL << c) & mask) == 0)
|
||||||
|
*cfuncp++ = c;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX - On the one hand, with SPA_MAXBLOCKSIZE at 16MB,
|
* On the one hand, with SPA_MAXBLOCKSIZE at 16MB, this
|
||||||
* this could take a while and we should let the user know
|
* could take a while and we should let the user know
|
||||||
* we are not stuck. On the other hand, printing progress
|
* we are not stuck. On the other hand, printing progress
|
||||||
* info gets old after a while. What to do?
|
* info gets old after a while. User can specify 'v' flag
|
||||||
|
* to see the progression.
|
||||||
*/
|
*/
|
||||||
for (lsize = psize + SPA_MINBLOCKSIZE;
|
if (lsize == psize)
|
||||||
lsize <= SPA_MAXBLOCKSIZE; lsize += SPA_MINBLOCKSIZE) {
|
lsize += SPA_MINBLOCKSIZE;
|
||||||
for (c = 0; c < ZIO_COMPRESS_FUNCTIONS; c++) {
|
else
|
||||||
/*
|
maxlsize = lsize;
|
||||||
* ZLE can easily decompress non zle stream.
|
for (; lsize <= maxlsize; lsize += SPA_MINBLOCKSIZE) {
|
||||||
* So have an option to disable it.
|
for (cfuncp = cfuncs; *cfuncp; cfuncp++) {
|
||||||
*/
|
if (flags & ZDB_FLAG_VERBOSE) {
|
||||||
if (c == ZIO_COMPRESS_ZLE &&
|
(void) fprintf(stderr,
|
||||||
getenv("ZDB_NO_ZLE"))
|
"Trying %05llx -> %05llx (%s)\n",
|
||||||
continue;
|
(u_longlong_t)psize,
|
||||||
|
(u_longlong_t)lsize,
|
||||||
(void) fprintf(stderr,
|
zio_compress_table[*cfuncp].\
|
||||||
"Trying %05llx -> %05llx (%s)\n",
|
ci_name);
|
||||||
(u_longlong_t)psize, (u_longlong_t)lsize,
|
}
|
||||||
zio_compress_table[c].ci_name);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We randomize lbuf2, and decompress to both
|
* We randomize lbuf2, and decompress to both
|
||||||
@@ -5779,27 +5808,30 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
*/
|
*/
|
||||||
VERIFY0(random_get_pseudo_bytes(lbuf2, lsize));
|
VERIFY0(random_get_pseudo_bytes(lbuf2, lsize));
|
||||||
|
|
||||||
if (zio_decompress_data(c, pabd,
|
if (zio_decompress_data(*cfuncp, pabd,
|
||||||
lbuf, psize, lsize) == 0 &&
|
lbuf, psize, lsize) == 0 &&
|
||||||
zio_decompress_data(c, pabd,
|
zio_decompress_data(*cfuncp, pabd,
|
||||||
lbuf2, psize, lsize) == 0 &&
|
lbuf2, psize, lsize) == 0 &&
|
||||||
bcmp(lbuf, lbuf2, lsize) == 0)
|
bcmp(lbuf, lbuf2, lsize) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c != ZIO_COMPRESS_FUNCTIONS)
|
if (*cfuncp != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
umem_free(lbuf2, SPA_MAXBLOCKSIZE);
|
umem_free(lbuf2, SPA_MAXBLOCKSIZE);
|
||||||
|
|
||||||
if (lsize > SPA_MAXBLOCKSIZE) {
|
if (lsize > maxlsize) {
|
||||||
(void) printf("Decompress of %s failed\n", thing);
|
(void) printf("Decompress of %s failed\n", thing);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
buf = lbuf;
|
buf = lbuf;
|
||||||
size = lsize;
|
if (*cfuncp == ZIO_COMPRESS_ZLE) {
|
||||||
|
printf("\nZLE decompression was selected. If you "
|
||||||
|
"suspect the results are wrong,\ntry avoiding ZLE "
|
||||||
|
"by setting and exporting ZDB_NO_ZLE=\"true\"\n");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
size = psize;
|
buf = abd_borrow_buf_copy(pabd, lsize);
|
||||||
buf = abd_borrow_buf_copy(pabd, size);
|
|
||||||
borrowed = B_TRUE;
|
borrowed = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5807,17 +5839,78 @@ zdb_read_block(char *thing, spa_t *spa)
|
|||||||
zdb_print_blkptr((blkptr_t *)(void *)
|
zdb_print_blkptr((blkptr_t *)(void *)
|
||||||
((uintptr_t)buf + (uintptr_t)blkptr_offset), flags);
|
((uintptr_t)buf + (uintptr_t)blkptr_offset), flags);
|
||||||
else if (flags & ZDB_FLAG_RAW)
|
else if (flags & ZDB_FLAG_RAW)
|
||||||
zdb_dump_block_raw(buf, size, flags);
|
zdb_dump_block_raw(buf, lsize, flags);
|
||||||
else if (flags & ZDB_FLAG_INDIRECT)
|
else if (flags & ZDB_FLAG_INDIRECT)
|
||||||
zdb_dump_indirect((blkptr_t *)buf, size / sizeof (blkptr_t),
|
zdb_dump_indirect((blkptr_t *)buf, lsize / sizeof (blkptr_t),
|
||||||
flags);
|
flags);
|
||||||
else if (flags & ZDB_FLAG_GBH)
|
else if (flags & ZDB_FLAG_GBH)
|
||||||
zdb_dump_gbh(buf, flags);
|
zdb_dump_gbh(buf, flags);
|
||||||
else
|
else
|
||||||
zdb_dump_block(thing, buf, size, flags);
|
zdb_dump_block(thing, buf, lsize, flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If :c was specified, iterate through the checksum table to
|
||||||
|
* calculate and display each checksum for our specified
|
||||||
|
* DVA and length.
|
||||||
|
*/
|
||||||
|
if ((flags & ZDB_FLAG_CHECKSUM) && !(flags & ZDB_FLAG_RAW) &&
|
||||||
|
!(flags & ZDB_FLAG_GBH)) {
|
||||||
|
zio_t *czio, *cio;
|
||||||
|
(void) printf("\n");
|
||||||
|
for (enum zio_checksum ck = ZIO_CHECKSUM_LABEL;
|
||||||
|
ck < ZIO_CHECKSUM_FUNCTIONS; ck++) {
|
||||||
|
|
||||||
|
if ((zio_checksum_table[ck].ci_flags &
|
||||||
|
ZCHECKSUM_FLAG_EMBEDDED) ||
|
||||||
|
ck == ZIO_CHECKSUM_NOPARITY) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
BP_SET_CHECKSUM(bp, ck);
|
||||||
|
spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
|
||||||
|
czio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
|
||||||
|
czio->io_bp = bp;
|
||||||
|
|
||||||
|
if (vd == vd->vdev_top) {
|
||||||
|
cio = zio_read(czio, spa, bp, pabd, psize,
|
||||||
|
NULL, NULL,
|
||||||
|
ZIO_PRIORITY_SYNC_READ,
|
||||||
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW |
|
||||||
|
ZIO_FLAG_DONT_RETRY, NULL);
|
||||||
|
zio_nowait(cio);
|
||||||
|
} else {
|
||||||
|
zio_nowait(zio_vdev_child_io(czio, bp, vd,
|
||||||
|
offset, pabd, psize, ZIO_TYPE_READ,
|
||||||
|
ZIO_PRIORITY_SYNC_READ,
|
||||||
|
ZIO_FLAG_DONT_CACHE |
|
||||||
|
ZIO_FLAG_DONT_PROPAGATE |
|
||||||
|
ZIO_FLAG_DONT_RETRY |
|
||||||
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW |
|
||||||
|
ZIO_FLAG_SPECULATIVE |
|
||||||
|
ZIO_FLAG_OPTIONAL, NULL, NULL));
|
||||||
|
}
|
||||||
|
error = zio_wait(czio);
|
||||||
|
if (error == 0 || error == ECKSUM) {
|
||||||
|
zio_t *ck_zio = zio_root(spa, NULL, NULL, 0);
|
||||||
|
ck_zio->io_offset =
|
||||||
|
DVA_GET_OFFSET(&bp->blk_dva[0]);
|
||||||
|
ck_zio->io_bp = bp;
|
||||||
|
zio_checksum_compute(ck_zio, ck, pabd, lsize);
|
||||||
|
printf("%12s\tcksum=%llx:%llx:%llx:%llx\n",
|
||||||
|
zio_checksum_table[ck].ci_name,
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[0],
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[1],
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[2],
|
||||||
|
(u_longlong_t)bp->blk_cksum.zc_word[3]);
|
||||||
|
zio_wait(ck_zio);
|
||||||
|
} else {
|
||||||
|
printf("error %d reading block\n", error);
|
||||||
|
}
|
||||||
|
spa_config_exit(spa, SCL_STATE, FTAG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (borrowed)
|
if (borrowed)
|
||||||
abd_return_buf_copy(pabd, buf, size);
|
abd_return_buf_copy(pabd, buf, lsize);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
abd_free(pabd);
|
abd_free(pabd);
|
||||||
@@ -5933,10 +6026,10 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
/* NB: Sort single match options below. */
|
/* NB: Sort single match options below. */
|
||||||
case 'I':
|
case 'I':
|
||||||
max_inflight = strtoull(optarg, NULL, 0);
|
max_inflight_bytes = strtoull(optarg, NULL, 0);
|
||||||
if (max_inflight == 0) {
|
if (max_inflight_bytes == 0) {
|
||||||
(void) fprintf(stderr, "maximum number "
|
(void) fprintf(stderr, "maximum number "
|
||||||
"of inflight I/Os must be greater "
|
"of inflight bytes must be greater "
|
||||||
"than 0\n");
|
"than 0\n");
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
@@ -6232,8 +6325,8 @@ main(int argc, char **argv)
|
|||||||
flagbits['e'] = ZDB_FLAG_BSWAP;
|
flagbits['e'] = ZDB_FLAG_BSWAP;
|
||||||
flagbits['g'] = ZDB_FLAG_GBH;
|
flagbits['g'] = ZDB_FLAG_GBH;
|
||||||
flagbits['i'] = ZDB_FLAG_INDIRECT;
|
flagbits['i'] = ZDB_FLAG_INDIRECT;
|
||||||
flagbits['p'] = ZDB_FLAG_PHYS;
|
|
||||||
flagbits['r'] = ZDB_FLAG_RAW;
|
flagbits['r'] = ZDB_FLAG_RAW;
|
||||||
|
flagbits['v'] = ZDB_FLAG_VERBOSE;
|
||||||
|
|
||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
zdb_read_block(argv[i], spa);
|
zdb_read_block(argv[i], spa);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file imlements the minimal FMD module API required to support the
|
* This file implements the minimal FMD module API required to support the
|
||||||
* fault logic modules in ZED. This support includes module registration,
|
* fault logic modules in ZED. This support includes module registration,
|
||||||
* memory allocation, module property accessors, basic case management,
|
* memory allocation, module property accessors, basic case management,
|
||||||
* one-shot timers and SERD engines.
|
* one-shot timers and SERD engines.
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ fmd_serd_eng_empty(fmd_serd_eng_t *sgp)
|
|||||||
void
|
void
|
||||||
fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
|
fmd_serd_eng_reset(fmd_serd_eng_t *sgp)
|
||||||
{
|
{
|
||||||
serd_log_msg(" SERD Engine: reseting %s", sgp->sg_name);
|
serd_log_msg(" SERD Engine: resetting %s", sgp->sg_name);
|
||||||
|
|
||||||
while (sgp->sg_count != 0)
|
while (sgp->sg_count != 0)
|
||||||
fmd_serd_eng_discard(sgp, list_head(&sgp->sg_list));
|
fmd_serd_eng_discard(sgp, list_head(&sgp->sg_list));
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ zfs_unavail_pool(zpool_handle_t *zhp, void *data)
|
|||||||
* 1. physical match with no fs, no partition
|
* 1. physical match with no fs, no partition
|
||||||
* tag it top, partition disk
|
* tag it top, partition disk
|
||||||
*
|
*
|
||||||
* 2. physical match again, see partion and tag
|
* 2. physical match again, see partition and tag
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -674,7 +674,7 @@ zfs_deliver_add(nvlist_t *nvl, boolean_t is_lofi)
|
|||||||
devid, devpath ? devpath : "NULL", is_slice);
|
devid, devpath ? devpath : "NULL", is_slice);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over all vdevs looking for a match in the folllowing order:
|
* Iterate over all vdevs looking for a match in the following order:
|
||||||
* 1. ZPOOL_CONFIG_DEVID (identifies the unique disk)
|
* 1. ZPOOL_CONFIG_DEVID (identifies the unique disk)
|
||||||
* 2. ZPOOL_CONFIG_PHYS_PATH (identifies disk physical location).
|
* 2. ZPOOL_CONFIG_PHYS_PATH (identifies disk physical location).
|
||||||
*
|
*
|
||||||
@@ -892,7 +892,7 @@ zfs_enum_pools(void *arg)
|
|||||||
*
|
*
|
||||||
* sent messages from zevents or udev monitor
|
* sent messages from zevents or udev monitor
|
||||||
*
|
*
|
||||||
* For now, each agent has it's own libzfs instance
|
* For now, each agent has its own libzfs instance
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zfs_slm_init()
|
zfs_slm_init()
|
||||||
|
|||||||
@@ -46,8 +46,13 @@ case "${ZEVENT_HISTORY_INTERNAL_NAME}" in
|
|||||||
set|inherit)
|
set|inherit)
|
||||||
# Only act if one of the tracked properties is altered.
|
# Only act if one of the tracked properties is altered.
|
||||||
case "${ZEVENT_HISTORY_INTERNAL_STR%%=*}" in
|
case "${ZEVENT_HISTORY_INTERNAL_STR%%=*}" in
|
||||||
canmount|mountpoint|atime|relatime|devices|exec| \
|
canmount|mountpoint|atime|relatime|devices|exec|readonly| \
|
||||||
readonly|setuid|nbmand|encroot|keylocation) ;;
|
setuid|nbmand|encroot|keylocation|org.openzfs.systemd:requires| \
|
||||||
|
org.openzfs.systemd:requires-mounts-for| \
|
||||||
|
org.openzfs.systemd:before|org.openzfs.systemd:after| \
|
||||||
|
org.openzfs.systemd:wanted-by|org.openzfs.systemd:required-by| \
|
||||||
|
org.openzfs.systemd:nofail|org.openzfs.systemd:ignore \
|
||||||
|
) ;;
|
||||||
*) exit 0 ;;
|
*) exit 0 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@@ -61,8 +66,12 @@ esac
|
|||||||
zed_lock zfs-list
|
zed_lock zfs-list
|
||||||
trap abort_alter EXIT
|
trap abort_alter EXIT
|
||||||
|
|
||||||
PROPS="name,mountpoint,canmount,atime,relatime,devices,exec,readonly"
|
PROPS="name,mountpoint,canmount,atime,relatime,devices,exec\
|
||||||
PROPS="${PROPS},setuid,nbmand,encroot,keylocation"
|
,readonly,setuid,nbmand,encroot,keylocation\
|
||||||
|
,org.openzfs.systemd:requires,org.openzfs.systemd:requires-mounts-for\
|
||||||
|
,org.openzfs.systemd:before,org.openzfs.systemd:after\
|
||||||
|
,org.openzfs.systemd:wanted-by,org.openzfs.systemd:required-by\
|
||||||
|
,org.openzfs.systemd:nofail,org.openzfs.systemd:ignore"
|
||||||
|
|
||||||
"${ZFS}" list -H -t filesystem -o $PROPS -r "${ZEVENT_POOL}" > "${FSLIST_TMP}"
|
"${ZFS}" list -H -t filesystem -o $PROPS -r "${ZEVENT_POOL}" > "${FSLIST_TMP}"
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Exit codes:
|
# Exit codes:
|
||||||
# 0: enclosure led successfully set
|
# 0: enclosure led successfully set
|
||||||
# 1: enclosure leds not not available
|
# 1: enclosure leds not available
|
||||||
# 2: enclosure leds administratively disabled
|
# 2: enclosure leds administratively disabled
|
||||||
# 3: The led sysfs path passed from ZFS does not exist
|
# 3: The led sysfs path passed from ZFS does not exist
|
||||||
# 4: $ZPOOL not set
|
# 4: $ZPOOL not set
|
||||||
@@ -68,7 +68,7 @@ check_and_set_led()
|
|||||||
# timeout.
|
# timeout.
|
||||||
for _ in $(seq 1 5); do
|
for _ in $(seq 1 5); do
|
||||||
# We want to check the current state first, since writing to the
|
# We want to check the current state first, since writing to the
|
||||||
# 'fault' entry always always causes a SES command, even if the
|
# 'fault' entry always causes a SES command, even if the
|
||||||
# current state is already what you want.
|
# current state is already what you want.
|
||||||
current=$(cat "${file}")
|
current=$(cat "${file}")
|
||||||
|
|
||||||
|
|||||||
+71
-60
@@ -29,6 +29,7 @@
|
|||||||
* Copyright 2016 Nexenta Systems, Inc.
|
* Copyright 2016 Nexenta Systems, Inc.
|
||||||
* Copyright (c) 2019 Datto Inc.
|
* Copyright (c) 2019 Datto Inc.
|
||||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||||
|
* Copyright 2019 Joyent, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -992,10 +993,11 @@ zfs_do_create(int argc, char **argv)
|
|||||||
zpool_close(zpool_handle);
|
zpool_close(zpool_handle);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
zpool_close(zpool_handle);
|
|
||||||
|
|
||||||
volsize = zvol_volsize_to_reservation(volsize, real_props);
|
volsize = zvol_volsize_to_reservation(zpool_handle, volsize,
|
||||||
|
real_props);
|
||||||
nvlist_free(real_props);
|
nvlist_free(real_props);
|
||||||
|
zpool_close(zpool_handle);
|
||||||
|
|
||||||
if (nvlist_lookup_string(props, zfs_prop_to_name(resv_prop),
|
if (nvlist_lookup_string(props, zfs_prop_to_name(resv_prop),
|
||||||
&strval) != 0) {
|
&strval) != 0) {
|
||||||
@@ -1880,7 +1882,7 @@ zfs_do_get(int argc, char **argv)
|
|||||||
flags &= ~ZFS_ITER_PROP_LISTSNAPS;
|
flags &= ~ZFS_ITER_PROP_LISTSNAPS;
|
||||||
while (*optarg != '\0') {
|
while (*optarg != '\0') {
|
||||||
static char *type_subopts[] = { "filesystem",
|
static char *type_subopts[] = { "filesystem",
|
||||||
"volume", "snapshot", "bookmark",
|
"volume", "snapshot", "snap", "bookmark",
|
||||||
"all", NULL };
|
"all", NULL };
|
||||||
|
|
||||||
switch (getsubopt(&optarg, type_subopts,
|
switch (getsubopt(&optarg, type_subopts,
|
||||||
@@ -1892,12 +1894,13 @@ zfs_do_get(int argc, char **argv)
|
|||||||
types |= ZFS_TYPE_VOLUME;
|
types |= ZFS_TYPE_VOLUME;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
case 3:
|
||||||
types |= ZFS_TYPE_SNAPSHOT;
|
types |= ZFS_TYPE_SNAPSHOT;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 4:
|
||||||
types |= ZFS_TYPE_BOOKMARK;
|
types |= ZFS_TYPE_BOOKMARK;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 5:
|
||||||
types = ZFS_TYPE_DATASET |
|
types = ZFS_TYPE_DATASET |
|
||||||
ZFS_TYPE_BOOKMARK;
|
ZFS_TYPE_BOOKMARK;
|
||||||
break;
|
break;
|
||||||
@@ -1930,11 +1933,11 @@ zfs_do_get(int argc, char **argv)
|
|||||||
fields = argv[0];
|
fields = argv[0];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle users who want to get all snapshots of the current
|
* Handle users who want to get all snapshots or bookmarks
|
||||||
* dataset (ex. 'zfs get -t snapshot refer <dataset>').
|
* of a dataset (ex. 'zfs get -t snapshot refer <dataset>').
|
||||||
*/
|
*/
|
||||||
if (types == ZFS_TYPE_SNAPSHOT && argc > 1 &&
|
if ((types == ZFS_TYPE_SNAPSHOT || types == ZFS_TYPE_BOOKMARK) &&
|
||||||
(flags & ZFS_ITER_RECURSE) == 0 && limit == 0) {
|
argc > 1 && (flags & ZFS_ITER_RECURSE) == 0 && limit == 0) {
|
||||||
flags |= (ZFS_ITER_DEPTH_LIMIT | ZFS_ITER_RECURSE);
|
flags |= (ZFS_ITER_DEPTH_LIMIT | ZFS_ITER_RECURSE);
|
||||||
limit = 1;
|
limit = 1;
|
||||||
}
|
}
|
||||||
@@ -3434,11 +3437,11 @@ zfs_do_list(int argc, char **argv)
|
|||||||
types &= ~ZFS_TYPE_SNAPSHOT;
|
types &= ~ZFS_TYPE_SNAPSHOT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle users who want to list all snapshots of the current
|
* Handle users who want to list all snapshots or bookmarks
|
||||||
* dataset (ex. 'zfs list -t snapshot <dataset>').
|
* of the current dataset (ex. 'zfs list -t snapshot <dataset>').
|
||||||
*/
|
*/
|
||||||
if (types == ZFS_TYPE_SNAPSHOT && argc > 0 &&
|
if ((types == ZFS_TYPE_SNAPSHOT || types == ZFS_TYPE_BOOKMARK) &&
|
||||||
(flags & ZFS_ITER_RECURSE) == 0 && limit == 0) {
|
argc > 0 && (flags & ZFS_ITER_RECURSE) == 0 && limit == 0) {
|
||||||
flags |= (ZFS_ITER_DEPTH_LIMIT | ZFS_ITER_RECURSE);
|
flags |= (ZFS_ITER_DEPTH_LIMIT | ZFS_ITER_RECURSE);
|
||||||
limit = 1;
|
limit = 1;
|
||||||
}
|
}
|
||||||
@@ -4141,6 +4144,16 @@ zfs_do_send(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flags.dedup) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("WARNING: deduplicated send is "
|
||||||
|
"deprecated, and will be removed in a\n"
|
||||||
|
"future release. (In the future, the flag will be "
|
||||||
|
"accepted, but a\n"
|
||||||
|
"regular, non-deduplicated stream will be "
|
||||||
|
"generated.)\n\n"));
|
||||||
|
}
|
||||||
|
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
@@ -4893,7 +4906,6 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl)
|
|||||||
zfs_deleg_who_type_t perm_type = name[0];
|
zfs_deleg_who_type_t perm_type = name[0];
|
||||||
char perm_locality = name[1];
|
char perm_locality = name[1];
|
||||||
const char *perm_name = name + 3;
|
const char *perm_name = name + 3;
|
||||||
boolean_t is_set = B_TRUE;
|
|
||||||
who_perm_t *who_perm = NULL;
|
who_perm_t *who_perm = NULL;
|
||||||
|
|
||||||
assert('$' == name[2]);
|
assert('$' == name[2]);
|
||||||
@@ -4923,57 +4935,56 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl)
|
|||||||
assert(!"unhandled zfs_deleg_who_type_t");
|
assert(!"unhandled zfs_deleg_who_type_t");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_set) {
|
who_perm_node_t *found_node = NULL;
|
||||||
who_perm_node_t *found_node = NULL;
|
who_perm_node_t *node = safe_malloc(
|
||||||
who_perm_node_t *node = safe_malloc(
|
sizeof (who_perm_node_t));
|
||||||
sizeof (who_perm_node_t));
|
who_perm = &node->who_perm;
|
||||||
who_perm = &node->who_perm;
|
uu_avl_index_t idx = 0;
|
||||||
uu_avl_index_t idx = 0;
|
|
||||||
|
|
||||||
uu_avl_node_init(node, &node->who_avl_node, avl_pool);
|
uu_avl_node_init(node, &node->who_avl_node, avl_pool);
|
||||||
who_perm_init(who_perm, fsperm, perm_type, perm_name);
|
who_perm_init(who_perm, fsperm, perm_type, perm_name);
|
||||||
|
|
||||||
if ((found_node = uu_avl_find(avl, node, NULL, &idx))
|
if ((found_node = uu_avl_find(avl, node, NULL, &idx))
|
||||||
== NULL) {
|
== NULL) {
|
||||||
if (avl == fsperm->fsp_uge_avl) {
|
if (avl == fsperm->fsp_uge_avl) {
|
||||||
uid_t rid = 0;
|
uid_t rid = 0;
|
||||||
struct passwd *p = NULL;
|
struct passwd *p = NULL;
|
||||||
struct group *g = NULL;
|
struct group *g = NULL;
|
||||||
const char *nice_name = NULL;
|
const char *nice_name = NULL;
|
||||||
|
|
||||||
switch (perm_type) {
|
switch (perm_type) {
|
||||||
case ZFS_DELEG_USER_SETS:
|
case ZFS_DELEG_USER_SETS:
|
||||||
case ZFS_DELEG_USER:
|
case ZFS_DELEG_USER:
|
||||||
rid = atoi(perm_name);
|
rid = atoi(perm_name);
|
||||||
p = getpwuid(rid);
|
p = getpwuid(rid);
|
||||||
if (p)
|
if (p)
|
||||||
nice_name = p->pw_name;
|
nice_name = p->pw_name;
|
||||||
break;
|
break;
|
||||||
case ZFS_DELEG_GROUP_SETS:
|
case ZFS_DELEG_GROUP_SETS:
|
||||||
case ZFS_DELEG_GROUP:
|
case ZFS_DELEG_GROUP:
|
||||||
rid = atoi(perm_name);
|
rid = atoi(perm_name);
|
||||||
g = getgrgid(rid);
|
g = getgrgid(rid);
|
||||||
if (g)
|
if (g)
|
||||||
nice_name = g->gr_name;
|
nice_name = g->gr_name;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
if (nice_name != NULL)
|
|
||||||
(void) strlcpy(
|
|
||||||
node->who_perm.who_ug_name,
|
|
||||||
nice_name, 256);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uu_avl_insert(avl, node, idx);
|
if (nice_name != NULL)
|
||||||
} else {
|
(void) strlcpy(
|
||||||
node = found_node;
|
node->who_perm.who_ug_name,
|
||||||
who_perm = &node->who_perm;
|
nice_name, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uu_avl_insert(avl, node, idx);
|
||||||
|
} else {
|
||||||
|
node = found_node;
|
||||||
|
who_perm = &node->who_perm;
|
||||||
}
|
}
|
||||||
VERIFY3P(who_perm, !=, NULL);
|
|
||||||
|
assert(who_perm != NULL);
|
||||||
(void) parse_who_perm(who_perm, nvl2, perm_locality);
|
(void) parse_who_perm(who_perm, nvl2, perm_locality);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5953,7 +5964,7 @@ typedef struct holds_cbdata {
|
|||||||
size_t cb_max_taglen;
|
size_t cb_max_taglen;
|
||||||
} holds_cbdata_t;
|
} holds_cbdata_t;
|
||||||
|
|
||||||
#define STRFTIME_FMT_STR "%a %b %e %k:%M %Y"
|
#define STRFTIME_FMT_STR "%a %b %e %H:%M %Y"
|
||||||
#define DATETIME_BUF_LEN (32)
|
#define DATETIME_BUF_LEN (32)
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -7916,7 +7927,7 @@ zfs_do_change_key(int argc, char **argv)
|
|||||||
* 4) zfs project [-p id] [-r] [-s] <file|directory ...>
|
* 4) zfs project [-p id] [-r] [-s] <file|directory ...>
|
||||||
* Set project ID and/or inherit flag on the file(s) or directories.
|
* Set project ID and/or inherit flag on the file(s) or directories.
|
||||||
* -p: Set the project ID as the given id.
|
* -p: Set the project ID as the given id.
|
||||||
* -r: Set on subdirectorie recursively. If not specify "-p" option,
|
* -r: Set on subdirectories recursively. If not specify "-p" option,
|
||||||
* it will use top-level directory's project ID as the given id,
|
* it will use top-level directory's project ID as the given id,
|
||||||
* then set both project ID and inherit flag on all descendants
|
* then set both project ID and inherit flag on all descendants
|
||||||
* of the top-level directory.
|
* of the top-level directory.
|
||||||
@@ -8170,7 +8181,7 @@ main(int argc, char **argv)
|
|||||||
return (zfs_do_version(argc, argv));
|
return (zfs_do_version(argc, argv));
|
||||||
|
|
||||||
if ((g_zfs = libzfs_init()) == NULL) {
|
if ((g_zfs = libzfs_init()) == NULL) {
|
||||||
(void) fprintf(stderr, "%s", libzfs_error_init(errno));
|
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ extern "C" {
|
|||||||
|
|
||||||
void * safe_malloc(size_t size);
|
void * safe_malloc(size_t size);
|
||||||
void nomem(void);
|
void nomem(void);
|
||||||
libzfs_handle_t *g_zfs;
|
extern libzfs_handle_t *g_zfs;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ object_from_path(const char *dataset, uint64_t object, zinject_record_t *record)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Intialize the range based on the type, level, and range given.
|
* Initialize the range based on the type, level, and range given.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
initialize_range(err_type_t type, int level, char *range,
|
initialize_range(err_type_t type, int level, char *range,
|
||||||
@@ -310,7 +310,7 @@ translate_record(err_type_t type, const char *object, const char *range,
|
|||||||
ziprintf("raw object: %llu\n", record->zi_object);
|
ziprintf("raw object: %llu\n", record->zi_object);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For the given object, intialize the range in bytes
|
* For the given object, initialize the range in bytes
|
||||||
*/
|
*/
|
||||||
if (initialize_range(type, level, (char *)range, record) != 0)
|
if (initialize_range(type, level, (char *)range, record) != 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|||||||
@@ -763,7 +763,7 @@ main(int argc, char **argv)
|
|||||||
uint32_t dvas = 0;
|
uint32_t dvas = 0;
|
||||||
|
|
||||||
if ((g_zfs = libzfs_init()) == NULL) {
|
if ((g_zfs = libzfs_init()) == NULL) {
|
||||||
(void) fprintf(stderr, "%s", libzfs_error_init(errno));
|
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+31
-17
@@ -73,6 +73,8 @@
|
|||||||
|
|
||||||
#include "statcommon.h"
|
#include "statcommon.h"
|
||||||
|
|
||||||
|
libzfs_handle_t *g_zfs;
|
||||||
|
|
||||||
static int zpool_do_create(int, char **);
|
static int zpool_do_create(int, char **);
|
||||||
static int zpool_do_destroy(int, char **);
|
static int zpool_do_destroy(int, char **);
|
||||||
|
|
||||||
@@ -8419,24 +8421,12 @@ typedef struct hist_cbdata {
|
|||||||
boolean_t internal;
|
boolean_t internal;
|
||||||
} hist_cbdata_t;
|
} hist_cbdata_t;
|
||||||
|
|
||||||
/*
|
static void
|
||||||
* Print out the command history for a specific pool.
|
print_history_records(nvlist_t *nvhis, hist_cbdata_t *cb)
|
||||||
*/
|
|
||||||
static int
|
|
||||||
get_history_one(zpool_handle_t *zhp, void *data)
|
|
||||||
{
|
{
|
||||||
nvlist_t *nvhis;
|
|
||||||
nvlist_t **records;
|
nvlist_t **records;
|
||||||
uint_t numrecords;
|
uint_t numrecords;
|
||||||
int ret, i;
|
int i;
|
||||||
hist_cbdata_t *cb = (hist_cbdata_t *)data;
|
|
||||||
|
|
||||||
cb->first = B_FALSE;
|
|
||||||
|
|
||||||
(void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp));
|
|
||||||
|
|
||||||
if ((ret = zpool_get_history(zhp, &nvhis)) != 0)
|
|
||||||
return (ret);
|
|
||||||
|
|
||||||
verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD,
|
verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD,
|
||||||
&records, &numrecords) == 0);
|
&records, &numrecords) == 0);
|
||||||
@@ -8540,8 +8530,32 @@ get_history_one(zpool_handle_t *zhp, void *data)
|
|||||||
(void) printf("]");
|
(void) printf("]");
|
||||||
(void) printf("\n");
|
(void) printf("\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print out the command history for a specific pool.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
get_history_one(zpool_handle_t *zhp, void *data)
|
||||||
|
{
|
||||||
|
nvlist_t *nvhis;
|
||||||
|
int ret;
|
||||||
|
hist_cbdata_t *cb = (hist_cbdata_t *)data;
|
||||||
|
uint64_t off = 0;
|
||||||
|
boolean_t eof = B_FALSE;
|
||||||
|
|
||||||
|
cb->first = B_FALSE;
|
||||||
|
|
||||||
|
(void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp));
|
||||||
|
|
||||||
|
while (!eof) {
|
||||||
|
if ((ret = zpool_get_history(zhp, &nvhis, &off, &eof)) != 0)
|
||||||
|
return (ret);
|
||||||
|
|
||||||
|
print_history_records(nvhis, cb);
|
||||||
|
nvlist_free(nvhis);
|
||||||
|
}
|
||||||
(void) printf("\n");
|
(void) printf("\n");
|
||||||
nvlist_free(nvhis);
|
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@@ -9282,7 +9296,7 @@ main(int argc, char **argv)
|
|||||||
return (zpool_do_version(argc, argv));
|
return (zpool_do_version(argc, argv));
|
||||||
|
|
||||||
if ((g_zfs = libzfs_init()) == NULL) {
|
if ((g_zfs = libzfs_init()) == NULL) {
|
||||||
(void) fprintf(stderr, "%s", libzfs_error_init(errno));
|
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ void pool_list_free(zpool_list_t *);
|
|||||||
int pool_list_count(zpool_list_t *);
|
int pool_list_count(zpool_list_t *);
|
||||||
void pool_list_remove(zpool_list_t *, zpool_handle_t *);
|
void pool_list_remove(zpool_list_t *, zpool_handle_t *);
|
||||||
|
|
||||||
libzfs_handle_t *g_zfs;
|
extern libzfs_handle_t *g_zfs;
|
||||||
|
|
||||||
|
|
||||||
typedef struct vdev_cmd_data
|
typedef struct vdev_cmd_data
|
||||||
|
|||||||
@@ -438,7 +438,7 @@ check_disk(const char *path, blkid_cache cache, int force,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expected to fail for non-EFI labled disks. Just check the device
|
* Expected to fail for non-EFI labeled disks. Just check the device
|
||||||
* as given and do not attempt to detect and scan partitions.
|
* as given and do not attempt to detect and scan partitions.
|
||||||
*/
|
*/
|
||||||
err = efi_alloc_and_read(fd, &vtoc);
|
err = efi_alloc_and_read(fd, &vtoc);
|
||||||
@@ -829,7 +829,7 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
rep.zprl_children = 1;
|
rep.zprl_children = 1;
|
||||||
rep.zprl_parity = 0;
|
rep.zprl_parity = 0;
|
||||||
} else {
|
} else {
|
||||||
uint64_t vdev_size;
|
int64_t vdev_size;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a mirror or RAID-Z vdev. Go through and make
|
* This is a mirror or RAID-Z vdev. Go through and make
|
||||||
@@ -859,12 +859,12 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
*/
|
*/
|
||||||
type = NULL;
|
type = NULL;
|
||||||
dontreport = 0;
|
dontreport = 0;
|
||||||
vdev_size = -1ULL;
|
vdev_size = -1LL;
|
||||||
for (c = 0; c < children; c++) {
|
for (c = 0; c < children; c++) {
|
||||||
nvlist_t *cnv = child[c];
|
nvlist_t *cnv = child[c];
|
||||||
char *path;
|
char *path;
|
||||||
struct stat64 statbuf;
|
struct stat64 statbuf;
|
||||||
uint64_t size = -1ULL;
|
int64_t size = -1LL;
|
||||||
char *childtype;
|
char *childtype;
|
||||||
int fd, err;
|
int fd, err;
|
||||||
|
|
||||||
@@ -955,7 +955,7 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
|
|||||||
* (~16MB) then report an error.
|
* (~16MB) then report an error.
|
||||||
*/
|
*/
|
||||||
if (!dontreport &&
|
if (!dontreport &&
|
||||||
(vdev_size != -1ULL &&
|
(vdev_size != -1LL &&
|
||||||
(labs(size - vdev_size) >
|
(labs(size - vdev_size) >
|
||||||
ZPOOL_FUZZ))) {
|
ZPOOL_FUZZ))) {
|
||||||
if (ret != NULL)
|
if (ret != NULL)
|
||||||
@@ -1867,7 +1867,7 @@ make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force, int check_rep,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate each device to make sure that its not shared with another
|
* Validate each device to make sure that it's not shared with another
|
||||||
* subsystem. We do this even if 'force' is set, because there are some
|
* subsystem. We do this even if 'force' is set, because there are some
|
||||||
* uses (such as a dedicated dump device) that even '-f' cannot
|
* uses (such as a dedicated dump device) that even '-f' cannot
|
||||||
* override.
|
* override.
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ print_block(char *buf, int length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print an array of bytes to stdout as hexidecimal characters. str must
|
* Print an array of bytes to stdout as hexadecimal characters. str must
|
||||||
* have buf_len * 2 + 1 bytes of space.
|
* have buf_len * 2 + 1 bytes of space.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
|||||||
+7
-4
@@ -74,7 +74,7 @@
|
|||||||
*
|
*
|
||||||
* To turn this into an overnight stress test, use -T to specify run time.
|
* To turn this into an overnight stress test, use -T to specify run time.
|
||||||
*
|
*
|
||||||
* You can ask more more vdevs [-v], datasets [-d], or threads [-t]
|
* You can ask more vdevs [-v], datasets [-d], or threads [-t]
|
||||||
* to increase the pool capacity, fanout, and overall stress level.
|
* to increase the pool capacity, fanout, and overall stress level.
|
||||||
*
|
*
|
||||||
* Use the -k option to set the desired frequency of kills.
|
* Use the -k option to set the desired frequency of kills.
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
#include <sys/vdev_impl.h>
|
#include <sys/vdev_impl.h>
|
||||||
#include <sys/vdev_file.h>
|
#include <sys/vdev_file.h>
|
||||||
#include <sys/vdev_initialize.h>
|
#include <sys/vdev_initialize.h>
|
||||||
|
#include <sys/vdev_raidz.h>
|
||||||
#include <sys/vdev_trim.h>
|
#include <sys/vdev_trim.h>
|
||||||
#include <sys/spa_impl.h>
|
#include <sys/spa_impl.h>
|
||||||
#include <sys/metaslab_impl.h>
|
#include <sys/metaslab_impl.h>
|
||||||
@@ -1692,7 +1693,7 @@ ztest_log_write(ztest_ds_t *zd, dmu_tx_t *tx, lr_write_t *lr)
|
|||||||
if (zil_replaying(zd->zd_zilog, tx))
|
if (zil_replaying(zd->zd_zilog, tx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (lr->lr_length > ZIL_MAX_LOG_DATA)
|
if (lr->lr_length > zil_max_log_data(zd->zd_zilog))
|
||||||
write_state = WR_INDIRECT;
|
write_state = WR_INDIRECT;
|
||||||
|
|
||||||
itx = zil_itx_create(TX_WRITE,
|
itx = zil_itx_create(TX_WRITE,
|
||||||
@@ -2224,7 +2225,7 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, struct lwb *lwb,
|
|||||||
zgd->zgd_private = zd;
|
zgd->zgd_private = zd;
|
||||||
|
|
||||||
if (buf != NULL) { /* immediate write */
|
if (buf != NULL) { /* immediate write */
|
||||||
zgd->zgd_lr = (struct locked_range *)ztest_range_lock(zd,
|
zgd->zgd_lr = (struct zfs_locked_range *)ztest_range_lock(zd,
|
||||||
object, offset, size, RL_READER);
|
object, offset, size, RL_READER);
|
||||||
|
|
||||||
error = dmu_read(os, object, offset, size, buf,
|
error = dmu_read(os, object, offset, size, buf,
|
||||||
@@ -2239,7 +2240,7 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, struct lwb *lwb,
|
|||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
zgd->zgd_lr = (struct locked_range *)ztest_range_lock(zd,
|
zgd->zgd_lr = (struct zfs_locked_range *)ztest_range_lock(zd,
|
||||||
object, offset, size, RL_READER);
|
object, offset, size, RL_READER);
|
||||||
|
|
||||||
error = dmu_buf_hold(os, object, offset, zgd, &db,
|
error = dmu_buf_hold(os, object, offset, zgd, &db,
|
||||||
@@ -7110,6 +7111,8 @@ ztest_run(ztest_shared_t *zs)
|
|||||||
metaslab_preload_limit = ztest_random(20) + 1;
|
metaslab_preload_limit = ztest_random(20) + 1;
|
||||||
ztest_spa = spa;
|
ztest_spa = spa;
|
||||||
|
|
||||||
|
VERIFY0(vdev_raidz_impl_set("cycle"));
|
||||||
|
|
||||||
dmu_objset_stats_t dds;
|
dmu_objset_stats_t dds;
|
||||||
VERIFY0(ztest_dmu_objset_own(ztest_opts.zo_pool,
|
VERIFY0(ztest_dmu_objset_own(ztest_opts.zo_pool,
|
||||||
DMU_OST_ANY, B_TRUE, B_TRUE, FTAG, &os));
|
DMU_OST_ANY, B_TRUE, B_TRUE, FTAG, &os));
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
|
# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
|
||||||
# deprecated. They have the same value.
|
# deprecated. They have the same value.
|
||||||
#
|
#
|
||||||
# This code was derived from Makefile.decl in GLib, originally licenced
|
# This code was derived from Makefile.decl in GLib, originally licensed
|
||||||
# under LGPLv2.1+.
|
# under LGPLv2.1+.
|
||||||
#
|
#
|
||||||
# LICENSE
|
# LICENSE
|
||||||
|
|||||||
+1
-2
@@ -269,8 +269,7 @@ size_t iconv();
|
|||||||
[am_cv_proto_iconv_arg1="const"])
|
[am_cv_proto_iconv_arg1="const"])
|
||||||
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
||||||
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||||
AC_MSG_RESULT([
|
AC_MSG_RESULT([$am_cv_proto_iconv])
|
||||||
$am_cv_proto_iconv])
|
|
||||||
else
|
else
|
||||||
dnl When compiling GNU libiconv on a system that does not have iconv yet,
|
dnl When compiling GNU libiconv on a system that does not have iconv yet,
|
||||||
dnl pick the POSIX compliant declaration without 'const'.
|
dnl pick the POSIX compliant declaration without 'const'.
|
||||||
|
|||||||
@@ -4,17 +4,23 @@ dnl #
|
|||||||
dnl # - access_ok(type, addr, size)
|
dnl # - access_ok(type, addr, size)
|
||||||
dnl # + access_ok(addr, size)
|
dnl # + access_ok(addr, size)
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_ACCESS_OK_TYPE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE], [
|
||||||
AC_MSG_CHECKING([whether access_ok() has 'type' parameter])
|
ZFS_LINUX_TEST_SRC([access_ok_type], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
],[
|
],[
|
||||||
const void __user __attribute__((unused)) *addr = (void *) 0xdeadbeef;
|
const void __user __attribute__((unused)) *addr =
|
||||||
|
(void *) 0xdeadbeef;
|
||||||
unsigned long __attribute__((unused)) size = 1;
|
unsigned long __attribute__((unused)) size = 1;
|
||||||
int error __attribute__((unused)) = access_ok(0, addr, size);
|
int error __attribute__((unused)) = access_ok(0, addr, size);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_ACCESS_OK_TYPE], [
|
||||||
|
AC_MSG_CHECKING([whether access_ok() has 'type' parameter])
|
||||||
|
ZFS_LINUX_TEST_RESULT([access_ok_type], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_ACCESS_OK_TYPE, 1, [kernel has access_ok with 'type' parameter])
|
AC_DEFINE(HAVE_ACCESS_OK_TYPE, 1,
|
||||||
|
[kernel has access_ok with 'type' parameter])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
+174
-83
@@ -3,32 +3,26 @@ dnl # Check if posix_acl_release can be used from a ZFS_META_LICENSED
|
|||||||
dnl # module. The is_owner_or_cap macro was replaced by
|
dnl # module. The is_owner_or_cap macro was replaced by
|
||||||
dnl # inode_owner_or_capable
|
dnl # inode_owner_or_capable
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE], [
|
||||||
AC_MSG_CHECKING([whether posix_acl_release() is available])
|
ZFS_LINUX_TEST_SRC([posix_acl_release], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/cred.h>
|
#include <linux/cred.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/posix_acl.h>
|
#include <linux/posix_acl.h>
|
||||||
],[
|
], [
|
||||||
struct posix_acl* tmp = posix_acl_alloc(1, 0);
|
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
||||||
posix_acl_release(tmp);
|
posix_acl_release(tmp);
|
||||||
],[
|
], [], [$ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
||||||
|
AC_MSG_CHECKING([whether posix_acl_release() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([posix_acl_release], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1,
|
AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1,
|
||||||
[posix_acl_release() is available])
|
[posix_acl_release() is available])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether posix_acl_release() is GPL-only])
|
AC_MSG_CHECKING([whether posix_acl_release() is GPL-only])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([posix_acl_release_license], [
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/cred.h>
|
|
||||||
#include <linux/fs.h>
|
|
||||||
#include <linux/posix_acl.h>
|
|
||||||
|
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
|
||||||
],[
|
|
||||||
struct posix_acl* tmp = posix_acl_alloc(1, 0);
|
|
||||||
posix_acl_release(tmp);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
@@ -46,24 +40,25 @@ dnl # set_cached_acl() and forget_cached_acl() changed from inline to
|
|||||||
dnl # EXPORT_SYMBOL. In the former case, they may not be usable because of
|
dnl # EXPORT_SYMBOL. In the former case, they may not be usable because of
|
||||||
dnl # posix_acl_release. In the latter case, we can always use them.
|
dnl # posix_acl_release. In the latter case, we can always use them.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [
|
||||||
AC_MSG_CHECKING([whether set_cached_acl() is usable])
|
ZFS_LINUX_TEST_SRC([set_cached_acl], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/cred.h>
|
#include <linux/cred.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/posix_acl.h>
|
#include <linux/posix_acl.h>
|
||||||
|
], [
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
|
||||||
],[
|
|
||||||
struct inode *ip = NULL;
|
struct inode *ip = NULL;
|
||||||
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
||||||
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
||||||
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
||||||
],[
|
], [], [$ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
||||||
|
AC_MSG_CHECKING([whether set_cached_acl() is usable])
|
||||||
|
ZFS_LINUX_TEST_RESULT([set_cached_acl_license], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_SET_CACHED_ACL_USABLE, 1,
|
AC_DEFINE(HAVE_SET_CACHED_ACL_USABLE, 1,
|
||||||
[posix_acl_release() is usable])
|
[set_cached_acl() is usable])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -77,14 +72,25 @@ dnl #
|
|||||||
dnl # 3.14 API change,
|
dnl # 3.14 API change,
|
||||||
dnl # posix_acl_chmod() is changed to __posix_acl_chmod()
|
dnl # posix_acl_chmod() is changed to __posix_acl_chmod()
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
|
||||||
AC_MSG_CHECKING([whether posix_acl_chmod exists])
|
ZFS_LINUX_TEST_SRC([posix_acl_chmod], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/posix_acl.h>
|
#include <linux/posix_acl.h>
|
||||||
],[
|
],[
|
||||||
posix_acl_chmod(NULL, 0, 0)
|
posix_acl_chmod(NULL, 0, 0)
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([__posix_acl_chmod], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/posix_acl.h>
|
||||||
],[
|
],[
|
||||||
|
__posix_acl_chmod(NULL, 0, 0)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
|
||||||
|
AC_MSG_CHECKING([whether posix_acl_chmod exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists])
|
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists])
|
||||||
],[
|
],[
|
||||||
@@ -92,14 +98,10 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether __posix_acl_chmod exists])
|
AC_MSG_CHECKING([whether __posix_acl_chmod exists])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([__posix_acl_chmod], [
|
||||||
#include <linux/fs.h>
|
|
||||||
#include <linux/posix_acl.h>
|
|
||||||
],[
|
|
||||||
__posix_acl_chmod(NULL, 0, 0)
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1, [__posix_acl_chmod() exists])
|
AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1,
|
||||||
|
[__posix_acl_chmod() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -109,18 +111,22 @@ dnl #
|
|||||||
dnl # 3.1 API change,
|
dnl # 3.1 API change,
|
||||||
dnl # posix_acl_equiv_mode now wants an umode_t* instead of a mode_t*
|
dnl # posix_acl_equiv_mode now wants an umode_t* instead of a mode_t*
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
||||||
AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
|
ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/posix_acl.h>
|
#include <linux/posix_acl.h>
|
||||||
],[
|
],[
|
||||||
umode_t tmp;
|
umode_t tmp;
|
||||||
posix_acl_equiv_mode(NULL,&tmp);
|
posix_acl_equiv_mode(NULL,&tmp);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
||||||
|
AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
|
||||||
|
ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1,
|
AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1,
|
||||||
[ posix_acl_equiv_mode wants umode_t*])
|
[posix_acl_equiv_mode wants umode_t*])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -130,9 +136,8 @@ dnl #
|
|||||||
dnl # 4.8 API change,
|
dnl # 4.8 API change,
|
||||||
dnl # The function posix_acl_valid now must be passed a namespace.
|
dnl # The function posix_acl_valid now must be passed a namespace.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS], [
|
||||||
AC_MSG_CHECKING([whether posix_acl_valid() wants user namespace])
|
ZFS_LINUX_TEST_SRC([posix_acl_valid_with_ns], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/posix_acl.h>
|
#include <linux/posix_acl.h>
|
||||||
],[
|
],[
|
||||||
@@ -141,7 +146,12 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
|
|||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = posix_acl_valid(user_ns, acl);
|
error = posix_acl_valid(user_ns, acl);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
|
||||||
|
AC_MSG_CHECKING([whether posix_acl_valid() wants user namespace])
|
||||||
|
ZFS_LINUX_TEST_RESULT([posix_acl_valid_with_ns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_POSIX_ACL_VALID_WITH_NS, 1,
|
AC_DEFINE(HAVE_POSIX_ACL_VALID_WITH_NS, 1,
|
||||||
[posix_acl_valid() wants user namespace])
|
[posix_acl_valid() wants user namespace])
|
||||||
@@ -155,9 +165,8 @@ dnl # 2.6.27 API change,
|
|||||||
dnl # Check if inode_operations contains the function permission
|
dnl # Check if inode_operations contains the function permission
|
||||||
dnl # and expects the nameidata structure to have been removed.
|
dnl # and expects the nameidata structure to have been removed.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION], [
|
||||||
AC_MSG_CHECKING([whether iops->permission() exists])
|
ZFS_LINUX_TEST_SRC([inode_operations_permission], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int permission_fn(struct inode *inode, int mask) { return 0; }
|
int permission_fn(struct inode *inode, int mask) { return 0; }
|
||||||
@@ -166,8 +175,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.permission = permission_fn,
|
.permission = permission_fn,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [
|
||||||
|
AC_MSG_CHECKING([whether iops->permission() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_permission], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
|
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
|
||||||
],[
|
],[
|
||||||
@@ -180,9 +193,8 @@ dnl # 2.6.26 API change,
|
|||||||
dnl # Check if inode_operations contains the function permission
|
dnl # Check if inode_operations contains the function permission
|
||||||
dnl # and expects the nameidata structure to be passed.
|
dnl # and expects the nameidata structure to be passed.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
|
||||||
AC_MSG_CHECKING([whether iops->permission() wants nameidata])
|
ZFS_LINUX_TEST_SRC([inode_operations_permission_with_nameidata], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
|
||||||
@@ -193,8 +205,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.permission = permission_fn,
|
.permission = permission_fn,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
|
||||||
|
AC_MSG_CHECKING([whether iops->permission() wants nameidata])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_permission_with_nameidata], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
|
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
|
||||||
AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1,
|
AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1,
|
||||||
@@ -208,9 +224,8 @@ dnl #
|
|||||||
dnl # 2.6.32 API change,
|
dnl # 2.6.32 API change,
|
||||||
dnl # Check if inode_operations contains the function check_acl
|
dnl # Check if inode_operations contains the function check_acl
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL], [
|
||||||
AC_MSG_CHECKING([whether iops->check_acl() exists])
|
ZFS_LINUX_TEST_SRC([inode_operations_check_acl], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int check_acl_fn(struct inode *inode, int mask) { return 0; }
|
int check_acl_fn(struct inode *inode, int mask) { return 0; }
|
||||||
@@ -219,8 +234,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.check_acl = check_acl_fn,
|
.check_acl = check_acl_fn,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [
|
||||||
|
AC_MSG_CHECKING([whether iops->check_acl() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_check_acl], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
|
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
|
||||||
],[
|
],[
|
||||||
@@ -232,9 +251,8 @@ dnl #
|
|||||||
dnl # 2.6.38 API change,
|
dnl # 2.6.38 API change,
|
||||||
dnl # The function check_acl gained a new parameter: flags
|
dnl # The function check_acl gained a new parameter: flags
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
|
||||||
AC_MSG_CHECKING([whether iops->check_acl() wants flags])
|
ZFS_LINUX_TEST_SRC([inode_operations_check_acl_with_flags], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int check_acl_fn(struct inode *inode, int mask,
|
int check_acl_fn(struct inode *inode, int mask,
|
||||||
@@ -244,8 +262,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.check_acl = check_acl_fn,
|
.check_acl = check_acl_fn,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
|
||||||
|
AC_MSG_CHECKING([whether iops->check_acl() wants flags])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_check_acl_with_flags], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
|
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
|
||||||
AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1,
|
AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1,
|
||||||
@@ -259,9 +281,8 @@ dnl #
|
|||||||
dnl # 3.1 API change,
|
dnl # 3.1 API change,
|
||||||
dnl # Check if inode_operations contains the function get_acl
|
dnl # Check if inode_operations contains the function get_acl
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
|
||||||
AC_MSG_CHECKING([whether iops->get_acl() exists])
|
ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
struct posix_acl *get_acl_fn(struct inode *inode, int type)
|
struct posix_acl *get_acl_fn(struct inode *inode, int type)
|
||||||
@@ -271,8 +292,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.get_acl = get_acl_fn,
|
.get_acl = get_acl_fn,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
||||||
|
AC_MSG_CHECKING([whether iops->get_acl() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
|
AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
|
||||||
],[
|
],[
|
||||||
@@ -284,20 +309,23 @@ dnl #
|
|||||||
dnl # 3.14 API change,
|
dnl # 3.14 API change,
|
||||||
dnl # Check if inode_operations contains the function set_acl
|
dnl # Check if inode_operations contains the function set_acl
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
||||||
AC_MSG_CHECKING([whether iops->set_acl() exists])
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int set_acl_fn(struct inode *inode, struct posix_acl *acl, int type)
|
int set_acl_fn(struct inode *inode, struct posix_acl *acl,
|
||||||
{ return 0; }
|
int type) { return 0; }
|
||||||
|
|
||||||
static const struct inode_operations
|
static const struct inode_operations
|
||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.set_acl = set_acl_fn,
|
.set_acl = set_acl_fn,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
||||||
|
AC_MSG_CHECKING([whether iops->set_acl() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||||
],[
|
],[
|
||||||
@@ -311,16 +339,79 @@ dnl # The kernel get_acl will now check cache before calling i_op->get_acl and
|
|||||||
dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that
|
dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that
|
||||||
dnl # anymore.
|
dnl # anymore.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE], [
|
||||||
AC_MSG_CHECKING([whether uncached_acl_sentinel() exists])
|
ZFS_LINUX_TEST_SRC([get_acl_handle_cache], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
void *sentinel __attribute__ ((unused)) = uncached_acl_sentinel(NULL);
|
void *sentinel __attribute__ ((unused)) =
|
||||||
],[
|
uncached_acl_sentinel(NULL);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [
|
||||||
|
AC_MSG_CHECKING([whether uncached_acl_sentinel() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([get_acl_handle_cache], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1, [uncached_acl_sentinel() exists])
|
AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1,
|
||||||
|
[uncached_acl_sentinel() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t.
|
||||||
|
dnl # It's an atomic_t on older kernels.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT], [
|
||||||
|
ZFS_LINUX_TEST_SRC([acl_refcount], [
|
||||||
|
#include <linux/backing-dev.h>
|
||||||
|
#include <linux/refcount.h>
|
||||||
|
#include <linux/posix_acl.h>
|
||||||
|
],[
|
||||||
|
struct posix_acl acl;
|
||||||
|
refcount_t *r __attribute__ ((unused)) = &acl.a_refcount;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [
|
||||||
|
AC_MSG_CHECKING([whether posix_acl has refcount_t])
|
||||||
|
ZFS_LINUX_TEST_RESULT([acl_refcount], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_ACL_REFCOUNT, 1, [posix_acl has refcount_t])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
|
||||||
|
ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE
|
||||||
|
ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE
|
||||||
|
ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD
|
||||||
|
ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
||||||
|
ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
|
||||||
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
|
||||||
|
ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE
|
||||||
|
ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_ACL], [
|
||||||
|
ZFS_AC_KERNEL_POSIX_ACL_RELEASE
|
||||||
|
ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE
|
||||||
|
ZFS_AC_KERNEL_POSIX_ACL_CHMOD
|
||||||
|
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
||||||
|
ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
|
||||||
|
ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION
|
||||||
|
ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
|
||||||
|
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL
|
||||||
|
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
|
||||||
|
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
||||||
|
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
|
||||||
|
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
|
||||||
|
ZFS_AC_KERNEL_ACL_HAS_REFCOUNT
|
||||||
|
])
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 4.9-rc5+ ABI, removal of the .aio_fsync field
|
dnl # Linux 4.9-rc5+ ABI, removal of the .aio_fsync field
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_AIO_FSYNC], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_AIO_FSYNC], [
|
||||||
AC_MSG_CHECKING([whether fops->aio_fsync() exists])
|
ZFS_LINUX_TEST_SRC([aio_fsync], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
static const struct file_operations
|
static const struct file_operations
|
||||||
fops __attribute__ ((unused)) = {
|
fops __attribute__ ((unused)) = {
|
||||||
.aio_fsync = NULL,
|
.aio_fsync = NULL,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_AIO_FSYNC], [
|
||||||
|
AC_MSG_CHECKING([whether fops->aio_fsync() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([aio_fsync], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_FILE_AIO_FSYNC, 1, [fops->aio_fsync() exists])
|
AC_DEFINE(HAVE_FILE_AIO_FSYNC, 1, [fops->aio_fsync() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,19 @@ dnl # solution to handling automounts. Prior to this cifs/nfs clients
|
|||||||
dnl # which required automount support would abuse the follow_link()
|
dnl # which required automount support would abuse the follow_link()
|
||||||
dnl # operation on directories for this purpose.
|
dnl # operation on directories for this purpose.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
|
||||||
AC_MSG_CHECKING([whether dops->d_automount() exists])
|
ZFS_LINUX_TEST_SRC([dentry_operations_d_automount], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/dcache.h>
|
#include <linux/dcache.h>
|
||||||
struct vfsmount *d_automount(struct path *p) { return NULL; }
|
struct vfsmount *d_automount(struct path *p) { return NULL; }
|
||||||
struct dentry_operations dops __attribute__ ((unused)) = {
|
struct dentry_operations dops __attribute__ ((unused)) = {
|
||||||
.d_automount = d_automount,
|
.d_automount = d_automount,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
|
||||||
|
AC_MSG_CHECKING([whether dops->d_automount() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_AUTOMOUNT, 1, [dops->automount() exists])
|
AC_DEFINE(HAVE_AUTOMOUNT, 1, [dops->automount() exists])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -5,21 +5,22 @@ dnl # it has been true for a while that there was no strict 1:1 mapping
|
|||||||
dnl # between physical sector size and logical block size this change makes
|
dnl # between physical sector size and logical block size this change makes
|
||||||
dnl # it explicit.
|
dnl # it explicit.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_LOGICAL_BLOCK_SIZE], [
|
||||||
AC_MSG_CHECKING([whether bdev_logical_block_size() is available])
|
ZFS_LINUX_TEST_SRC([bdev_logical_block_size], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
bdev_logical_block_size(bdev);
|
bdev_logical_block_size(bdev);
|
||||||
],[
|
], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE], [
|
||||||
|
AC_MSG_CHECKING([whether bdev_logical_block_size() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bdev_logical_block_size], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BDEV_LOGICAL_BLOCK_SIZE, 1,
|
AC_DEFINE(HAVE_BDEV_LOGICAL_BLOCK_SIZE, 1,
|
||||||
[bdev_logical_block_size() is available])
|
[bdev_logical_block_size() is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -19,21 +19,22 @@ dnl #
|
|||||||
dnl # Unfortunately, this interface isn't entirely reliable because
|
dnl # Unfortunately, this interface isn't entirely reliable because
|
||||||
dnl # drives are sometimes known to misreport this value.
|
dnl # drives are sometimes known to misreport this value.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_PHYSICAL_BLOCK_SIZE], [
|
||||||
AC_MSG_CHECKING([whether bdev_physical_block_size() is available])
|
ZFS_LINUX_TEST_SRC([bdev_physical_block_size], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
bdev_physical_block_size(bdev);
|
bdev_physical_block_size(bdev);
|
||||||
],[
|
], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE], [
|
||||||
|
AC_MSG_CHECKING([whether bdev_physical_block_size() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bdev_physical_block_size], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BDEV_PHYSICAL_BLOCK_SIZE, 1,
|
AC_DEFINE(HAVE_BDEV_PHYSICAL_BLOCK_SIZE, 1,
|
||||||
[bdev_physical_block_size() is available])
|
[bdev_physical_block_size() is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
+52
-26
@@ -1,55 +1,81 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.32 - 2.6.33, bdi_setup_and_register() is not exported.
|
dnl # Check available BDI interfaces.
|
||||||
dnl # 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
|
|
||||||
dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
|
||||||
dnl # 4.12 - x.y, super_setup_bdi_name() new interface.
|
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BDI], [
|
||||||
AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
|
ZFS_LINUX_TEST_SRC([super_setup_bdi_name], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
struct super_block sb;
|
struct super_block sb;
|
||||||
], [
|
], [
|
||||||
char *name = "bdi";
|
char *name = "bdi";
|
||||||
atomic_long_t zfs_bdi_seq;
|
atomic_long_t zfs_bdi_seq;
|
||||||
int error __attribute__((unused)) =
|
int error __attribute__((unused)) =
|
||||||
super_setup_bdi_name(&sb, "%.28s-%ld", name, atomic_long_inc_return(&zfs_bdi_seq));
|
super_setup_bdi_name(&sb, "%.28s-%ld", name,
|
||||||
], [super_setup_bdi_name], [fs/super.c], [
|
atomic_long_inc_return(&zfs_bdi_seq));
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([bdi_setup_and_register], [
|
||||||
|
#include <linux/backing-dev.h>
|
||||||
|
struct backing_dev_info bdi;
|
||||||
|
], [
|
||||||
|
char *name = "bdi";
|
||||||
|
int error __attribute__((unused)) =
|
||||||
|
bdi_setup_and_register(&bdi, name);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([bdi_setup_and_register_3args], [
|
||||||
|
#include <linux/backing-dev.h>
|
||||||
|
struct backing_dev_info bdi;
|
||||||
|
], [
|
||||||
|
char *name = "bdi";
|
||||||
|
unsigned int cap = BDI_CAP_MAP_COPY;
|
||||||
|
int error __attribute__((unused)) =
|
||||||
|
bdi_setup_and_register(&bdi, name, cap);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
||||||
|
dnl #
|
||||||
|
dnl # 4.12, super_setup_bdi_name() introduced.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([super_setup_bdi_name],
|
||||||
|
[super_setup_bdi_name], [fs/super.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
|
AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
|
||||||
[super_setup_bdi_name() exits])
|
[super_setup_bdi_name() exits])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||||
|
dnl #
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[whether bdi_setup_and_register() wants 2 args])
|
[whether bdi_setup_and_register() wants 2 args])
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
ZFS_LINUX_TEST_RESULT_SYMBOL([bdi_setup_and_register],
|
||||||
#include <linux/backing-dev.h>
|
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||||
struct backing_dev_info bdi;
|
|
||||||
], [
|
|
||||||
char *name = "bdi";
|
|
||||||
int error __attribute__((unused)) =
|
|
||||||
bdi_setup_and_register(&bdi, name);
|
|
||||||
], [bdi_setup_and_register], [mm/backing-dev.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
|
AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||||
[bdi_setup_and_register() wants 2 args])
|
[bdi_setup_and_register() wants 2 args])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 2.6.34 - 3.19, bdi_setup_and_register()
|
||||||
|
dnl # takes 3 arguments.
|
||||||
|
dnl #
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[whether bdi_setup_and_register() wants 3 args])
|
[whether bdi_setup_and_register() wants 3 args])
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
ZFS_LINUX_TEST_RESULT_SYMBOL(
|
||||||
#include <linux/backing-dev.h>
|
[bdi_setup_and_register_3args],
|
||||||
struct backing_dev_info bdi;
|
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||||
], [
|
|
||||||
char *name = "bdi";
|
|
||||||
unsigned int cap = BDI_CAP_MAP_COPY;
|
|
||||||
int error __attribute__((unused)) =
|
|
||||||
bdi_setup_and_register(&bdi, name, cap);
|
|
||||||
], [bdi_setup_and_register], [mm/backing-dev.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||||
[bdi_setup_and_register() wants 3 args])
|
[bdi_setup_and_register() wants 3 args])
|
||||||
], [
|
], [
|
||||||
|
dnl #
|
||||||
|
dnl # 2.6.32 - 2.6.33, bdi_setup_and_register()
|
||||||
|
dnl # is not exported.
|
||||||
|
dnl #
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,18 +3,21 @@ dnl # 3.14 API change,
|
|||||||
dnl # Immutable biovecs. A number of fields of struct bio are moved to
|
dnl # Immutable biovecs. A number of fields of struct bio are moved to
|
||||||
dnl # struct bvec_iter.
|
dnl # struct bvec_iter.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BVEC_ITER], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER], [
|
||||||
AC_MSG_CHECKING([whether bio has bi_iter])
|
ZFS_LINUX_TEST_SRC([bio_bvec_iter], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
],[
|
],[
|
||||||
struct bio bio;
|
struct bio bio;
|
||||||
bio.bi_iter.bi_sector = 0;
|
bio.bi_iter.bi_sector = 0;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_BVEC_ITER], [
|
||||||
|
AC_MSG_CHECKING([whether bio has bi_iter])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_bvec_iter], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_BVEC_ITER, 1, [bio has bi_iter])
|
AC_DEFINE(HAVE_BIO_BVEC_ITER, 1, [bio has bi_iter])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -5,20 +5,21 @@ dnl # bio->bi_error. This also replaces bio->bi_flags value BIO_UPTODATE.
|
|||||||
dnl # Introduced by torvalds/linux@4246a0b63bd8f56a1469b12eafeb875b1041a451
|
dnl # Introduced by torvalds/linux@4246a0b63bd8f56a1469b12eafeb875b1041a451
|
||||||
dnl # ("block: add a bi_error field to struct bio").
|
dnl # ("block: add a bi_error field to struct bio").
|
||||||
dnl #
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_end_io_t_args], [
|
||||||
|
#include <linux/bio.h>
|
||||||
|
void wanted_end_io(struct bio *bio) { return; }
|
||||||
|
bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
|
||||||
|
], [])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
|
||||||
AC_MSG_CHECKING([whether bio_end_io_t wants 1 arg])
|
AC_MSG_CHECKING([whether bio_end_io_t wants 1 arg])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([bio_end_io_t_args], [
|
||||||
#include <linux/bio.h>
|
|
||||||
|
|
||||||
void wanted_end_io(struct bio *bio) { return; }
|
|
||||||
|
|
||||||
bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
|
|
||||||
],[
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_1ARG_BIO_END_IO_T, 1,
|
AC_DEFINE(HAVE_1ARG_BIO_END_IO_T, 1,
|
||||||
[bio_end_io_t wants 1 arg])
|
[bio_end_io_t wants 1 arg])
|
||||||
],[
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -28,16 +29,19 @@ dnl # 4.13 API change
|
|||||||
dnl # The bio->bi_error field was replaced with bio->bi_status which is an
|
dnl # The bio->bi_error field was replaced with bio->bi_status which is an
|
||||||
dnl # enum which describes all possible error types.
|
dnl # enum which describes all possible error types.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_STATUS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BI_STATUS], [
|
||||||
AC_MSG_CHECKING([whether bio->bi_status exists])
|
ZFS_LINUX_TEST_SRC([bio_bi_status], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
],[
|
], [
|
||||||
struct bio bio __attribute__ ((unused));
|
struct bio bio __attribute__ ((unused));
|
||||||
blk_status_t status __attribute__ ((unused)) = BLK_STS_OK;
|
blk_status_t status __attribute__ ((unused)) = BLK_STS_OK;
|
||||||
|
|
||||||
bio.bi_status = status;
|
bio.bi_status = status;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_STATUS], [
|
||||||
|
AC_MSG_CHECKING([whether bio->bi_status exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_bi_status], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_BI_STATUS, 1, [bio->bi_status exists])
|
AC_DEFINE(HAVE_BIO_BI_STATUS, 1, [bio->bi_status exists])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -3,37 +3,54 @@ dnl # Preferred interface for setting FAILFAST on a bio:
|
|||||||
dnl # 2.6.28-2.6.35: BIO_RW_FAILFAST_{DEV|TRANSPORT|DRIVER}
|
dnl # 2.6.28-2.6.35: BIO_RW_FAILFAST_{DEV|TRANSPORT|DRIVER}
|
||||||
dnl # >= 2.6.36: REQ_FAILFAST_{DEV|TRANSPORT|DRIVER}
|
dnl # >= 2.6.36: REQ_FAILFAST_{DEV|TRANSPORT|DRIVER}
|
||||||
dnl #
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_FAILFAST_DTD], [
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST_DTD], [
|
ZFS_LINUX_TEST_SRC([bio_failfast_dtd], [
|
||||||
AC_MSG_CHECKING([whether BIO_RW_FAILFAST_* are defined])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
],[
|
],[
|
||||||
int flags __attribute__ ((unused));
|
int flags __attribute__ ((unused));
|
||||||
flags = ((1 << BIO_RW_FAILFAST_DEV) |
|
flags = ((1 << BIO_RW_FAILFAST_DEV) |
|
||||||
(1 << BIO_RW_FAILFAST_TRANSPORT) |
|
(1 << BIO_RW_FAILFAST_TRANSPORT) |
|
||||||
(1 << BIO_RW_FAILFAST_DRIVER));
|
(1 << BIO_RW_FAILFAST_DRIVER));
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST_DTD], [
|
||||||
|
AC_MSG_CHECKING([whether BIO_RW_FAILFAST_* are defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_failfast_dtd], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_RW_FAILFAST_DTD, 1,
|
AC_DEFINE(HAVE_BIO_RW_FAILFAST_DTD, 1,
|
||||||
[BIO_RW_FAILFAST_* are defined])
|
[BIO_RW_FAILFAST_* are defined])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_REQ_FAILFAST_MASK], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_REQ_FAILFAST_MASK], [
|
||||||
AC_MSG_CHECKING([whether REQ_FAILFAST_MASK is defined])
|
ZFS_LINUX_TEST_SRC([bio_failfast_mask], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
],[
|
],[
|
||||||
int flags __attribute__ ((unused));
|
int flags __attribute__ ((unused));
|
||||||
flags = REQ_FAILFAST_MASK;
|
flags = REQ_FAILFAST_MASK;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_REQ_FAILFAST_MASK], [
|
||||||
|
AC_MSG_CHECKING([whether REQ_FAILFAST_MASK is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_failfast_mask], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_REQ_FAILFAST_MASK, 1,
|
AC_DEFINE(HAVE_REQ_FAILFAST_MASK, 1,
|
||||||
[REQ_FAILFAST_MASK is defined])
|
[REQ_FAILFAST_MASK is defined])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_FAILFAST], [
|
||||||
|
ZFS_AC_KERNEL_SRC_BIO_FAILFAST_DTD
|
||||||
|
ZFS_AC_KERNEL_SRC_REQ_FAILFAST_MASK
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST], [
|
||||||
|
ZFS_AC_KERNEL_BIO_FAILFAST_DTD
|
||||||
|
ZFS_AC_KERNEL_REQ_FAILFAST_MASK
|
||||||
|
])
|
||||||
|
|||||||
+46
-28
@@ -5,13 +5,43 @@ dnl # The bio_op() helper was introduced as a replacement for explicitly
|
|||||||
dnl # checking the bio->bi_rw flags. The following checks are used to
|
dnl # checking the bio->bi_rw flags. The following checks are used to
|
||||||
dnl # detect if a specific operation is supported.
|
dnl # detect if a specific operation is supported.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_DISCARD], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
||||||
AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined])
|
ZFS_LINUX_TEST_SRC([req_op_discard], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blk_types.h>
|
#include <linux/blk_types.h>
|
||||||
],[
|
],[
|
||||||
int op __attribute__ ((unused)) = REQ_OP_DISCARD;
|
int op __attribute__ ((unused)) = REQ_OP_DISCARD;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([req_op_secure_erase], [
|
||||||
|
#include <linux/blk_types.h>
|
||||||
],[
|
],[
|
||||||
|
int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([req_op_flush], [
|
||||||
|
#include <linux/blk_types.h>
|
||||||
|
],[
|
||||||
|
int op __attribute__ ((unused)) = REQ_OP_FLUSH;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_bi_opf], [
|
||||||
|
#include <linux/bio.h>
|
||||||
|
],[
|
||||||
|
struct bio bio __attribute__ ((unused));
|
||||||
|
bio.bi_opf = 0;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [
|
||||||
|
#include <linux/bio.h>
|
||||||
|
],[
|
||||||
|
struct bio *bio __attribute__ ((unused)) = NULL;
|
||||||
|
bio_set_op_attrs(bio, 0, 0);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_DISCARD], [
|
||||||
|
AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([req_op_discard], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_REQ_OP_DISCARD, 1,
|
AC_DEFINE(HAVE_REQ_OP_DISCARD, 1,
|
||||||
[REQ_OP_DISCARD is defined])
|
[REQ_OP_DISCARD is defined])
|
||||||
@@ -22,11 +52,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_DISCARD], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE], [
|
AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE], [
|
||||||
AC_MSG_CHECKING([whether REQ_OP_SECURE_ERASE is defined])
|
AC_MSG_CHECKING([whether REQ_OP_SECURE_ERASE is defined])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([req_op_secure_erase], [
|
||||||
#include <linux/blk_types.h>
|
|
||||||
],[
|
|
||||||
int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
|
AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
|
||||||
[REQ_OP_SECURE_ERASE is defined])
|
[REQ_OP_SECURE_ERASE is defined])
|
||||||
@@ -38,14 +64,9 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_FLUSH], [
|
AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_FLUSH], [
|
||||||
AC_MSG_CHECKING([whether REQ_OP_FLUSH is defined])
|
AC_MSG_CHECKING([whether REQ_OP_FLUSH is defined])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([req_op_flush], [
|
||||||
#include <linux/blk_types.h>
|
|
||||||
],[
|
|
||||||
int op __attribute__ ((unused)) = REQ_OP_FLUSH;
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_REQ_OP_FLUSH, 1,
|
AC_DEFINE(HAVE_REQ_OP_FLUSH, 1, [REQ_OP_FLUSH is defined])
|
||||||
[REQ_OP_FLUSH is defined])
|
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -53,12 +74,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_FLUSH], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
||||||
AC_MSG_CHECKING([whether bio->bi_opf is defined])
|
AC_MSG_CHECKING([whether bio->bi_opf is defined])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([bio_bi_opf], [
|
||||||
#include <linux/bio.h>
|
|
||||||
],[
|
|
||||||
struct bio bio __attribute__ ((unused));
|
|
||||||
bio.bi_opf = 0;
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
|
AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
|
||||||
],[
|
],[
|
||||||
@@ -68,13 +84,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS], [
|
AC_DEFUN([ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS], [
|
||||||
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [
|
||||||
#include <linux/bio.h>
|
|
||||||
],[
|
|
||||||
struct bio *bio __attribute__ ((unused)) = NULL;
|
|
||||||
|
|
||||||
bio_set_op_attrs(bio, 0, 0);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1,
|
AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1,
|
||||||
[bio_set_op_attrs is available])
|
[bio_set_op_attrs is available])
|
||||||
@@ -82,3 +92,11 @@ AC_DEFUN([ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS], [
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_OPS], [
|
||||||
|
ZFS_AC_KERNEL_REQ_OP_DISCARD
|
||||||
|
ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE
|
||||||
|
ZFS_AC_KERNEL_REQ_OP_FLUSH
|
||||||
|
ZFS_AC_KERNEL_BIO_BI_OPF
|
||||||
|
ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS
|
||||||
|
])
|
||||||
|
|||||||
@@ -3,20 +3,25 @@ dnl # Interface for issuing a discard bio:
|
|||||||
dnl # 2.6.28-2.6.35: BIO_RW_BARRIER
|
dnl # 2.6.28-2.6.35: BIO_RW_BARRIER
|
||||||
dnl # 2.6.36-3.x: REQ_BARRIER
|
dnl # 2.6.36-3.x: REQ_BARRIER
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl #
|
||||||
dnl # Since REQ_BARRIER is a preprocessor definition, there is no need for an
|
dnl # Since REQ_BARRIER is a preprocessor definition, there is no need for an
|
||||||
dnl # autotools check for it. Also, REQ_BARRIER existed in the request layer
|
dnl # autotools check for it. Also, REQ_BARRIER existed in the request layer
|
||||||
dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the
|
dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the
|
||||||
dnl # request layer and bio layer flags, so it would be wrong to assume that
|
dnl # request layer and bio layer flags, so it would be wrong to assume that
|
||||||
dnl # the APIs are mutually exclusive contrary to the typical case.
|
dnl # the APIs are mutually exclusive contrary to the typical case.
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_BARRIER], [
|
dnl #
|
||||||
AC_MSG_CHECKING([whether BIO_RW_BARRIER is defined])
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_RW_BARRIER], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_SRC([bio_rw_barrier], [
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
],[
|
],[
|
||||||
int flags __attribute__ ((unused));
|
int flags __attribute__ ((unused));
|
||||||
flags = BIO_RW_BARRIER;
|
flags = BIO_RW_BARRIER;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_BARRIER], [
|
||||||
|
AC_MSG_CHECKING([whether BIO_RW_BARRIER is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_rw_barrier], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_RW_BARRIER, 1, [BIO_RW_BARRIER is defined])
|
AC_DEFINE(HAVE_BIO_RW_BARRIER, 1, [BIO_RW_BARRIER is defined])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -3,20 +3,25 @@ dnl # Interface for issuing a discard bio:
|
|||||||
dnl # 2.6.28-2.6.35: BIO_RW_DISCARD
|
dnl # 2.6.28-2.6.35: BIO_RW_DISCARD
|
||||||
dnl # 2.6.36-3.x: REQ_DISCARD
|
dnl # 2.6.36-3.x: REQ_DISCARD
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl #
|
||||||
dnl # Since REQ_DISCARD is a preprocessor definition, there is no need for an
|
dnl # Since REQ_DISCARD is a preprocessor definition, there is no need for an
|
||||||
dnl # autotools check for it. Also, REQ_DISCARD existed in the request layer
|
dnl # autotools check for it. Also, REQ_DISCARD existed in the request layer
|
||||||
dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the
|
dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the
|
||||||
dnl # request layer and bio layer flags, so it would be wrong to assume that
|
dnl # request layer and bio layer flags, so it would be wrong to assume that
|
||||||
dnl # the APIs are mutually exclusive contrary to the typical case.
|
dnl # the APIs are mutually exclusive contrary to the typical case.
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_DISCARD], [
|
dnl #
|
||||||
AC_MSG_CHECKING([whether BIO_RW_DISCARD is defined])
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_RW_DISCARD], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_SRC([bio_rw_discard], [
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
],[
|
],[
|
||||||
int flags __attribute__ ((unused));
|
int flags __attribute__ ((unused));
|
||||||
flags = BIO_RW_DISCARD;
|
flags = BIO_RW_DISCARD;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_DISCARD], [
|
||||||
|
AC_MSG_CHECKING([whether BIO_RW_DISCARD is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_rw_discard], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BIO_RW_DISCARD, 1, [BIO_RW_DISCARD is defined])
|
AC_DEFINE(HAVE_BIO_RW_DISCARD, 1, [BIO_RW_DISCARD is defined])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 5.5 API,
|
||||||
|
dnl #
|
||||||
|
dnl # The Linux 5.5 kernel updated percpu_ref_tryget() which is inlined by
|
||||||
|
dnl # blkg_tryget() to use rcu_read_lock() instead of rcu_read_lock_sched().
|
||||||
|
dnl # As a side effect the function was converted to GPL-only.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKG_TRYGET], [
|
||||||
|
ZFS_LINUX_TEST_SRC([blkg_tryget], [
|
||||||
|
#include <linux/blk-cgroup.h>
|
||||||
|
#include <linux/bio.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
|
],[
|
||||||
|
struct blkcg_gq blkg __attribute__ ((unused));
|
||||||
|
bool rc __attribute__ ((unused));
|
||||||
|
rc = blkg_tryget(&blkg);
|
||||||
|
], [], [$ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
||||||
|
AC_MSG_CHECKING([whether blkg_tryget() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blkg_tryget], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BLKG_TRYGET, 1, [blkg_tryget() is available])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether blkg_tryget() is GPL-only])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blkg_tryget_license], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BLKG_TRYGET_GPL_ONLY, 1,
|
||||||
|
[blkg_tryget() GPL-only])
|
||||||
|
])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -3,51 +3,38 @@ dnl # Linux 4.14 API,
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # The bio_set_dev() helper macro was introduced as part of the transition
|
dnl # The bio_set_dev() helper macro was introduced as part of the transition
|
||||||
dnl # to have struct gendisk in struct bio.
|
dnl # to have struct gendisk in struct bio.
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV_MACRO], [
|
|
||||||
AC_MSG_CHECKING([whether bio_set_dev() exists])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/bio.h>
|
|
||||||
#include <linux/fs.h>
|
|
||||||
],[
|
|
||||||
struct block_device *bdev = NULL;
|
|
||||||
struct bio *bio = NULL;
|
|
||||||
bio_set_dev(bio, bdev);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() exists])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 5.0 API,
|
dnl # Linux 5.0 API,
|
||||||
dnl #
|
dnl #
|
||||||
dnl # The bio_set_dev() helper macro was updated to internally depend on
|
dnl # The bio_set_dev() helper macro was updated to internally depend on
|
||||||
dnl # bio_associate_blkg() symbol which is exported GPL-only.
|
dnl # bio_associate_blkg() symbol which is exported GPL-only.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV_GPL_ONLY], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [
|
||||||
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
ZFS_LINUX_TEST_SRC([bio_set_dev], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
|
||||||
],[
|
],[
|
||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
struct bio *bio = NULL;
|
struct bio *bio = NULL;
|
||||||
bio_set_dev(bio, bdev);
|
bio_set_dev(bio, bdev);
|
||||||
],[
|
], [], [$ZFS_META_LICENSE])
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
|
||||||
[bio_set_dev() GPL-only])
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||||
ZFS_AC_KERNEL_BIO_SET_DEV_MACRO
|
AC_MSG_CHECKING([whether bio_set_dev() is available])
|
||||||
ZFS_AC_KERNEL_BIO_SET_DEV_GPL_ONLY
|
ZFS_LINUX_TEST_RESULT([bio_set_dev], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() is available])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
||||||
|
[bio_set_dev() GPL-only])
|
||||||
|
])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,15 +2,19 @@ dnl #
|
|||||||
dnl # 2.6.32 - 4.11, statically allocated bdi in request_queue
|
dnl # 2.6.32 - 4.11, statically allocated bdi in request_queue
|
||||||
dnl # 4.12 - x.y, dynamically allocated bdi in request_queue
|
dnl # 4.12 - x.y, dynamically allocated bdi in request_queue
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_BDI], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI], [
|
||||||
AC_MSG_CHECKING([whether blk_queue bdi is dynamic])
|
ZFS_LINUX_TEST_SRC([blk_queue_bdi], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue q;
|
struct request_queue q;
|
||||||
struct backing_dev_info bdi;
|
struct backing_dev_info bdi;
|
||||||
q.backing_dev_info = &bdi;
|
q.backing_dev_info = &bdi;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_BDI], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue bdi is dynamic])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_bdi], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_BDI_DYNAMIC, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_BDI_DYNAMIC, 1,
|
||||||
[blk queue backing_dev_info is dynamic])
|
[blk queue backing_dev_info is dynamic])
|
||||||
|
|||||||
@@ -2,16 +2,19 @@ dnl #
|
|||||||
dnl # 2.6.32 - 4.x API,
|
dnl # 2.6.32 - 4.x API,
|
||||||
dnl # blk_queue_discard()
|
dnl # blk_queue_discard()
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_discard() is available])
|
ZFS_LINUX_TEST_SRC([blk_queue_discard], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||||
int value __attribute__ ((unused));
|
int value __attribute__ ((unused));
|
||||||
|
|
||||||
value = blk_queue_discard(q);
|
value = blk_queue_discard(q);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_discard() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_discard], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_DISCARD, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_DISCARD, 1,
|
||||||
[blk_queue_discard() is available])
|
[blk_queue_discard() is available])
|
||||||
@@ -30,16 +33,27 @@ dnl #
|
|||||||
dnl # 2.6.x - 2.6.35 API,
|
dnl # 2.6.x - 2.6.35 API,
|
||||||
dnl # Unsupported by kernel
|
dnl # Unsupported by kernel
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_secure_erase() is available])
|
ZFS_LINUX_TEST_SRC([blk_queue_secure_erase], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||||
int value __attribute__ ((unused));
|
int value __attribute__ ((unused));
|
||||||
|
|
||||||
value = blk_queue_secure_erase(q);
|
value = blk_queue_secure_erase(q);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
|
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||||
|
int value __attribute__ ((unused));
|
||||||
|
value = blk_queue_secdiscard(q);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_secure_erase() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_secure_erase], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_SECURE_ERASE, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_SECURE_ERASE, 1,
|
||||||
[blk_queue_secure_erase() is available])
|
[blk_queue_secure_erase() is available])
|
||||||
@@ -47,14 +61,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether blk_queue_secdiscard() is available])
|
AC_MSG_CHECKING([whether blk_queue_secdiscard() is available])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([blk_queue_secdiscard], [
|
||||||
#include <linux/blkdev.h>
|
|
||||||
],[
|
|
||||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
|
||||||
int value __attribute__ ((unused));
|
|
||||||
|
|
||||||
value = blk_queue_secdiscard(q);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_SECDISCARD, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_SECDISCARD, 1,
|
||||||
[blk_queue_secdiscard() is available])
|
[blk_queue_secdiscard() is available])
|
||||||
|
|||||||
@@ -3,36 +3,54 @@ dnl # API change
|
|||||||
dnl # https://github.com/torvalds/linux/commit/8814ce8
|
dnl # https://github.com/torvalds/linux/commit/8814ce8
|
||||||
dnl # Introduction of blk_queue_flag_set and blk_queue_flag_clear
|
dnl # Introduction of blk_queue_flag_set and blk_queue_flag_clear
|
||||||
dnl #
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET], [
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET], [
|
ZFS_LINUX_TEST_SRC([blk_queue_flag_set], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_flag_set() exists])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
blk_queue_flag_set(0, q);
|
blk_queue_flag_set(0, q);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_flag_set() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_flag_set], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_SET, 1, [blk_queue_flag_set() exists])
|
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_SET, 1,
|
||||||
|
[blk_queue_flag_set() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_flag_clear() exists])
|
ZFS_LINUX_TEST_SRC([blk_queue_flag_clear], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
blk_queue_flag_clear(0, q);
|
blk_queue_flag_clear(0, q);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_flag_clear() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_flag_clear], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_CLEAR, 1, [blk_queue_flag_clear() exists])
|
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_CLEAR, 1,
|
||||||
|
[blk_queue_flag_clear() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAGS], [
|
||||||
|
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET
|
||||||
|
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAGS], [
|
||||||
|
ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET
|
||||||
|
ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR
|
||||||
|
])
|
||||||
|
|||||||
@@ -9,35 +9,37 @@ dnl # there we implement our own compatibility function, otherwise
|
|||||||
dnl # we use the function. The hope is that long term this function
|
dnl # we use the function. The hope is that long term this function
|
||||||
dnl # will be opened up.
|
dnl # will be opened up.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_flush() is available])
|
ZFS_LINUX_TEST_SRC([blk_queue_flush], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
(void) blk_queue_flush(q, REQ_FLUSH);
|
(void) blk_queue_flush(q, REQ_FLUSH);
|
||||||
],[
|
], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
struct request_queue *q = NULL;
|
||||||
|
blk_queue_write_cache(q, true, true);
|
||||||
|
], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_flush() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_flush], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH, 1,
|
||||||
[blk_queue_flush() is available])
|
[blk_queue_flush() is available])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether blk_queue_flush() is GPL-only])
|
AC_MSG_CHECKING([whether blk_queue_flush() is GPL-only])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([blk_queue_flush_license], [
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/blkdev.h>
|
|
||||||
|
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
|
||||||
],[
|
|
||||||
struct request_queue *q = NULL;
|
|
||||||
(void) blk_queue_flush(q, REQ_FLUSH);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY, 1,
|
||||||
[blk_queue_flush() is GPL-only])
|
[blk_queue_flush() is GPL-only])
|
||||||
])
|
])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
@@ -48,38 +50,20 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
|||||||
dnl # Replace blk_queue_flush with blk_queue_write_cache
|
dnl # Replace blk_queue_flush with blk_queue_write_cache
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether blk_queue_write_cache() exists])
|
AC_MSG_CHECKING([whether blk_queue_write_cache() exists])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([blk_queue_write_cache], [
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/blkdev.h>
|
|
||||||
|
|
||||||
],[
|
|
||||||
struct request_queue *q = NULL;
|
|
||||||
blk_queue_write_cache(q, true, true);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE, 1,
|
||||||
[blk_queue_write_cache() exists])
|
[blk_queue_write_cache() exists])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether blk_queue_write_cache() is GPL-only])
|
AC_MSG_CHECKING([whether blk_queue_write_cache() is GPL-only])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([blk_queue_write_cache_license], [
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/blkdev.h>
|
|
||||||
|
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
|
||||||
],[
|
|
||||||
struct request_queue *q = NULL;
|
|
||||||
blk_queue_write_cache(q, true, true);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY, 1,
|
||||||
[blk_queue_write_cache() is GPL-only])
|
[blk_queue_write_cache() is GPL-only])
|
||||||
])
|
])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,21 +2,22 @@ dnl #
|
|||||||
dnl # 2.6.34 API change
|
dnl # 2.6.34 API change
|
||||||
dnl # blk_queue_max_hw_sectors() replaces blk_queue_max_sectors().
|
dnl # blk_queue_max_hw_sectors() replaces blk_queue_max_sectors().
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_HW_SECTORS], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_max_hw_sectors() is available])
|
ZFS_LINUX_TEST_SRC([blk_queue_max_hw_sectors], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
(void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
|
(void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
|
||||||
],[
|
], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_max_hw_sectors() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_max_hw_sectors], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_MAX_HW_SECTORS, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_MAX_HW_SECTORS, 1,
|
||||||
[blk_queue_max_hw_sectors() is available])
|
[blk_queue_max_hw_sectors() is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,21 +3,22 @@ dnl # 2.6.34 API change
|
|||||||
dnl # blk_queue_max_segments() consolidates blk_queue_max_hw_segments()
|
dnl # blk_queue_max_segments() consolidates blk_queue_max_hw_segments()
|
||||||
dnl # and blk_queue_max_phys_segments().
|
dnl # and blk_queue_max_phys_segments().
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_SEGMENTS], [
|
||||||
AC_MSG_CHECKING([whether blk_queue_max_segments() is available])
|
ZFS_LINUX_TEST_SRC([blk_queue_max_segments], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
(void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
|
(void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
|
||||||
],[
|
], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
|
||||||
|
AC_MSG_CHECKING([whether blk_queue_max_segments() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_max_segments], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
|
||||||
[blk_queue_max_segments() is available])
|
[blk_queue_max_segments() is available])
|
||||||
],[
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,43 +2,53 @@ dnl #
|
|||||||
dnl # 2.6.32-2.6.35 API - The BIO_RW_UNPLUG enum can be used as a hint
|
dnl # 2.6.32-2.6.35 API - The BIO_RW_UNPLUG enum can be used as a hint
|
||||||
dnl # to unplug the queue.
|
dnl # to unplug the queue.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_HAVE_BIO_RW_UNPLUG], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_RW_UNPLUG], [
|
||||||
AC_MSG_CHECKING([whether the BIO_RW_UNPLUG enum is available])
|
ZFS_LINUX_TEST_SRC([blk_queue_bio_rw_unplug], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
extern enum bio_rw_flags rw;
|
enum bio_rw_flags rw __attribute__ ((unused)) = BIO_RW_UNPLUG;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
rw = BIO_RW_UNPLUG;
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_UNPLUG], [
|
||||||
],[
|
AC_MSG_CHECKING([whether the BIO_RW_UNPLUG enum is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_queue_bio_rw_unplug], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG, 1,
|
||||||
[BIO_RW_UNPLUG is available])
|
[BIO_RW_UNPLUG is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_HAVE_BLK_PLUG], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_PLUG], [
|
||||||
AC_MSG_CHECKING([whether struct blk_plug is available])
|
ZFS_LINUX_TEST_SRC([blk_plug], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct blk_plug plug;
|
struct blk_plug plug __attribute__ ((unused));
|
||||||
|
|
||||||
blk_start_plug(&plug);
|
blk_start_plug(&plug);
|
||||||
blk_finish_plug(&plug);
|
blk_finish_plug(&plug);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_PLUG], [
|
||||||
|
AC_MSG_CHECKING([whether struct blk_plug is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blk_plug], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLK_QUEUE_HAVE_BLK_PLUG, 1,
|
AC_DEFINE(HAVE_BLK_QUEUE_HAVE_BLK_PLUG, 1,
|
||||||
[struct blk_plug is available])
|
[struct blk_plug is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_PLUG], [
|
||||||
|
ZFS_AC_KERNEL_SRC_BIO_RW_UNPLUG
|
||||||
|
ZFS_AC_KERNEL_SRC_BLK_PLUG
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_PLUG], [
|
||||||
|
ZFS_AC_KERNEL_BIO_RW_UNPLUG
|
||||||
|
ZFS_AC_KERNEL_BLK_PLUG
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,16 +3,21 @@ dnl # 2.6.38 API change
|
|||||||
dnl # open_bdev_exclusive() changed to blkdev_get_by_path()
|
dnl # open_bdev_exclusive() changed to blkdev_get_by_path()
|
||||||
dnl # close_bdev_exclusive() changed to blkdev_put()
|
dnl # close_bdev_exclusive() changed to blkdev_put()
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH], [
|
||||||
[AC_MSG_CHECKING([whether blkdev_get_by_path() is available])
|
ZFS_LINUX_TEST_SRC([blkdev_get_by_path], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
blkdev_get_by_path(NULL, 0, NULL);
|
blkdev_get_by_path(NULL, 0, NULL);
|
||||||
], [blkdev_get_by_path], [fs/block_dev.c], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH], [
|
||||||
|
AC_MSG_CHECKING([whether blkdev_get_by_path() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([blkdev_get_by_path],
|
||||||
|
[blkdev_get_by_path], [fs/block_dev.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLKDEV_GET_BY_PATH, 1,
|
AC_DEFINE(HAVE_BLKDEV_GET_BY_PATH, 1,
|
||||||
[blkdev_get_by_path() is available])
|
[blkdev_get_by_path() is available])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,16 +2,20 @@ dnl #
|
|||||||
dnl # 4.1 API, exported blkdev_reread_part() symbol, backported to the
|
dnl # 4.1 API, exported blkdev_reread_part() symbol, backported to the
|
||||||
dnl # 3.10.0 CentOS 7.x enterprise kernels.
|
dnl # 3.10.0 CentOS 7.x enterprise kernels.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_REREAD_PART], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_REREAD_PART], [
|
||||||
AC_MSG_CHECKING([whether blkdev_reread_part() is available])
|
ZFS_LINUX_TEST_SRC([blkdev_reread_part], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = blkdev_reread_part(bdev);
|
error = blkdev_reread_part(bdev);
|
||||||
], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_REREAD_PART], [
|
||||||
|
AC_MSG_CHECKING([whether blkdev_reread_part() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([blkdev_reread_part], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLKDEV_REREAD_PART, 1,
|
AC_DEFINE(HAVE_BLKDEV_REREAD_PART, 1,
|
||||||
[blkdev_reread_part() is available])
|
[blkdev_reread_part() is available])
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.38 API change
|
dnl # 2.6.38 API change
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
|
||||||
AC_MSG_CHECKING([whether bops->check_events() exists])
|
ZFS_LINUX_TEST_SRC([block_device_operations_check_events], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
|
|
||||||
unsigned int blk_check_events(struct gendisk *disk,
|
unsigned int blk_check_events(struct gendisk *disk,
|
||||||
@@ -15,25 +12,25 @@ AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
|
|||||||
bops __attribute__ ((unused)) = {
|
bops __attribute__ ((unused)) = {
|
||||||
.check_events = blk_check_events,
|
.check_events = blk_check_events,
|
||||||
};
|
};
|
||||||
],[
|
], [], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
|
||||||
|
AC_MSG_CHECKING([whether bops->check_events() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([block_device_operations_check_events], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS, 1,
|
AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS, 1,
|
||||||
[bops->check_events() exists])
|
[bops->check_events() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 3.10.x API change
|
dnl # 3.10.x API change
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
|
||||||
AC_MSG_CHECKING([whether bops->release() is void])
|
ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
|
|
||||||
void blk_release(struct gendisk *g, fmode_t mode) { return; }
|
void blk_release(struct gendisk *g, fmode_t mode) { return; }
|
||||||
@@ -45,13 +42,26 @@ AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
|
|||||||
.ioctl = NULL,
|
.ioctl = NULL,
|
||||||
.compat_ioctl = NULL,
|
.compat_ioctl = NULL,
|
||||||
};
|
};
|
||||||
],[
|
], [], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
],[
|
])
|
||||||
AC_MSG_RESULT(void)
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
|
||||||
|
AC_MSG_CHECKING([whether bops->release() is void])
|
||||||
|
ZFS_LINUX_TEST_RESULT([block_device_operations_release_void], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1,
|
AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1,
|
||||||
[bops->release() returns void])
|
[bops->release() returns void])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(int)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
|
||||||
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
||||||
|
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
|
||||||
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
|
||||||
|
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -19,13 +19,18 @@ dnl # Therefore, to ensure we have the correct API we only allow the
|
|||||||
dnl # clear_inode() compatibility code to be defined iff the evict_inode()
|
dnl # clear_inode() compatibility code to be defined iff the evict_inode()
|
||||||
dnl # functionality is also detected.
|
dnl # functionality is also detected.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CLEAR_INODE], [
|
||||||
[AC_MSG_CHECKING([whether clear_inode() is available])
|
ZFS_LINUX_TEST_SRC([clear_inode], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
clear_inode(NULL);
|
clear_inode(NULL);
|
||||||
], [clear_inode], [fs/inode.c], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether clear_inode() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([clear_inode],
|
||||||
|
[clear_inode], [fs/inode.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CLEAR_INODE, 1, [clear_inode() is available])
|
AC_DEFINE(HAVE_CLEAR_INODE, 1, [clear_inode() is available])
|
||||||
], [
|
], [
|
||||||
|
|||||||
@@ -4,19 +4,22 @@ dnl # Added eops->commit_metadata() callback to allow the underlying
|
|||||||
dnl # filesystem to determine the most efficient way to commit the inode.
|
dnl # filesystem to determine the most efficient way to commit the inode.
|
||||||
dnl # Prior to this the nfs server would issue an explicit fsync().
|
dnl # Prior to this the nfs server would issue an explicit fsync().
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_COMMIT_METADATA], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_COMMIT_METADATA], [
|
||||||
AC_MSG_CHECKING([whether eops->commit_metadata() exists])
|
ZFS_LINUX_TEST_SRC([export_operations_commit_metadata], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/exportfs.h>
|
#include <linux/exportfs.h>
|
||||||
int commit_metadata(struct inode *inode) { return 0; }
|
int commit_metadata(struct inode *inode) { return 0; }
|
||||||
static struct export_operations eops __attribute__ ((unused))={
|
static struct export_operations eops __attribute__ ((unused))={
|
||||||
.commit_metadata = commit_metadata,
|
.commit_metadata = commit_metadata,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_COMMIT_METADATA], [
|
||||||
|
AC_MSG_CHECKING([whether eops->commit_metadata() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([export_operations_commit_metadata], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_COMMIT_METADATA, 1,
|
AC_DEFINE(HAVE_COMMIT_METADATA, 1,
|
||||||
[eops->commit_metadata() exists])
|
[eops->commit_metadata() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,183 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Certain kernel build options are not supported. These must be
|
||||||
|
dnl # detected at configure time and cause a build failure. Otherwise
|
||||||
|
dnl # modules may be successfully built that behave incorrectly.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEFINED], [
|
||||||
|
AS_IF([test "x$cross_compiling" != xyes], [
|
||||||
|
AC_RUN_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([
|
||||||
|
#include "$LINUX/include/linux/license.h"
|
||||||
|
], [
|
||||||
|
return !license_is_gpl_compatible(
|
||||||
|
"$ZFS_META_LICENSE");
|
||||||
|
])
|
||||||
|
], [
|
||||||
|
AC_DEFINE([ZFS_IS_GPL_COMPATIBLE], [1],
|
||||||
|
[Define to 1 if GPL-only symbols can be used])
|
||||||
|
], [
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_THREAD_SIZE
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_TRIM_UNUSED_KSYMS
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_INFLATE
|
||||||
|
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_DEFLATE
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for kernel config option compatibility])
|
||||||
|
ZFS_LINUX_TEST_COMPILE_ALL([config])
|
||||||
|
AC_MSG_RESULT([done])
|
||||||
|
|
||||||
|
ZFS_AC_KERNEL_CONFIG_THREAD_SIZE
|
||||||
|
ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC
|
||||||
|
ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS
|
||||||
|
ZFS_AC_KERNEL_CONFIG_ZLIB_INFLATE
|
||||||
|
ZFS_AC_KERNEL_CONFIG_ZLIB_DEFLATE
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check configured THREAD_SIZE
|
||||||
|
dnl #
|
||||||
|
dnl # The stack size will vary by architecture, but as of Linux 3.15 on x86_64
|
||||||
|
dnl # the default thread stack size was increased to 16K from 8K. Therefore,
|
||||||
|
dnl # on newer kernels and some architectures stack usage optimizations can be
|
||||||
|
dnl # conditionally applied to improve performance without negatively impacting
|
||||||
|
dnl # stability.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_THREAD_SIZE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_thread_size], [
|
||||||
|
#include <linux/module.h>
|
||||||
|
],[
|
||||||
|
#if (THREAD_SIZE < 16384)
|
||||||
|
#error "THREAD_SIZE is less than 16K"
|
||||||
|
#endif
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_THREAD_SIZE], [
|
||||||
|
AC_MSG_CHECKING([whether kernel was built with 16K or larger stacks])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_thread_size], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_LARGE_STACKS, 1, [kernel has large stacks])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check CONFIG_DEBUG_LOCK_ALLOC
|
||||||
|
dnl #
|
||||||
|
dnl # This is typically only set for debug kernels because it comes with
|
||||||
|
dnl # a performance penalty. However, when it is set it maps the non-GPL
|
||||||
|
dnl # symbol mutex_lock() to the GPL-only mutex_lock_nested() symbol.
|
||||||
|
dnl # This will cause a failure at link time which we'd rather know about
|
||||||
|
dnl # at compile time.
|
||||||
|
dnl #
|
||||||
|
dnl # Since we plan to pursue making mutex_lock_nested() a non-GPL symbol
|
||||||
|
dnl # with the upstream community we add a check to detect this case.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_debug_lock_alloc], [
|
||||||
|
#include <linux/mutex.h>
|
||||||
|
],[
|
||||||
|
struct mutex lock;
|
||||||
|
|
||||||
|
mutex_init(&lock);
|
||||||
|
mutex_lock(&lock);
|
||||||
|
mutex_unlock(&lock);
|
||||||
|
], [], [$ZFS_META_LICENSE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
||||||
|
AC_MSG_CHECKING([whether mutex_lock() is GPL-only])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is incompatible
|
||||||
|
*** with the CDDL license and will prevent the module linking stage
|
||||||
|
*** from succeeding. You must rebuild your kernel without this
|
||||||
|
*** option enabled.])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check CONFIG_TRIM_UNUSED_KSYMS
|
||||||
|
dnl #
|
||||||
|
dnl # Verify the kernel has CONFIG_TRIM_UNUSED_KSYMS disabled.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_TRIM_UNUSED_KSYMS], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_trim_unusued_ksyms], [
|
||||||
|
#if defined(CONFIG_TRIM_UNUSED_KSYMS)
|
||||||
|
#error CONFIG_TRIM_UNUSED_KSYMS not defined
|
||||||
|
#endif
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS], [
|
||||||
|
AC_MSG_CHECKING([whether CONFIG_TRIM_UNUSED_KSYM is disabled])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_trim_unusued_ksyms], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AS_IF([test "x$enable_linux_builtin" != xyes], [
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** This kernel has unused symbols trimming enabled, please disable.
|
||||||
|
*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set.])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check CONFIG_ZLIB_INFLATE
|
||||||
|
dnl #
|
||||||
|
dnl # Verify the kernel has CONFIG_ZLIB_INFLATE support enabled.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_INFLATE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_zlib_inflate], [
|
||||||
|
#if !defined(CONFIG_ZLIB_INFLATE) && \
|
||||||
|
!defined(CONFIG_ZLIB_INFLATE_MODULE)
|
||||||
|
#error CONFIG_ZLIB_INFLATE not defined
|
||||||
|
#endif
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_ZLIB_INFLATE], [
|
||||||
|
AC_MSG_CHECKING([whether CONFIG_ZLIB_INFLATE is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_zlib_inflate], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** This kernel does not include the required zlib inflate support.
|
||||||
|
*** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set.])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Check CONFIG_ZLIB_DEFLATE
|
||||||
|
dnl #
|
||||||
|
dnl # Verify the kernel has CONFIG_ZLIB_DEFLATE support enabled.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_DEFLATE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([config_zlib_deflate], [
|
||||||
|
#if !defined(CONFIG_ZLIB_DEFLATE) && \
|
||||||
|
!defined(CONFIG_ZLIB_DEFLATE_MODULE)
|
||||||
|
#error CONFIG_ZLIB_DEFLATE not defined
|
||||||
|
#endif
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_ZLIB_DEFLATE], [
|
||||||
|
AC_MSG_CHECKING([whether CONFIG_ZLIB_DEFLATE is defined])
|
||||||
|
ZFS_LINUX_TEST_RESULT([config_zlib_deflate], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** This kernel does not include the required zlib deflate support.
|
||||||
|
*** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set.])
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # 3.6 API change
|
dnl # 3.6 API change
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE_NAMEIDATA], [
|
||||||
AC_MSG_CHECKING([whether iops->create() passes nameidata])
|
ZFS_LINUX_TEST_SRC([create_nameidata], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
|
||||||
@@ -19,11 +18,15 @@ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.create = inode_create,
|
.create = inode_create,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
|
||||||
|
AC_MSG_CHECKING([whether iops->create() passes nameidata])
|
||||||
|
ZFS_LINUX_TEST_RESULT([create_nameidata], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
|
AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
|
||||||
[iops->create() passes nameidata])
|
[iops->create() passes nameidata])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ dnl #
|
|||||||
dnl # 2.6.33 API change,
|
dnl # 2.6.33 API change,
|
||||||
dnl # Removed .ctl_name from struct ctl_table.
|
dnl # Removed .ctl_name from struct ctl_table.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CTL_NAME], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CTL_NAME], [
|
||||||
AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
|
ZFS_LINUX_TEST_SRC([ctl_name], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/sysctl.h>
|
#include <linux/sysctl.h>
|
||||||
],[
|
],[
|
||||||
struct ctl_table ctl __attribute__ ((unused));
|
struct ctl_table ctl __attribute__ ((unused));
|
||||||
ctl.ctl_name = 0;
|
ctl.ctl_name = 0;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CTL_NAME], [
|
||||||
|
AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
|
||||||
|
ZFS_LINUX_TEST_RESULT([ctl_name], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CTL_NAME, 1, [struct ctl_table has ctl_name])
|
AC_DEFINE(HAVE_CTL_NAME, 1, [struct ctl_table has ctl_name])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -2,14 +2,19 @@ dnl #
|
|||||||
dnl # 4.9, current_time() added
|
dnl # 4.9, current_time() added
|
||||||
dnl # 4.18, return type changed from timespec to timespec64
|
dnl # 4.18, return type changed from timespec to timespec64
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_TIME],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CURRENT_TIME], [
|
||||||
[AC_MSG_CHECKING([whether current_time() exists])
|
ZFS_LINUX_TEST_SRC([current_time], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
struct inode ip __attribute__ ((unused));
|
struct inode ip __attribute__ ((unused));
|
||||||
ip.i_atime = current_time(&ip);
|
ip.i_atime = current_time(&ip);
|
||||||
], [current_time], [fs/inode.c], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_TIME], [
|
||||||
|
AC_MSG_CHECKING([whether current_time() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([current_time],
|
||||||
|
[current_time], [fs/inode.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() exists])
|
AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() exists])
|
||||||
], [
|
], [
|
||||||
|
|||||||
@@ -4,30 +4,36 @@ dnl # current->bio_tail and current->bio_list were struct bio pointers prior to
|
|||||||
dnl # Linux 2.6.34. They were refactored into a struct bio_list pointer called
|
dnl # Linux 2.6.34. They were refactored into a struct bio_list pointer called
|
||||||
dnl # current->bio_list in Linux 2.6.34.
|
dnl # current->bio_list in Linux 2.6.34.
|
||||||
dnl #
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CURRENT_BIO_TAIL], [
|
||||||
|
ZFS_LINUX_TEST_SRC([current_bio_tail], [
|
||||||
|
#include <linux/sched.h>
|
||||||
|
], [
|
||||||
|
current->bio_tail = (struct bio **) NULL;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([current_bio_list], [
|
||||||
|
#include <linux/sched.h>
|
||||||
|
], [
|
||||||
|
current->bio_list = (struct bio_list *) NULL;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_BIO_TAIL], [
|
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_BIO_TAIL], [
|
||||||
AC_MSG_CHECKING([whether current->bio_tail exists])
|
AC_MSG_CHECKING([whether current->bio_tail exists])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([current_bio_tail], [
|
||||||
#include <linux/sched.h>
|
|
||||||
],[
|
|
||||||
current->bio_tail = (struct bio **) NULL;
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CURRENT_BIO_TAIL, 1,
|
AC_DEFINE(HAVE_CURRENT_BIO_TAIL, 1,
|
||||||
[current->bio_tail exists])
|
[current->bio_tail exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether current->bio_list exists])
|
AC_MSG_CHECKING([whether current->bio_list exists])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([current_bio_list], [
|
||||||
#include <linux/sched.h>
|
|
||||||
],[
|
|
||||||
current->bio_list = (struct bio_list *) NULL;
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CURRENT_BIO_LIST, 1,
|
AC_DEFINE(HAVE_CURRENT_BIO_LIST, 1,
|
||||||
[current->bio_list exists])
|
[current->bio_list exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_ERROR(no - Please file a bug report at
|
ZFS_LINUX_TEST_ERROR([bio_list])
|
||||||
https://github.com/zfsonlinux/zfs/issues/new)
|
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 3.4.0 API change
|
|
||||||
dnl # Added d_make_root() to replace previous d_alloc_root() function.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_D_MAKE_ROOT],
|
|
||||||
[AC_MSG_CHECKING([whether d_make_root() is available])
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/dcache.h>
|
|
||||||
], [
|
|
||||||
d_make_root(NULL);
|
|
||||||
], [d_make_root], [fs/dcache.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_D_MAKE_ROOT, 1, [d_make_root() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 2.6.28 API change
|
|
||||||
dnl # Added d_obtain_alias() helper function.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS],
|
|
||||||
[AC_MSG_CHECKING([whether d_obtain_alias() is available])
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/dcache.h>
|
|
||||||
], [
|
|
||||||
d_obtain_alias(NULL);
|
|
||||||
], [d_obtain_alias], [fs/dcache.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
|
|
||||||
[d_obtain_alias() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 2.6.12 API change
|
|
||||||
dnl # d_prune_aliases() helper function available.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES],
|
|
||||||
[AC_MSG_CHECKING([whether d_prune_aliases() is available])
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/dcache.h>
|
|
||||||
], [
|
|
||||||
struct inode *ip = NULL;
|
|
||||||
d_prune_aliases(ip);
|
|
||||||
], [d_prune_aliases], [fs/dcache.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1,
|
|
||||||
[d_prune_aliases() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -2,13 +2,10 @@ dnl #
|
|||||||
dnl # Ensure the DECLARE_EVENT_CLASS macro is available to non-GPL modules.
|
dnl # Ensure the DECLARE_EVENT_CLASS macro is available to non-GPL modules.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_DECLARE_EVENT_CLASS], [
|
AC_DEFUN([ZFS_AC_KERNEL_DECLARE_EVENT_CLASS], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="-I\$(src)"
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether DECLARE_EVENT_CLASS() is available])
|
AC_MSG_CHECKING([whether DECLARE_EVENT_CLASS() is available])
|
||||||
ZFS_LINUX_TRY_COMPILE_HEADER([
|
ZFS_LINUX_TRY_COMPILE_HEADER([
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
MODULE_LICENSE(ZFS_META_LICENSE);
|
MODULE_LICENSE("$ZFS_META_LICENSE");
|
||||||
|
|
||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include "conftest.h"
|
#include "conftest.h"
|
||||||
@@ -18,7 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_DECLARE_EVENT_CLASS], [
|
|||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_DECLARE_EVENT_CLASS, 1,
|
AC_DEFINE(HAVE_DECLARE_EVENT_CLASS, 1,
|
||||||
[DECLARE_EVENT_CLASS() is available])
|
[DECLARE_EVENT_CLASS() is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
],[
|
],[
|
||||||
@@ -55,5 +52,4 @@ AC_DEFUN([ZFS_AC_KERNEL_DECLARE_EVENT_CLASS], [
|
|||||||
#define TRACE_INCLUDE_FILE conftest
|
#define TRACE_INCLUDE_FILE conftest
|
||||||
#include <trace/define_trace.h>
|
#include <trace/define_trace.h>
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,9 +1,103 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 3.4.0 API change
|
||||||
|
dnl # Added d_make_root() to replace previous d_alloc_root() function.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_MAKE_ROOT], [
|
||||||
|
ZFS_LINUX_TEST_SRC([d_make_root], [
|
||||||
|
#include <linux/dcache.h>
|
||||||
|
], [
|
||||||
|
d_make_root(NULL);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_D_MAKE_ROOT], [
|
||||||
|
AC_MSG_CHECKING([whether d_make_root() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([d_make_root],
|
||||||
|
[d_make_root], [fs/dcache.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_D_MAKE_ROOT, 1, [d_make_root() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 2.6.28 API change
|
||||||
|
dnl # Added d_obtain_alias() helper function.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS], [
|
||||||
|
ZFS_LINUX_TEST_SRC([d_obtain_alias], [
|
||||||
|
#include <linux/dcache.h>
|
||||||
|
], [
|
||||||
|
d_obtain_alias(NULL);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS], [
|
||||||
|
AC_MSG_CHECKING([whether d_obtain_alias() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([d_obtain_alias],
|
||||||
|
[d_obtain_alias], [fs/dcache.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
|
||||||
|
[d_obtain_alias() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 2.6.12 API change
|
||||||
|
dnl # d_prune_aliases() helper function available.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES], [
|
||||||
|
ZFS_LINUX_TEST_SRC([d_prune_aliases], [
|
||||||
|
#include <linux/dcache.h>
|
||||||
|
], [
|
||||||
|
struct inode *ip = NULL;
|
||||||
|
d_prune_aliases(ip);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], [
|
||||||
|
AC_MSG_CHECKING([whether d_prune_aliases() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([d_prune_aliases],
|
||||||
|
[d_prune_aliases], [fs/dcache.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1,
|
||||||
|
[d_prune_aliases() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 2.6.38 API change
|
||||||
|
dnl # Added d_set_d_op() helper function.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [
|
||||||
|
ZFS_LINUX_TEST_SRC([d_set_d_op], [
|
||||||
|
#include <linux/dcache.h>
|
||||||
|
], [
|
||||||
|
d_set_d_op(NULL, NULL);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
||||||
|
AC_MSG_CHECKING([whether d_set_d_op() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([d_set_d_op],
|
||||||
|
[d_set_d_op], [fs/dcache.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_D_SET_D_OP, 1, [d_set_d_op() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 3.6 API change
|
dnl # 3.6 API change
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA], [
|
||||||
AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
|
ZFS_LINUX_TEST_SRC([dentry_operations_revalidate], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/dcache.h>
|
#include <linux/dcache.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
|
||||||
@@ -14,11 +108,15 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
|
|||||||
dops __attribute__ ((unused)) = {
|
dops __attribute__ ((unused)) = {
|
||||||
.d_revalidate = revalidate,
|
.d_revalidate = revalidate,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
|
||||||
|
AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
|
||||||
|
ZFS_LINUX_TEST_RESULT([dentry_operations_revalidate], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
|
AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
|
||||||
[dops->d_revalidate() operation takes nameidata])
|
[dops->d_revalidate() operation takes nameidata])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -28,9 +126,8 @@ dnl #
|
|||||||
dnl # 2.6.30 API change
|
dnl # 2.6.30 API change
|
||||||
dnl # The 'struct dentry_operations' was constified in the dentry structure.
|
dnl # The 'struct dentry_operations' was constified in the dentry structure.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS], [
|
||||||
AC_MSG_CHECKING([whether dentry uses const struct dentry_operations])
|
ZFS_LINUX_TEST_SRC([dentry_operations_const], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/dcache.h>
|
#include <linux/dcache.h>
|
||||||
|
|
||||||
const struct dentry_operations test_d_op = {
|
const struct dentry_operations test_d_op = {
|
||||||
@@ -38,12 +135,16 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
|
|||||||
};
|
};
|
||||||
],[
|
],[
|
||||||
struct dentry d __attribute__ ((unused));
|
struct dentry d __attribute__ ((unused));
|
||||||
|
|
||||||
d.d_op = &test_d_op;
|
d.d_op = &test_d_op;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
|
||||||
|
AC_MSG_CHECKING([whether dentry uses const struct dentry_operations])
|
||||||
|
ZFS_LINUX_TEST_RESULT([dentry_operations_const], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1,
|
AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1,
|
||||||
[dentry uses const struct dentry_operations])
|
[dentry uses const struct dentry_operations])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -51,38 +152,43 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
|
|||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.38 API change
|
dnl # 2.6.38 API change
|
||||||
dnl # Added d_set_d_op() helper function.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP],
|
|
||||||
[AC_MSG_CHECKING([whether d_set_d_op() is available])
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/dcache.h>
|
|
||||||
], [
|
|
||||||
d_set_d_op(NULL, NULL);
|
|
||||||
], [d_set_d_op], [fs/dcache.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_D_SET_D_OP, 1,
|
|
||||||
[d_set_d_op() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # 2.6.38 API chage
|
|
||||||
dnl # Added sb->s_d_op default dentry_operations member
|
dnl # Added sb->s_d_op default dentry_operations member
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_S_D_OP],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_S_D_OP], [
|
||||||
[AC_MSG_CHECKING([whether super_block has s_d_op])
|
ZFS_LINUX_TEST_SRC([super_block_s_d_op], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct super_block sb __attribute__ ((unused));
|
struct super_block sb __attribute__ ((unused));
|
||||||
sb.s_d_op = NULL;
|
sb.s_d_op = NULL;
|
||||||
], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_S_D_OP], [
|
||||||
|
AC_MSG_CHECKING([whether super_block has s_d_op])
|
||||||
|
ZFS_LINUX_TEST_RESULT([super_block_s_d_op], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_S_D_OP, 1, [struct super_block has s_d_op])
|
AC_DEFINE(HAVE_S_D_OP, 1, [struct super_block has s_d_op])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
||||||
|
ZFS_AC_KERNEL_SRC_D_MAKE_ROOT
|
||||||
|
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
||||||
|
ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES
|
||||||
|
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
||||||
|
ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA
|
||||||
|
ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS
|
||||||
|
ZFS_AC_KERNEL_SRC_S_D_OP
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
||||||
|
ZFS_AC_KERNEL_D_MAKE_ROOT
|
||||||
|
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||||
|
ZFS_AC_KERNEL_D_PRUNE_ALIASES
|
||||||
|
ZFS_AC_KERNEL_D_SET_D_OP
|
||||||
|
ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA
|
||||||
|
ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS
|
||||||
|
ZFS_AC_KERNEL_S_D_OP
|
||||||
|
])
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ dnl # The sops->dirty_inode() callbacks were updated to take a flags
|
|||||||
dnl # argument. This allows the greater control over whether the
|
dnl # argument. This allows the greater control over whether the
|
||||||
dnl # filesystem needs to push out a transaction or not.
|
dnl # filesystem needs to push out a transaction or not.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_DIRTY_INODE], [
|
||||||
AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
|
ZFS_LINUX_TEST_SRC([dirty_inode_with_flags], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
void dirty_inode(struct inode *a, int b) { return; }
|
void dirty_inode(struct inode *a, int b) { return; }
|
||||||
@@ -15,11 +14,15 @@ AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS], [
|
|||||||
sops __attribute__ ((unused)) = {
|
sops __attribute__ ((unused)) = {
|
||||||
.dirty_inode = dirty_inode,
|
.dirty_inode = dirty_inode,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
|
||||||
|
ZFS_LINUX_TEST_RESULT([dirty_inode_with_flags], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
|
AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
|
||||||
[sops->dirty_inode() wants flags])
|
[sops->dirty_inode() wants flags])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,18 +2,21 @@ dnl #
|
|||||||
dnl # 2.6.33 API change
|
dnl # 2.6.33 API change
|
||||||
dnl # Discard granularity and alignment restrictions may now be set.
|
dnl # Discard granularity and alignment restrictions may now be set.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_DISCARD_GRANULARITY], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY], [
|
||||||
AC_MSG_CHECKING([whether ql->discard_granularity is available])
|
ZFS_LINUX_TEST_SRC([discard_granularity], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct queue_limits ql __attribute__ ((unused));
|
struct queue_limits ql __attribute__ ((unused));
|
||||||
|
|
||||||
ql.discard_granularity = 0;
|
ql.discard_granularity = 0;
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_DISCARD_GRANULARITY], [
|
||||||
|
AC_MSG_CHECKING([whether ql->discard_granularity is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([discard_granularity], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_DISCARD_GRANULARITY, 1,
|
AC_DEFINE(HAVE_DISCARD_GRANULARITY, 1,
|
||||||
[ql->discard_granularity is available])
|
[ql->discard_granularity is available])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 2.6.36 API, exported elevator_change() symbol
|
|
||||||
dnl # 4.12 API, removed elevator_change() symbol
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_ELEVATOR_CHANGE], [
|
|
||||||
AC_MSG_CHECKING([whether elevator_change() is available])
|
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
|
||||||
#include <linux/elevator.h>
|
|
||||||
],[
|
|
||||||
int ret;
|
|
||||||
struct request_queue *q = NULL;
|
|
||||||
char *elevator = NULL;
|
|
||||||
ret = elevator_change(q, elevator);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_ELEVATOR_CHANGE, 1,
|
|
||||||
[elevator_change() is available])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
|
||||||
@@ -4,20 +4,23 @@ dnl # torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed the
|
|||||||
dnl # ->encode_fh() callback to pass the child inode and its parents inode
|
dnl # ->encode_fh() callback to pass the child inode and its parents inode
|
||||||
dnl # rather than a dentry and a boolean saying whether we want the parent.
|
dnl # rather than a dentry and a boolean saying whether we want the parent.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE], [
|
||||||
AC_MSG_CHECKING([whether eops->encode_fh() wants inode])
|
ZFS_LINUX_TEST_SRC([export_operations_encode_fh], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/exportfs.h>
|
#include <linux/exportfs.h>
|
||||||
int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
|
int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
|
||||||
struct inode *parent) { return 0; }
|
struct inode *parent) { return 0; }
|
||||||
static struct export_operations eops __attribute__ ((unused))={
|
static struct export_operations eops __attribute__ ((unused))={
|
||||||
.encode_fh = encode_fh,
|
.encode_fh = encode_fh,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether eops->encode_fh() wants inode])
|
||||||
|
ZFS_LINUX_TEST_RESULT([export_operations_encode_fh], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_ENCODE_FH_WITH_INODE, 1,
|
AC_DEFINE(HAVE_ENCODE_FH_WITH_INODE, 1,
|
||||||
[eops->encode_fh() wants child and parent inodes])
|
[eops->encode_fh() wants child and parent inodes])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,16 +3,19 @@ dnl # 2.6.36 API change
|
|||||||
dnl # The sops->delete_inode() and sops->clear_inode() callbacks have
|
dnl # The sops->delete_inode() and sops->clear_inode() callbacks have
|
||||||
dnl # replaced by a single sops->evict_inode() callback.
|
dnl # replaced by a single sops->evict_inode() callback.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_EVICT_INODE], [
|
||||||
AC_MSG_CHECKING([whether sops->evict_inode() exists])
|
ZFS_LINUX_TEST_SRC([evict_inode], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
void evict_inode (struct inode * t) { return; }
|
void evict_inode (struct inode * t) { return; }
|
||||||
static struct super_operations sops __attribute__ ((unused)) = {
|
static struct super_operations sops __attribute__ ((unused)) = {
|
||||||
.evict_inode = evict_inode,
|
.evict_inode = evict_inode,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether sops->evict_inode() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([evict_inode], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists])
|
AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # PaX Linux 2.6.38 - 3.x API
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
|
|
||||||
AC_MSG_CHECKING([whether fops->fallocate() exists])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
|
||||||
],[
|
|
||||||
long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
|
|
||||||
struct file_operations_no_const fops __attribute__ ((unused)) = {
|
|
||||||
.fallocate = fallocate,
|
|
||||||
};
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
+22
-28
@@ -1,9 +1,11 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 2.6.38 - 3.x API
|
dnl # The fallocate callback was moved from the inode_operations
|
||||||
|
dnl # structure to the file_operations structure.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
|
||||||
AC_MSG_CHECKING([whether fops->fallocate() exists])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
dnl # Linux 2.6.38 - 3.x API
|
||||||
|
ZFS_LINUX_TEST_SRC([file_fallocate], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
long test_fallocate(struct file *file, int mode,
|
long test_fallocate(struct file *file, int mode,
|
||||||
@@ -13,21 +15,10 @@ AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
|
|||||||
fops __attribute__ ((unused)) = {
|
fops __attribute__ ((unused)) = {
|
||||||
.fallocate = test_fallocate,
|
.fallocate = test_fallocate,
|
||||||
};
|
};
|
||||||
],[
|
], [])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl # Linux 2.6.x - 2.6.37 API
|
||||||
dnl # Linux 2.6.x - 2.6.37 API
|
ZFS_LINUX_TEST_SRC([inode_fallocate], [
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
|
|
||||||
AC_MSG_CHECKING([whether iops->fallocate() exists])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
long test_fallocate(struct inode *inode, int mode,
|
long test_fallocate(struct inode *inode, int mode,
|
||||||
@@ -37,20 +28,23 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
|
|||||||
fops __attribute__ ((unused)) = {
|
fops __attribute__ ((unused)) = {
|
||||||
.fallocate = test_fallocate,
|
.fallocate = test_fallocate,
|
||||||
};
|
};
|
||||||
|
], [])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
|
||||||
|
AC_MSG_CHECKING([whether fops->fallocate() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([file_fallocate], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
|
||||||
],[
|
],[
|
||||||
],[
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iops->fallocate() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_fallocate], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
|
AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # The fallocate callback was moved from the inode_operations
|
|
||||||
dnl # structure to the file_operations structure.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
|
|
||||||
ZFS_AC_KERNEL_FILE_FALLOCATE
|
|
||||||
ZFS_AC_KERNEL_INODE_FALLOCATE
|
|
||||||
])
|
|
||||||
|
|||||||
@@ -4,14 +4,18 @@ dnl # struct access file->f_path.dentry was replaced by accessor function
|
|||||||
dnl # since fix torvalds/linux@4bacc9c9234c ("overlayfs: Make f_path always
|
dnl # since fix torvalds/linux@4bacc9c9234c ("overlayfs: Make f_path always
|
||||||
dnl # point to the overlay and f_inode to the underlay").
|
dnl # point to the overlay and f_inode to the underlay").
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_DENTRY], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_DENTRY], [
|
||||||
AC_MSG_CHECKING([whether file_dentry() is available])
|
ZFS_LINUX_TEST_SRC([file_dentry], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct file *f = NULL;
|
struct file *f = NULL;
|
||||||
file_dentry(f);
|
file_dentry(f);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FILE_DENTRY], [
|
||||||
|
AC_MSG_CHECKING([whether file_dentry() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([file_dentry], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_FILE_DENTRY, 1, [file_dentry() is available])
|
AC_DEFINE(HAVE_FILE_DENTRY, 1, [file_dentry() is available])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ dnl # 3.19 API change
|
|||||||
dnl # struct access f->f_dentry->d_inode was replaced by accessor function
|
dnl # struct access f->f_dentry->d_inode was replaced by accessor function
|
||||||
dnl # file_inode(f)
|
dnl # file_inode(f)
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_INODE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_INODE], [
|
||||||
AC_MSG_CHECKING([whether file_inode() is available])
|
ZFS_LINUX_TEST_SRC([file_inode], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct file *f = NULL;
|
struct file *f = NULL;
|
||||||
file_inode(f);
|
file_inode(f);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FILE_INODE], [
|
||||||
|
AC_MSG_CHECKING([whether file_inode() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([file_inode], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_FILE_INODE, 1, [file_inode() is available])
|
AC_DEFINE(HAVE_FILE_INODE, 1, [file_inode() is available])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -2,16 +2,19 @@ dnl #
|
|||||||
dnl # 2.6.28 API change,
|
dnl # 2.6.28 API change,
|
||||||
dnl # check if fmode_t typedef is defined
|
dnl # check if fmode_t typedef is defined
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_TYPE_FMODE_T],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FMODE_T], [
|
||||||
[AC_MSG_CHECKING([whether kernel defines fmode_t])
|
ZFS_LINUX_TEST_SRC([type_fmode_t], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
],[
|
],[
|
||||||
fmode_t *ptr __attribute__ ((unused));
|
fmode_t *ptr __attribute__ ((unused));
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FMODE_T], [
|
||||||
|
AC_MSG_CHECKING([whether kernel defines fmode_t])
|
||||||
|
ZFS_LINUX_TEST_RESULT([type_fmode_t], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(HAVE_FMODE_T, 1,
|
AC_DEFINE(HAVE_FMODE_T, 1, [kernel defines fmode_t])
|
||||||
[kernel defines fmode_t])
|
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ dnl # 2.6.38 API change
|
|||||||
dnl # follow_down() renamed follow_down_one(). The original follow_down()
|
dnl # follow_down() renamed follow_down_one(). The original follow_down()
|
||||||
dnl # symbol still exists but will traverse down all the layers.
|
dnl # symbol still exists but will traverse down all the layers.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_DOWN_ONE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE], [
|
||||||
AC_MSG_CHECKING([whether follow_down_one() is available])
|
ZFS_LINUX_TEST_SRC([follow_down_one], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/namei.h>
|
#include <linux/namei.h>
|
||||||
],[
|
],[
|
||||||
struct path *p = NULL;
|
struct path *p = NULL;
|
||||||
follow_down_one(p);
|
follow_down_one(p);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_DOWN_ONE], [
|
||||||
|
AC_MSG_CHECKING([whether follow_down_one() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([follow_down_one], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_FOLLOW_DOWN_ONE, 1,
|
AC_DEFINE(HAVE_FOLLOW_DOWN_ONE, 1,
|
||||||
[follow_down_one() is available])
|
[follow_down_one() is available])
|
||||||
|
|||||||
+89
-26
@@ -2,8 +2,9 @@ dnl #
|
|||||||
dnl # Handle differences in kernel FPU code.
|
dnl # Handle differences in kernel FPU code.
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Kernel
|
dnl # Kernel
|
||||||
dnl # 5.0: All kernel fpu functions are GPL only, so we can't use them.
|
dnl # 5.0: Wrappers have been introduced to save/restore the FPU state.
|
||||||
dnl # (nothing defined)
|
dnl # This change was made to the 4.19.38 and 4.14.120 LTS kernels.
|
||||||
|
dnl # HAVE_KERNEL_FPU_INTERNAL
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 4.2: Use __kernel_fpu_{begin,end}()
|
dnl # 4.2: Use __kernel_fpu_{begin,end}()
|
||||||
dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
|
dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
|
||||||
@@ -11,8 +12,11 @@ dnl #
|
|||||||
dnl # Pre-4.2: Use kernel_fpu_{begin,end}()
|
dnl # Pre-4.2: Use kernel_fpu_{begin,end}()
|
||||||
dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
|
dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
dnl # N.B. The header check is performed before all other checks since it
|
||||||
AC_MSG_CHECKING([which kernel_fpu header to use])
|
dnl # depends on HAVE_KERNEL_FPU_API_HEADER being set in confdefs.h.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FPU_HEADER], [
|
||||||
|
AC_MSG_CHECKING([whether fpu headers are available])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TRY_COMPILE([
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <asm/fpu/api.h>
|
#include <asm/fpu/api.h>
|
||||||
@@ -24,45 +28,104 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
|||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(i387.h & xcr.h)
|
AC_MSG_RESULT(i387.h & xcr.h)
|
||||||
])
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([which kernel_fpu function to use])
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
ZFS_LINUX_TEST_SRC([kernel_fpu], [
|
||||||
#include <linux/module.h>
|
#include <linux/types.h>
|
||||||
#ifdef HAVE_KERNEL_FPU_API_HEADER
|
#ifdef HAVE_KERNEL_FPU_API_HEADER
|
||||||
#include <asm/fpu/api.h>
|
#include <asm/fpu/api.h>
|
||||||
#else
|
#else
|
||||||
#include <asm/i387.h>
|
#include <asm/i387.h>
|
||||||
#include <asm/xcr.h>
|
#include <asm/xcr.h>
|
||||||
#endif
|
#endif
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
], [
|
||||||
],[
|
|
||||||
kernel_fpu_begin();
|
kernel_fpu_begin();
|
||||||
kernel_fpu_end();
|
kernel_fpu_end();
|
||||||
], [kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
|
], [], [$ZFS_META_LICENSE])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([__kernel_fpu], [
|
||||||
|
#include <linux/types.h>
|
||||||
|
#ifdef HAVE_KERNEL_FPU_API_HEADER
|
||||||
|
#include <asm/fpu/api.h>
|
||||||
|
#else
|
||||||
|
#include <asm/i387.h>
|
||||||
|
#include <asm/xcr.h>
|
||||||
|
#endif
|
||||||
|
], [
|
||||||
|
__kernel_fpu_begin();
|
||||||
|
__kernel_fpu_end();
|
||||||
|
], [], [$ZFS_META_LICENSE])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([fpu_internal], [
|
||||||
|
#if defined(__x86_64) || defined(__x86_64__) || \
|
||||||
|
defined(__i386) || defined(__i386__)
|
||||||
|
#if !defined(__x86)
|
||||||
|
#define __x86
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__x86)
|
||||||
|
#error Unsupported architecture
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
#ifdef HAVE_KERNEL_FPU_API_HEADER
|
||||||
|
#include <asm/fpu/api.h>
|
||||||
|
#include <asm/fpu/internal.h>
|
||||||
|
#else
|
||||||
|
#include <asm/i387.h>
|
||||||
|
#include <asm/xcr.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(XSTATE_XSAVE)
|
||||||
|
#error XSTATE_XSAVE not defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(XSTATE_XRESTORE)
|
||||||
|
#error XSTATE_XRESTORE not defined
|
||||||
|
#endif
|
||||||
|
],[
|
||||||
|
struct fpu *fpu = ¤t->thread.fpu;
|
||||||
|
union fpregs_state *st = &fpu->state;
|
||||||
|
struct fregs_state *fr __attribute__ ((unused)) = &st->fsave;
|
||||||
|
struct fxregs_state *fxr __attribute__ ((unused)) = &st->fxsave;
|
||||||
|
struct xregs_state *xr __attribute__ ((unused)) = &st->xsave;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
||||||
|
dnl #
|
||||||
|
dnl # Legacy kernel
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether kernel fpu is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([kernel_fpu_license],
|
||||||
|
[kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
|
||||||
AC_MSG_RESULT(kernel_fpu_*)
|
AC_MSG_RESULT(kernel_fpu_*)
|
||||||
AC_DEFINE(HAVE_KERNEL_FPU, 1,
|
AC_DEFINE(HAVE_KERNEL_FPU, 1,
|
||||||
[kernel has kernel_fpu_* functions])
|
[kernel has kernel_fpu_* functions])
|
||||||
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
|
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
|
||||||
[kernel exports FPU functions])
|
[kernel exports FPU functions])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
dnl #
|
||||||
#include <linux/module.h>
|
dnl # Linux 4.2 kernel
|
||||||
#ifdef HAVE_KERNEL_FPU_API_HEADER
|
dnl #
|
||||||
#include <asm/fpu/api.h>
|
ZFS_LINUX_TEST_RESULT_SYMBOL([__kernel_fpu_license],
|
||||||
#else
|
[__kernel_fpu_begin],
|
||||||
#include <asm/i387.h>
|
[arch/x86/kernel/fpu/core.c arch/x86/kernel/i387.c], [
|
||||||
#include <asm/xcr.h>
|
|
||||||
#endif
|
|
||||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
|
||||||
],[
|
|
||||||
__kernel_fpu_begin();
|
|
||||||
__kernel_fpu_end();
|
|
||||||
], [__kernel_fpu_begin], [arch/x86/kernel/fpu/core.c arch/x86/kernel/i387.c], [
|
|
||||||
AC_MSG_RESULT(__kernel_fpu_*)
|
AC_MSG_RESULT(__kernel_fpu_*)
|
||||||
AC_DEFINE(HAVE_UNDERSCORE_KERNEL_FPU, 1, [kernel has __kernel_fpu_* functions])
|
AC_DEFINE(HAVE_UNDERSCORE_KERNEL_FPU, 1,
|
||||||
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions])
|
[kernel has __kernel_fpu_* functions])
|
||||||
|
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
|
||||||
|
[kernel exports FPU functions])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(not exported)
|
ZFS_LINUX_TEST_RESULT([fpu_internal], [
|
||||||
|
AC_MSG_RESULT(internal)
|
||||||
|
AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
|
||||||
|
[kernel fpu internal])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(unavailable)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ dnl # 2.6.38 API change
|
|||||||
dnl # The .get_sb callback has been replaced by a .mount callback
|
dnl # The .get_sb callback has been replaced by a .mount callback
|
||||||
dnl # in the file_system_type structure.
|
dnl # in the file_system_type structure.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FST_MOUNT], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FST_MOUNT], [
|
||||||
AC_MSG_CHECKING([whether fst->mount() exists])
|
ZFS_LINUX_TEST_SRC([file_system_type_mount], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
static struct dentry *
|
static struct dentry *
|
||||||
@@ -18,8 +17,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FST_MOUNT], [
|
|||||||
static struct file_system_type fst __attribute__ ((unused)) = {
|
static struct file_system_type fst __attribute__ ((unused)) = {
|
||||||
.mount = mount,
|
.mount = mount,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_FST_MOUNT], [
|
||||||
|
AC_MSG_CHECKING([whether fst->mount() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([file_system_type_mount], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_FST_MOUNT, 1, [fst->mount() exists])
|
AC_DEFINE(HAVE_FST_MOUNT, 1, [fst->mount() exists])
|
||||||
],[
|
],[
|
||||||
|
|||||||
+43
-40
@@ -1,8 +1,8 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 2.6.x - 2.6.34 API
|
dnl # Check file_operations->fsync interface.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_SRC([fsync_with_dentry], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int test_fsync(struct file *f, struct dentry *dentry, int x)
|
int test_fsync(struct file *f, struct dentry *dentry, int x)
|
||||||
@@ -12,20 +12,9 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
|
|||||||
fops __attribute__ ((unused)) = {
|
fops __attribute__ ((unused)) = {
|
||||||
.fsync = test_fsync,
|
.fsync = test_fsync,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([dentry])
|
|
||||||
AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
|
|
||||||
[fops->fsync() with dentry])
|
|
||||||
],[
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
ZFS_LINUX_TEST_SRC([fsync_without_dentry], [
|
||||||
dnl # Linux 2.6.35 - Linux 3.0 API
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int test_fsync(struct file *f, int x) { return 0; }
|
int test_fsync(struct file *f, int x) { return 0; }
|
||||||
@@ -34,20 +23,9 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
|
|||||||
fops __attribute__ ((unused)) = {
|
fops __attribute__ ((unused)) = {
|
||||||
.fsync = test_fsync,
|
.fsync = test_fsync,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([no dentry])
|
|
||||||
AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
|
|
||||||
[fops->fsync() without dentry])
|
|
||||||
],[
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
ZFS_LINUX_TEST_SRC([fsync_range], [
|
||||||
dnl # Linux 3.1 - 3.x API
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int test_fsync(struct file *f, loff_t a, loff_t b, int c)
|
int test_fsync(struct file *f, loff_t a, loff_t b, int c)
|
||||||
@@ -57,18 +35,43 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
|
|||||||
fops __attribute__ ((unused)) = {
|
fops __attribute__ ((unused)) = {
|
||||||
.fsync = test_fsync,
|
.fsync = test_fsync,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([range])
|
|
||||||
AC_DEFINE(HAVE_FSYNC_RANGE, 1,
|
|
||||||
[fops->fsync() with range])
|
|
||||||
],[
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
|
AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
|
||||||
AC_MSG_CHECKING([whether fops->fsync() wants])
|
dnl #
|
||||||
ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
|
dnl # Linux 2.6.x - 2.6.34 API
|
||||||
ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
|
dnl #
|
||||||
ZFS_AC_KERNEL_FSYNC_RANGE
|
AC_MSG_CHECKING([whether fops->fsync() wants dentry])
|
||||||
|
ZFS_LINUX_TEST_RESULT([fsync_with_dentry], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
|
||||||
|
[fops->fsync() with dentry])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 2.6.35 - Linux 3.0 API
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether fops->fsync() wants no dentry])
|
||||||
|
ZFS_LINUX_TEST_RESULT([fsync_without_dentry], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
|
||||||
|
[fops->fsync() without dentry])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 3.1 - 3.x API
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether fops->fsync() wants range])
|
||||||
|
ZFS_LINUX_TEST_RESULT([fsync_range], [
|
||||||
|
AC_MSG_RESULT([range])
|
||||||
|
AC_DEFINE(HAVE_FSYNC_RANGE, 1,
|
||||||
|
[fops->fsync() with range])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([fops->fsync])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # 3.19 API addition
|
dnl # Check for generic io accounting interface.
|
||||||
dnl #
|
dnl #
|
||||||
dnl # torvalds/linux@394ffa503bc40e32d7f54a9b817264e81ce131b4 allows us to
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
||||||
dnl # increment iostat counters without generic_make_request().
|
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT_3ARG], [
|
|
||||||
AC_MSG_CHECKING([whether 3 arg generic IO accounting symbols are available])
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
|
|
||||||
void (*generic_start_io_acct_f)(int, unsigned long,
|
void (*generic_start_io_acct_f)(int, unsigned long,
|
||||||
@@ -16,24 +12,9 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT_3ARG], [
|
|||||||
], [
|
], [
|
||||||
generic_start_io_acct(0, 0, NULL);
|
generic_start_io_acct(0, 0, NULL);
|
||||||
generic_end_io_acct(0, NULL, 0);
|
generic_end_io_acct(0, NULL, 0);
|
||||||
], [generic_start_io_acct], [block/bio.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
|
||||||
[generic_start_io_acct()/generic_end_io_acct() available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
])
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
ZFS_LINUX_TEST_SRC([generic_acct_4args], [
|
||||||
dnl # Linux 4.14 API,
|
|
||||||
dnl #
|
|
||||||
dnl # generic_start_io_acct/generic_end_io_acct now require request_queue to be
|
|
||||||
dnl # provided. No functional changes, but preparation for inflight accounting
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT_4ARG], [
|
|
||||||
AC_MSG_CHECKING([whether 4 arg generic IO accounting symbols are available])
|
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
|
|
||||||
void (*generic_start_io_acct_f)(struct request_queue *, int,
|
void (*generic_start_io_acct_f)(struct request_queue *, int,
|
||||||
@@ -43,11 +24,41 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT_4ARG], [
|
|||||||
], [
|
], [
|
||||||
generic_start_io_acct(NULL, 0, 0, NULL);
|
generic_start_io_acct(NULL, 0, 0, NULL);
|
||||||
generic_end_io_acct(NULL, 0, NULL, 0);
|
generic_end_io_acct(NULL, 0, NULL, 0);
|
||||||
], [generic_start_io_acct], [block/bio.c], [
|
])
|
||||||
AC_MSG_RESULT(yes)
|
])
|
||||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
|
||||||
[generic_start_io_acct()/generic_end_io_acct() 4 arg available])
|
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
||||||
], [
|
dnl #
|
||||||
AC_MSG_RESULT(no)
|
dnl # 3.19 API addition
|
||||||
|
dnl #
|
||||||
|
dnl # torvalds/linux@394ffa50 allows us to increment iostat
|
||||||
|
dnl # counters without generic_make_request().
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether generic IO accounting wants 3 args])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||||
|
[generic_start_io_acct], [block/bio.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||||
|
[generic_start_io_acct()/generic_end_io_acct() available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 4.14 API,
|
||||||
|
dnl #
|
||||||
|
dnl # generic_start_io_acct/generic_end_io_acct now require
|
||||||
|
dnl # request_queue to be provided. No functional changes,
|
||||||
|
dnl # but preparation for inflight accounting.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether generic IO accounting wants 4 args])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
||||||
|
[generic_start_io_acct], [block/bio.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
||||||
|
[generic_start_io_acct()/generic_end_io_acct() ]
|
||||||
|
[4 arg available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -4,18 +4,21 @@ dnl #
|
|||||||
dnl # NULL inode_operations.readlink implies generic_readlink(), which
|
dnl # NULL inode_operations.readlink implies generic_readlink(), which
|
||||||
dnl # has been made static.
|
dnl # has been made static.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL], [
|
||||||
AC_MSG_CHECKING([whether generic_readlink is global])
|
ZFS_LINUX_TEST_SRC([generic_readlink_global], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
int i __attribute__ ((unused));
|
int i __attribute__ ((unused));
|
||||||
|
|
||||||
i = generic_readlink(NULL, NULL, 0);
|
i = generic_readlink(NULL, NULL, 0);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL], [
|
||||||
|
AC_MSG_CHECKING([whether generic_readlink is global])
|
||||||
|
ZFS_LINUX_TEST_RESULT([generic_readlink_global], [
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(HAVE_GENERIC_READLINK, 1,
|
AC_DEFINE(HAVE_GENERIC_READLINK, 1,
|
||||||
[generic_readlink is global])
|
[generic_readlink is global])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,14 +2,19 @@ dnl #
|
|||||||
dnl # 4.16 API change
|
dnl # 4.16 API change
|
||||||
dnl # Verify if get_disk_and_module() symbol is available.
|
dnl # Verify if get_disk_and_module() symbol is available.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_AND_MODULE],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_DISK_AND_MODULE], [
|
||||||
[AC_MSG_CHECKING([whether get_disk_and_module() is available])
|
ZFS_LINUX_TEST_SRC([get_disk_and_module], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/genhd.h>
|
#include <linux/genhd.h>
|
||||||
], [
|
], [
|
||||||
struct gendisk *disk = NULL;
|
struct gendisk *disk = NULL;
|
||||||
(void) get_disk_and_module(disk);
|
(void) get_disk_and_module(disk);
|
||||||
], [get_disk_and_module], [block/genhd.c], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_AND_MODULE], [
|
||||||
|
AC_MSG_CHECKING([whether get_disk_and_module() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([get_disk_and_module],
|
||||||
|
[get_disk_and_module], [block/genhd.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_DISK_AND_MODULE,
|
AC_DEFINE(HAVE_GET_DISK_AND_MODULE,
|
||||||
1, [get_disk_and_module() is available])
|
1, [get_disk_and_module() is available])
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.x API change
|
dnl # 2.6.x API change
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_RO], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_DISK_RO], [
|
||||||
AC_MSG_CHECKING([whether get_disk_ro() is available])
|
ZFS_LINUX_TEST_SRC([get_disk_ro], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
struct gendisk *disk = NULL;
|
struct gendisk *disk = NULL;
|
||||||
(void) get_disk_ro(disk);
|
(void) get_disk_ro(disk);
|
||||||
],[
|
], [$NO_UNUSED_BUT_SET_VARIABLE])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_RO], [
|
||||||
|
AC_MSG_CHECKING([whether get_disk_ro() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([get_disk_ro], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_DISK_RO, 1,
|
AC_DEFINE(HAVE_GET_DISK_RO, 1, [blk_disk_ro() is available])
|
||||||
[blk_disk_ro() is available])
|
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
+66
-62
@@ -1,13 +1,29 @@
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # Supported get_link() interfaces checked newest to oldest.
|
dnl # Supported get_link() interfaces checked newest to oldest.
|
||||||
|
dnl # Note this interface used to be named follow_link.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
|
||||||
dnl #
|
ZFS_LINUX_TEST_SRC([inode_operations_get_link], [
|
||||||
dnl # 4.2 API change
|
#include <linux/fs.h>
|
||||||
dnl # - This kernel retired the nameidata structure.
|
const char *get_link(struct dentry *de, struct inode *ip,
|
||||||
dnl #
|
struct delayed_call *done) { return "symlink"; }
|
||||||
AC_MSG_CHECKING([whether iops->follow_link() passes cookie])
|
static struct inode_operations
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
iops __attribute__ ((unused)) = {
|
||||||
|
.get_link = get_link,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_get_link_cookie], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
const char *get_link(struct dentry *de, struct
|
||||||
|
inode *ip, void **cookie) { return "symlink"; }
|
||||||
|
static struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.get_link = get_link,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_follow_link], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
const char *follow_link(struct dentry *de,
|
const char *follow_link(struct dentry *de,
|
||||||
void **cookie) { return "symlink"; }
|
void **cookie) { return "symlink"; }
|
||||||
@@ -15,35 +31,17 @@ AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.follow_link = follow_link,
|
.follow_link = follow_link,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
ZFS_LINUX_TEST_SRC([inode_operations_follow_link_nameidata], [
|
||||||
AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1,
|
|
||||||
[iops->follow_link() cookie])
|
|
||||||
],[
|
|
||||||
dnl #
|
|
||||||
dnl # 2.6.32 API
|
|
||||||
dnl #
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_CHECKING(
|
|
||||||
[whether iops->follow_link() passes nameidata])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
void *follow_link(struct dentry *de, struct
|
void *follow_link(struct dentry *de, struct
|
||||||
nameidata *nd) { return (void *)NULL; }
|
nameidata *nd) { return (void *)NULL; }
|
||||||
static struct inode_operations
|
static struct inode_operations
|
||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.follow_link = follow_link,
|
.follow_link = follow_link,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
|
|
||||||
[iops->follow_link() nameidata])
|
|
||||||
],[
|
|
||||||
AC_MSG_ERROR(no; please file a bug report)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
|
AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
|
||||||
@@ -53,20 +51,12 @@ AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
|
|||||||
dnl # used it to retire the put_link() interface.
|
dnl # used it to retire the put_link() interface.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether iops->get_link() passes delayed])
|
AC_MSG_CHECKING([whether iops->get_link() passes delayed])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [
|
||||||
#include <linux/fs.h>
|
|
||||||
const char *get_link(struct dentry *de, struct inode *ip,
|
|
||||||
struct delayed_call *done) { return "symlink"; }
|
|
||||||
static struct inode_operations
|
|
||||||
iops __attribute__ ((unused)) = {
|
|
||||||
.get_link = get_link,
|
|
||||||
};
|
|
||||||
],[
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_LINK_DELAYED, 1,
|
AC_DEFINE(HAVE_GET_LINK_DELAYED, 1, [iops->get_link() delayed])
|
||||||
[iops->get_link() delayed])
|
|
||||||
],[
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 4.5 API change
|
dnl # 4.5 API change
|
||||||
dnl # The follow_link() interface has been replaced by
|
dnl # The follow_link() interface has been replaced by
|
||||||
@@ -74,27 +64,41 @@ AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
|
|||||||
dnl # - An inode is passed as a separate argument
|
dnl # - An inode is passed as a separate argument
|
||||||
dnl # - When called in RCU mode a NULL dentry is passed.
|
dnl # - When called in RCU mode a NULL dentry is passed.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_CHECKING([whether iops->get_link() passes cookie])
|
AC_MSG_CHECKING([whether iops->get_link() passes cookie])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_link_cookie], [
|
||||||
#include <linux/fs.h>
|
|
||||||
const char *get_link(struct dentry *de, struct
|
|
||||||
inode *ip, void **cookie) { return "symlink"; }
|
|
||||||
static struct inode_operations
|
|
||||||
iops __attribute__ ((unused)) = {
|
|
||||||
.get_link = get_link,
|
|
||||||
};
|
|
||||||
],[
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_LINK_COOKIE, 1,
|
AC_DEFINE(HAVE_GET_LINK_COOKIE, 1,
|
||||||
[iops->get_link() cookie])
|
[iops->get_link() cookie])
|
||||||
],[
|
],[
|
||||||
dnl #
|
|
||||||
dnl # Check for the follow_link APIs.
|
|
||||||
dnl #
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
ZFS_AC_KERNEL_FOLLOW_LINK
|
|
||||||
|
dnl #
|
||||||
|
dnl # 4.2 API change
|
||||||
|
dnl # This kernel retired the nameidata structure.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether iops->follow_link() passes cookie])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_follow_link], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1,
|
||||||
|
[iops->follow_link() cookie])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 2.6.32 API
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether iops->follow_link() passes nameidata])
|
||||||
|
ZFS_LINUX_TEST_RESULT(
|
||||||
|
[inode_operations_follow_link_nameidata],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
|
||||||
|
[iops->follow_link() nameidata])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([get_link])
|
||||||
|
])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -4,16 +4,21 @@ dnl #
|
|||||||
dnl # 75ef71840539 mm, vmstat: add infrastructure for per-node vmstats
|
dnl # 75ef71840539 mm, vmstat: add infrastructure for per-node vmstats
|
||||||
dnl # 599d0c954f91 mm, vmscan: move LRU lists to node
|
dnl # 599d0c954f91 mm, vmscan: move LRU lists to node
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE], [
|
||||||
AC_MSG_CHECKING([whether global_node_page_state() exists])
|
ZFS_LINUX_TEST_SRC([global_node_page_state], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/vmstat.h>
|
#include <linux/vmstat.h>
|
||||||
],[
|
],[
|
||||||
(void) global_node_page_state(0);
|
(void) global_node_page_state(0);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE], [
|
||||||
|
AC_MSG_CHECKING([whether global_node_page_state() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([global_node_page_state], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1, [global_node_page_state() exists])
|
AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1,
|
||||||
|
[global_node_page_state() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -24,16 +29,21 @@ dnl # 4.14 API change
|
|||||||
dnl #
|
dnl #
|
||||||
dnl # c41f012ade0b mm: rename global_page_state to global_zone_page_state
|
dnl # c41f012ade0b mm: rename global_page_state to global_zone_page_state
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE], [
|
||||||
AC_MSG_CHECKING([whether global_zone_page_state() exists])
|
ZFS_LINUX_TEST_SRC([global_zone_page_state], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/vmstat.h>
|
#include <linux/vmstat.h>
|
||||||
],[
|
],[
|
||||||
(void) global_zone_page_state(0);
|
(void) global_zone_page_state(0);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE], [
|
||||||
|
AC_MSG_CHECKING([whether global_zone_page_state() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([global_zone_page_state], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(ZFS_GLOBAL_ZONE_PAGE_STATE, 1, [global_zone_page_state() exists])
|
AC_DEFINE(ZFS_GLOBAL_ZONE_PAGE_STATE, 1,
|
||||||
|
[global_zone_page_state() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -44,9 +54,11 @@ dnl # Create a define and autoconf variable for an enum member
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
||||||
AC_MSG_CHECKING([whether enum $2 contains $1])
|
AC_MSG_CHECKING([whether enum $2 contains $1])
|
||||||
AS_IF([AC_TRY_COMMAND("${srcdir}/scripts/enum-extract.pl" "$2" "$3" | egrep -qx $1)],[
|
AS_IF([AC_TRY_COMMAND(
|
||||||
|
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | egrep -qx $1)],[
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1, [enum $2 contains $1])
|
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
||||||
|
[enum $2 contains $1])
|
||||||
m4_join([_], [ZFS_ENUM], m4_toupper($2), $1)=1
|
m4_join([_], [ZFS_ENUM], m4_toupper($2), $1)=1
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@@ -59,8 +71,7 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR],[
|
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_RESULT([$1 in either node_stat_item or zone_stat_item: $2])
|
AC_MSG_RESULT([$1 in either node_stat_item or zone_stat_item: $2])
|
||||||
AC_MSG_RESULT([configure needs updating, see: config/kernel-global_page_state.m4])
|
ZFS_LINUX_TEST_ERROR([global page state])
|
||||||
AC_MSG_FAILURE([SHUT 'ER DOWN CLANCY, SHE'S PUMPIN' MUD!])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
|
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
|
||||||
@@ -75,10 +86,10 @@ AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Ensure the config tests are finding one and only one of each enum of interest
|
dnl # Ensure the config tests are finding one and only one of each enum.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
|
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
|
||||||
AC_MSG_CHECKING([global_page_state enums are sane])
|
AC_MSG_CHECKING([whether global_page_state enums are sane])
|
||||||
|
|
||||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
|
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
|
||||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
|
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
|
||||||
@@ -88,6 +99,11 @@ AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE], [
|
||||||
|
ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE
|
||||||
|
ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE
|
||||||
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # enum members in which we're interested
|
dnl # enum members in which we're interested
|
||||||
dnl #
|
dnl #
|
||||||
@@ -95,15 +111,23 @@ AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
|
|||||||
ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE
|
ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE
|
||||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE
|
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE
|
||||||
|
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES], [node_stat_item], [$LINUX/include/linux/mmzone.h])
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON], [node_stat_item], [$LINUX/include/linux/mmzone.h])
|
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE], [node_stat_item], [$LINUX/include/linux/mmzone.h])
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE], [node_stat_item], [$LINUX/include/linux/mmzone.h])
|
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||||
|
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE],
|
||||||
|
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
|
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES], [zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON], [zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE], [zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE], [zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||||
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE],
|
||||||
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
|
|
||||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
|
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,20 +2,21 @@ dnl #
|
|||||||
dnl # 4.9 API change
|
dnl # 4.9 API change
|
||||||
dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
|
dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GROUP_INFO_GID], [
|
||||||
AC_MSG_CHECKING([whether group_info->gid exists])
|
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="-Werror"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/cred.h>
|
#include <linux/cred.h>
|
||||||
],[
|
],[
|
||||||
struct group_info *gi = groups_alloc(1);
|
struct group_info *gi = groups_alloc(1);
|
||||||
gi->gid[0] = KGIDT_INIT(0);
|
gi->gid[0] = KGIDT_INIT(0);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
|
||||||
|
AC_MSG_CHECKING([whether group_info->gid exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([group_info_gid], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
|
AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -4,13 +4,17 @@ dnl # Added in_compat_syscall() which can be overridden on a per-
|
|||||||
dnl # architecture basis. Prior to this is_compat_task() was the
|
dnl # architecture basis. Prior to this is_compat_task() was the
|
||||||
dnl # provided interface.
|
dnl # provided interface.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_IN_COMPAT_SYSCALL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL], [
|
||||||
AC_MSG_CHECKING([whether in_compat_syscall() is available])
|
ZFS_LINUX_TEST_SRC([in_compat_syscall], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/compat.h>
|
#include <linux/compat.h>
|
||||||
],[
|
],[
|
||||||
in_compat_syscall();
|
in_compat_syscall();
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_IN_COMPAT_SYSCALL], [
|
||||||
|
AC_MSG_CHECKING([whether in_compat_syscall() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([in_compat_syscall], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
|
AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
|
||||||
[in_compat_syscall() is available])
|
[in_compat_syscall() is available])
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ dnl #
|
|||||||
dnl # Linux 4.11 API
|
dnl # Linux 4.11 API
|
||||||
dnl # See torvalds/linux@a528d35
|
dnl # See torvalds/linux@a528d35
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_PATH_KERNEL_IOPS_GETATTR], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
||||||
AC_MSG_CHECKING([whether iops->getattr() takes a path])
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int test_getattr(
|
int test_getattr(
|
||||||
@@ -16,24 +15,9 @@ AC_DEFUN([ZFS_AC_PATH_KERNEL_IOPS_GETATTR], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.getattr = test_getattr,
|
.getattr = test_getattr,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
|
|
||||||
[iops->getattr() takes a path])
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # Linux 3.9 - 4.10 API
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_VFSMOUNT_KERNEL_IOPS_GETATTR], [
|
|
||||||
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
int test_getattr(
|
int test_getattr(
|
||||||
@@ -45,23 +29,25 @@ AC_DEFUN([ZFS_AC_VFSMOUNT_KERNEL_IOPS_GETATTR], [
|
|||||||
iops __attribute__ ((unused)) = {
|
iops __attribute__ ((unused)) = {
|
||||||
.getattr = test_getattr,
|
.getattr = test_getattr,
|
||||||
};
|
};
|
||||||
],[
|
],[])
|
||||||
],[
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
||||||
|
AC_MSG_CHECKING([whether iops->getattr() takes a path])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
|
||||||
[iops->getattr() takes a vfsmount])
|
[iops->getattr() takes a path])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
||||||
|
[iops->getattr() takes a vfsmount])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
dnl #
|
|
||||||
dnl # The interface of the getattr callback from the inode_operations
|
|
||||||
dnl # structure changed. Also, the interface of the simple_getattr()
|
|
||||||
dnl # function provided by the kernel changed.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GETATTR], [
|
|
||||||
ZFS_AC_PATH_KERNEL_IOPS_GETATTR
|
|
||||||
ZFS_AC_VFSMOUNT_KERNEL_IOPS_GETATTR
|
|
||||||
])
|
|
||||||
|
|||||||
@@ -4,20 +4,21 @@ dnl # i_mutex is changed to i_rwsem. Instead of directly using
|
|||||||
dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
|
dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
|
||||||
dnl # We test inode_lock_shared because inode_lock is introduced earlier.
|
dnl # We test inode_lock_shared because inode_lock is introduced earlier.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_LOCK], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_LOCK], [
|
||||||
AC_MSG_CHECKING([whether inode_lock_shared() exists])
|
ZFS_LINUX_TEST_SRC([inode_lock], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="-Werror"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct inode *inode = NULL;
|
struct inode *inode = NULL;
|
||||||
inode_lock_shared(inode);
|
inode_lock_shared(inode);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_LOCK], [
|
||||||
|
AC_MSG_CHECKING([whether inode_lock_shared() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_lock], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
|
AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ dnl #
|
|||||||
dnl # 3.15 API change
|
dnl # 3.15 API change
|
||||||
dnl # inode_set_flags introduced to set i_flags
|
dnl # inode_set_flags introduced to set i_flags
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_FLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SET_FLAGS], [
|
||||||
AC_MSG_CHECKING([whether inode_set_flags() exists])
|
ZFS_LINUX_TEST_SRC([inode_set_flags], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct inode inode;
|
struct inode inode;
|
||||||
inode_set_flags(&inode, S_IMMUTABLE, S_IMMUTABLE);
|
inode_set_flags(&inode, S_IMMUTABLE, S_IMMUTABLE);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_FLAGS], [
|
||||||
|
AC_MSG_CHECKING([whether inode_set_flags() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_set_flags], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INODE_SET_FLAGS, 1, [inode_set_flags() exists])
|
AC_DEFINE(HAVE_INODE_SET_FLAGS, 1, [inode_set_flags() exists])
|
||||||
],[
|
],[
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ dnl #
|
|||||||
dnl # 4.16 API change
|
dnl # 4.16 API change
|
||||||
dnl # inode_set_iversion introduced to set i_version
|
dnl # inode_set_iversion introduced to set i_version
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_IVERSION], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SET_IVERSION], [
|
||||||
AC_MSG_CHECKING([whether inode_set_iversion() exists])
|
ZFS_LINUX_TEST_SRC([inode_set_iversion], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/iversion.h>
|
#include <linux/iversion.h>
|
||||||
],[
|
],[
|
||||||
struct inode inode;
|
struct inode inode;
|
||||||
inode_set_iversion(&inode, 1);
|
inode_set_iversion(&inode, 1);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_IVERSION], [
|
||||||
|
AC_MSG_CHECKING([whether inode_set_iversion() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_set_iversion], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INODE_SET_IVERSION, 1,
|
AC_DEFINE(HAVE_INODE_SET_IVERSION, 1,
|
||||||
[inode_set_iversion() exists])
|
[inode_set_iversion() exists])
|
||||||
|
|||||||
@@ -1,12 +1,23 @@
|
|||||||
dnl #
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [
|
||||||
dnl # 4.18 API change
|
|
||||||
dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64.
|
dnl #
|
||||||
dnl #
|
dnl # 5.6 API change
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
|
dnl # timespec64_trunc() replaced by timestamp_truncate() interface.
|
||||||
AC_MSG_CHECKING([whether inode->i_*time's are timespec64])
|
dnl #
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
ZFS_LINUX_TEST_SRC([timestamp_truncate], [
|
||||||
EXTRA_KCFLAGS="-Werror"
|
#include <linux/fs.h>
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
],[
|
||||||
|
struct timespec64 ts;
|
||||||
|
struct inode ip;
|
||||||
|
|
||||||
|
ts = timestamp_truncate(ts, &ip);
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 4.18 API change
|
||||||
|
dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64.
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_times], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct inode ip;
|
struct inode ip;
|
||||||
@@ -14,12 +25,25 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
|
|||||||
|
|
||||||
memset(&ip, 0, sizeof(ip));
|
memset(&ip, 0, sizeof(ip));
|
||||||
ts = ip.i_mtime;
|
ts = ip.i_mtime;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
|
||||||
|
AC_MSG_CHECKING([whether timestamp_truncate() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([timestamp_truncate], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_INODE_TIMESTAMP_TRUNCATE, 1,
|
||||||
|
[timestamp_truncate() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether inode->i_*time's are timespec64])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_times], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INODE_TIMESPEC64_TIMES, 1,
|
AC_DEFINE(HAVE_INODE_TIMESPEC64_TIMES, 1,
|
||||||
[inode->i_*time's are timespec64])
|
[inode->i_*time's are timespec64])
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,16 +2,21 @@ dnl #
|
|||||||
dnl # 2.6.28 API change
|
dnl # 2.6.28 API change
|
||||||
dnl # Added insert_inode_locked() helper function.
|
dnl # Added insert_inode_locked() helper function.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INSERT_INODE_LOCKED],
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED], [
|
||||||
[AC_MSG_CHECKING([whether insert_inode_locked() is available])
|
ZFS_LINUX_TEST_SRC([insert_inode_locked], [
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
insert_inode_locked(NULL);
|
insert_inode_locked(NULL);
|
||||||
], [insert_inode_locked], [fs/inode.c], [
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INSERT_INODE_LOCKED], [
|
||||||
|
AC_MSG_CHECKING([whether insert_inode_locked() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([insert_inode_locked],
|
||||||
|
[insert_inode_locked], [fs/inode.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INSERT_INODE_LOCKED, 1,
|
AC_DEFINE(HAVE_INSERT_INODE_LOCKED, 1,
|
||||||
[insert_inode_locked() is available])
|
[insert_inode_locked() is available])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,17 +2,21 @@ dnl #
|
|||||||
dnl # 2.6.22 API change
|
dnl # 2.6.22 API change
|
||||||
dnl # Unused destroy_dirty_buffers arg removed from prototype.
|
dnl # Unused destroy_dirty_buffers arg removed from prototype.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INVALIDATE_BDEV], [
|
||||||
AC_MSG_CHECKING([whether invalidate_bdev() wants 1 arg])
|
ZFS_LINUX_TEST_SRC([invalidate_bdev], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/buffer_head.h>
|
#include <linux/buffer_head.h>
|
||||||
],[
|
],[
|
||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
invalidate_bdev(bdev);
|
invalidate_bdev(bdev);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INVALIDATE_BDEV], [
|
||||||
|
AC_MSG_CHECKING([whether invalidate_bdev() wants 1 arg])
|
||||||
|
ZFS_LINUX_TEST_RESULT([invalidate_bdev], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_1ARG_INVALIDATE_BDEV, 1,
|
AC_DEFINE(HAVE_1ARG_INVALIDATE_BDEV, 1,
|
||||||
[invalidate_bdev() wants 1 arg])
|
[invalidate_bdev() wants 1 arg])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -4,33 +4,40 @@ dnl # The is_owner_or_cap() macro was renamed to inode_owner_or_capable(),
|
|||||||
dnl # This is used for permission checks in the xattr and file attribute call
|
dnl # This is used for permission checks in the xattr and file attribute call
|
||||||
dnl # paths.
|
dnl # paths.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [
|
||||||
AC_MSG_CHECKING([whether inode_owner_or_capable() exists])
|
ZFS_LINUX_TEST_SRC([inode_owner_or_capable], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
struct inode *ip = NULL;
|
struct inode *ip = NULL;
|
||||||
(void) inode_owner_or_capable(ip);
|
(void) inode_owner_or_capable(ip);
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([is_owner_or_cap], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
],[
|
],[
|
||||||
|
struct inode *ip = NULL;
|
||||||
|
(void) is_owner_or_cap(ip);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [
|
||||||
|
AC_MSG_CHECKING([whether inode_owner_or_capable() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
|
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
|
||||||
[inode_owner_or_capable() exists])
|
[inode_owner_or_capable() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_CHECKING([whether is_owner_or_cap() exists])
|
AC_MSG_CHECKING([whether is_owner_or_cap() exists])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/fs.h>
|
ZFS_LINUX_TEST_RESULT([is_owner_or_cap], [
|
||||||
#include <linux/sched.h>
|
|
||||||
],[
|
|
||||||
struct inode *ip = NULL;
|
|
||||||
(void) is_owner_or_cap(ip);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_IS_OWNER_OR_CAP, 1,
|
AC_DEFINE(HAVE_IS_OWNER_OR_CAP, 1,
|
||||||
[is_owner_or_cap() exists])
|
[is_owner_or_cap() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_ERROR(no - Please file a bug report at
|
ZFS_LINUX_TEST_ERROR([capability])
|
||||||
https://github.com/zfsonlinux/zfs/issues/new)
|
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -3,17 +3,21 @@ dnl # 2.6.37 API change
|
|||||||
dnl # kmap_atomic changed from assigning hard-coded named slot to using
|
dnl # kmap_atomic changed from assigning hard-coded named slot to using
|
||||||
dnl # push/pop based dynamical allocation.
|
dnl # push/pop based dynamical allocation.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS], [
|
||||||
AC_MSG_CHECKING([whether kmap_atomic wants 1 args])
|
ZFS_LINUX_TEST_SRC([kmap_atomic], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
],[
|
],[
|
||||||
struct page page;
|
struct page page;
|
||||||
kmap_atomic(&page);
|
kmap_atomic(&page);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS], [
|
||||||
|
AC_MSG_CHECKING([whether kmap_atomic wants 1 args])
|
||||||
|
ZFS_LINUX_TEST_RESULT([kmap_atomic], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_1ARG_KMAP_ATOMIC, 1,
|
AC_DEFINE(HAVE_1ARG_KMAP_ATOMIC, 1,
|
||||||
[kmap_atomic wants 1 args])
|
[kmap_atomic wants 1 args])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|||||||
+38
-24
@@ -5,30 +5,36 @@ dnl # private allocation flags which are applied when allocating a new slab
|
|||||||
dnl # in kmem_getpages(). Unfortunately there is no public API for setting
|
dnl # in kmem_getpages(). Unfortunately there is no public API for setting
|
||||||
dnl # non-default flags.
|
dnl # non-default flags.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE_ALLOCFLAGS], [
|
||||||
AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
|
ZFS_LINUX_TEST_SRC([kmem_cache_allocflags], [
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
],[
|
],[
|
||||||
struct kmem_cache cachep __attribute__ ((unused));
|
struct kmem_cache cachep __attribute__ ((unused));
|
||||||
cachep.allocflags = GFP_KERNEL;
|
cachep.allocflags = GFP_KERNEL;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([kmem_cache_gfpflags], [
|
||||||
|
#include <linux/slab.h>
|
||||||
],[
|
],[
|
||||||
|
struct kmem_cache cachep __attribute__ ((unused));
|
||||||
|
cachep.gfpflags = GFP_KERNEL;
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS], [
|
||||||
|
AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
|
||||||
|
ZFS_LINUX_TEST_RESULT([kmem_cache_allocflags], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1,
|
AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1,
|
||||||
[struct kmem_cache has allocflags])
|
[struct kmem_cache has allocflags])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
|
AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
ZFS_LINUX_TEST_RESULT([kmem_cache_gfpflags], [
|
||||||
#include <linux/slab.h>
|
|
||||||
],[
|
|
||||||
struct kmem_cache cachep __attribute__ ((unused));
|
|
||||||
cachep.gfpflags = GFP_KERNEL;
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1,
|
AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1,
|
||||||
[struct kmem_cache has gfpflags])
|
[struct kmem_cache has gfpflags])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
@@ -40,16 +46,10 @@ dnl # grsecurity API change,
|
|||||||
dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
|
dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
|
||||||
dnl # kmem_cache_create_usercopy().
|
dnl # kmem_cache_create_usercopy().
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY], [
|
||||||
AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
|
ZFS_LINUX_TEST_SRC([kmem_cache_create_usercopy], [
|
||||||
tmp_flags="$EXTRA_KCFLAGS"
|
|
||||||
EXTRA_KCFLAGS="-Werror"
|
|
||||||
ZFS_LINUX_TRY_COMPILE([
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
static void ctor(void *foo)
|
static void ctor(void *foo) { /* fake ctor */ }
|
||||||
{
|
|
||||||
// fake ctor
|
|
||||||
}
|
|
||||||
],[
|
],[
|
||||||
struct kmem_cache *skc_linux_cache;
|
struct kmem_cache *skc_linux_cache;
|
||||||
const char *name = "test";
|
const char *name = "test";
|
||||||
@@ -60,13 +60,27 @@ AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
|
|||||||
size_t usersize = size - useroffset;
|
size_t usersize = size - useroffset;
|
||||||
|
|
||||||
skc_linux_cache = kmem_cache_create_usercopy(
|
skc_linux_cache = kmem_cache_create_usercopy(
|
||||||
name, size, align, flags, useroffset, usersize, ctor);
|
name, size, align, flags, useroffset, usersize, ctor);
|
||||||
],[
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
|
||||||
|
AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([kmem_cache_create_usercopy], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
|
AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
|
||||||
[kmem_cache_create_usercopy() exists])
|
[kmem_cache_create_usercopy() exists])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
EXTRA_KCFLAGS="$tmp_flags"
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE], [
|
||||||
|
ZFS_AC_KERNEL_SRC_KMEM_CACHE_ALLOCFLAGS
|
||||||
|
ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE], [
|
||||||
|
ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS
|
||||||
|
ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY
|
||||||
])
|
])
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user