mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: 223 - test file alignment on stripe geometry
A first-cut test to ensure that files are well-aligned on filesystems with stripe geometry. Several sizes of stripe units are mkfs'd, and then files are written and fallocated in various multiples of those stripe sizes. Each file is checked to ensure that the first block is stripe-aligned. (Ideally, for any fragmented files, we should ensure that each fragment start is well-aligned, but this does not do that yet) (slightly unrelated: don't send scratch mkfs output to /dev/null, we'd like to see mkfs output and direct it to $seq.full - this more or less matches _scratch_mkfs_xfs behavior and doesn't break any tests that I can see) Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -300,11 +300,37 @@ _scratch_mkfs()
|
||||
$MKFS_UDF_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
|
||||
;;
|
||||
*)
|
||||
/sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
|
||||
/sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Emulate an N-data-disk stripe w/ various stripe units
|
||||
# _scratch_mkfs_geom <sunit bytes> <swidth multiplier> [optional blocksize]
|
||||
_scratch_mkfs_geom()
|
||||
{
|
||||
sunit_bytes=$1
|
||||
swidth_mult=$2
|
||||
blocksize=$3
|
||||
[ -z "$blocksize" ] && blocksize=4096
|
||||
|
||||
let sunit_blocks=$sunit_bytes/$blocksize
|
||||
let swidth_blocks=$sunit_blocks*$swidth_mult
|
||||
|
||||
case $FSTYP in
|
||||
xfs)
|
||||
MKFS_OPTIONS="-b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
|
||||
;;
|
||||
ext4)
|
||||
MKFS_OPTIONS="-b $blocksize -E stride=$sunit_blocks,stripe_width=$swidth_blocks"
|
||||
;;
|
||||
*)
|
||||
_notrun "can't mkfs $FSTYP with geometry"
|
||||
;;
|
||||
esac
|
||||
_scratch_mkfs
|
||||
}
|
||||
|
||||
_scratch_xfs_db_options()
|
||||
{
|
||||
SCRATCH_OPTIONS=""
|
||||
|
||||
Reference in New Issue
Block a user