--- Revision None +++ Revision 313932316263 @@ -0,0 +1,48 @@ +#!/bin/bash + +mnt=/mnt/sdd +dev=/dev/sdd + +umount $dev &> /dev/null +mkfs.btrfs -f -n 4096 $dev +mount $dev $mnt + +echo -e "Filling fs...\n" + +# Ensure we get the fs tree with 3+ levels. +xattr_val=$(printf '%0.sX' $(seq 1 3850)) +for ((i = 1; i <= 10000; i++)); do + echo -n > $mnt/filler_$i + setfattr -n user.x1 -v $xattr_val $mnt/filler_$i +done + +xfs_io -f -c "pwrite 0 128K" $mnt/foobar + +# Creating snapshots..." +for ((i = 1; i <= 1000; i++)); do + btrfs subvolume snapshot -r $mnt $mnt/snap_$i +done + +extent_bytenr=$(btrfs inspect-internal dump-tree -t 5 $dev | egrep -A 2 EXTENT_DATA | perl -ne 'print $1 if /disk byte (\d+)/') +echo -e "\nExtent location at disk bytenr $extent_bytenr\n" + +ts_before=$(date +%s) +btrfs inspect-internal logical-resolve -P $extent_bytenr $mnt | wc -l +ts_after=$(date +%s) +echo -e "\nlogical-resolve took $((ts_after - ts_before)) seconds\n" + +ts_before=$(date +%s) +btrfs send -f /dev/null $mnt/snap_1 +ts_after=$(date +%s) +echo -e "\nsend took $((ts_after - ts_before)) seconds\n" + + + + + + + + + + +