@@ -4719,6 +4719,17 @@ _get_block_size()
stat -f -c %S $1
}
+# Obtain the directory block size of an fs.
+_get_dir_block_size()
+{
+ case "$FSTYP" in
+ xfs)
+ _xfs_get_dir_blocksize $1 ;;
+ *)
+ _get_block_size $1 ;;
+ esac
+}
+
# Require that the fundamental allocation unit of a file is the same as the
# filesystem block size. The sole parameter must be the root dir of a
# filesystem.
@@ -30,7 +30,7 @@ _scratch_mkfs > "$seqres.full" 2>&1
_qmount_option usrquota
_qmount
-blocksize=$(_get_block_size $SCRATCH_MNT)
+blocksize=$(_get_dir_block_size $SCRATCH_MNT)
scratchdir=$SCRATCH_MNT/dir
scratchfile=$SCRATCH_MNT/file
mkdir $scratchdir
@@ -30,7 +30,7 @@ _scratch_mkfs > "$seqres.full" 2>&1
_qmount_option usrquota
_qmount
-blocksize=$(_get_block_size $SCRATCH_MNT)
+blocksize=$(_get_dir_block_size $SCRATCH_MNT)
scratchdir=$SCRATCH_MNT/dir
scratchfile=$SCRATCH_MNT/file
stagedir=$SCRATCH_MNT/staging