Linux: Implement FS_IOC_GETVERSION

Provide access to file generation number on Linux.

Add test coverage.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #12856
This commit is contained in:
Ryan Moeller
2021-12-17 19:18:37 -05:00
committed by GitHub
parent 82e414f1b2
commit 3fa5266d72
14 changed files with 226 additions and 0 deletions
+1
View File
@@ -201,6 +201,7 @@ export ZFSTEST_FILES='badsend
file_trunc
file_write
get_diff
getversion
largest_file
libzfs_input_check
mkbusy
+14
View File
@@ -4051,6 +4051,20 @@ function stat_crtime #<path>
esac
}
function stat_generation #<path>
{
typeset path=$1
case $(uname) in
Linux)
getversion "${path}"
;;
*)
stat -f %v "${path}"
;;
esac
}
# Run a command as if it was being run in a TTY.
#
# Usage: