#!/usr/bin/bash

BASE=$1

if [ "$BASE" = "" ]; then
    echo Usage: create_file_set.sh BASENAME
    exit 1
fi

PATH=$PATH:/usr/share/pstorage/tests

M=0

for ((i=0; i<16; i++)); do
  while true; do
    touch $BASE$i
    ino=$(pcs_jhash $(stat -c "%i" $BASE$i) 0)
    if [ $[(1 << $ino) & $M] -ne 0 ]; then
      rm $BASE$i
    else
      echo $ino
      break
    fi
  done
  ino=$(pcs_jhash $(stat -c "%i" $BASE$i) 0)
  M=$[$M | (1 << $ino)]
  echo $ino " " $M
done

exit 0
