[ $devsize -lt $1 ] && _notrun "scratch dev too small"
}
-# require scratch fs which supports >16T of filesystem size.
+# Require scratch fs which supports >16T of filesystem size.
+# _require_scratch must be called before this function is called.
_require_scratch_16T_support()
{
case $FSTYP in
# Swap files must be nocow on Btrfs.
$CHATTR_PROG +C "$fname" > /dev/null 2>&1
_pwrite_byte 0x61 0 "$sz" "$fname" >> $seqres.full
- $MKSWAP_PROG "$fname" >> $seqres.full
+ # Ignore permission complaints on filesystems that don't support perms
+ $MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2) >> $seqres.full
+}
+
+_swapon_file() {
+ local fname="$1"
+
+ # Ignore permission complaints on filesystems that don't support perms
+ swapon "$fname" 2> >(grep -v "insecure permissions" >&2)
}
# Check that the filesystem supports swapfiles
stat -f -c %S $1
}
+# Require that the fundamental allocation unit of a file is the same as the
+# filesystem block size.
+_require_file_block_size_equals_fs_block_size()
+{
+ local file_alloc_unit="$(_get_file_block_size $1)"
+ local fs_block_size="$(_get_block_size $1)"
+ test "$file_alloc_unit" != "$fs_block_size" && \
+ _notrun "File allocation unit is larger than a filesystem block"
+}
+
get_page_size()
{
echo $(getconf PAGE_SIZE)