+ if $OPT_DEBUG; then
+ if $OPT_RESTRIPE; then
+ parent_count=$($LFS getstripe -c \
+ $(dirname "$OLDNAME") 2> \
+ /dev/null)
+ parent_size=$($LFS getstripe -S \
+ $(dirname "$OLDNAME") 2> \
+ /dev/null)
+ fi
+
+ $ECHO -n "stripe" \
+ "count=${stripe_count:-$parent_count}," \
+ "size=${stripe_size:-$parent_size}," \
+ "pool=${POOL:-not in a pool}: "
+ fi
+
+ if $OPT_DRYRUN; then
+ $ECHO "dry run, skipped"
+ continue
+ fi
+
+ if [[ "$stripe_count" && -z "$STRIPE_COUNT" ]]; then
+ stripe_count="-c $stripe_count"
+ else
+ stripe_count=""
+ fi
+ if [[ "$stripe_size" && -z "$STRIPE_SIZE" ]]; then
+ stripe_size="-S $stripe_size"
+ else
+ stripe_size=""
+ fi
+
+ # detect other hard links and store them on a global
+ # list so we don't re-migrate them
+ local mntpoint=$(df -P "$OLDNAME" |
+ awk 'NR==2 { print $NF; exit }')
+ if [ -z "$mntpoint" ]; then
+ echo -e "\r\e[K$OLDNAME: cannot determine mount point; skipped"
+ continue
+ fi
+ hlinks=$($LFS fid2path "$mntpoint" "$fid" 2> /dev/null)
+ if [ $? -ne 0 ]; then
+ echo -e "\r\e[K$OLDNAME: cannot determine hard link paths, skipped"
+ continue
+ fi
+ hlinks+=("$OLDNAME")
+
+ # first try to migrate via Lustre tools, then fall back to rsync
+ if ! $LFS_MIGRATE_RSYNC_MODE; then
+ if $LFS migrate "${OPT_PASSTHROUGH[@]}" ${BLOCK} \
+ ${stripe_count} ${stripe_size} "$OLDNAME" &> \
+ /dev/null; then
+ $ECHO "done migrate"
+ for link in ${hlinks[*]}; do
+ add_to_set "$fid" "$link"
+ done
+ continue
+ elif $OPT_NO_RSYNC; then
+ echo -e "\r\e[K$OLDNAME: refusing to fall back to rsync, skipped" 1>&2