<commit_before>#!/bin/bash

set -e
set -x

if [ $(whoami) != "root" ]
then
    echo "Must be run as root" >&2
    exit 1
fi

backing_store=/opt/btrfs_backing_store
loopback_device=/dev/btrfs_loop
mount_point=/tmp/btrfs_mount

if [ ! -d $mount_point ]
then
    dd if=/dev/zero of=$backing_store bs=1M count=3000
    mknod $loopback_device b 7 200
    losetup $loopback_device $backing_store
    mkfs.btrfs $backing_store<commit_msg>Faster creation of btrfs loopback in non-nested testing<commit_after>#!/bin/bash

set -e
set -x

if [ $(whoami) != "root" ]
then
    echo "Must be run as root" >&2
    exit 1
fi

backing_store=/opt/btrfs_backing_store
loopback_device=/dev/btrfs_loop
mount_point=/tmp/btrfs_mount

if [ ! -d $mount_point ]
then
    touch $backing_store
    truncate -s 3000M $backing_store
    loopback_device=$(losetup -f --show $backing_store)
    mkfs.btrfs --nodiscard $loopback_device
{'fraction_non_alphanumeric': 0.11086474501108648, 'fraction_numerical': 0.018847006651884702, 'mean_word_length': 3.828877005347594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5685761', 'n_tokens_mistral': 375, 'n_tokens_neox': 357, 'n_words': 86}