@@ -618,6 +618,19 @@ _get_ciphertext_filename()
local dir_inode=$3
case $FSTYP in
+ btrfs)
+ # Extract the filename from the inode_ref object, similar to:
+ # item 24 key (259 INODE_REF 257) itemoff 14826 itemsize 26
+ # index 3 namelen 16 name: J\xf7\x15tD\x8eL\xae/\x98\x9f\x09\xc1\xb6\x09>
+ #
+ $BTRFS_UTIL_PROG inspect-internal dump-tree $device | \
+ grep -A 1 "key ($inode INODE_REF " | tail -n 1 | \
+ perl -ne '
+ s/.*?name: //;
+ chomp;
+ s/\\x([[:xdigit:]]{2})/chr hex $1/eg;
+ print;'
+ ;;
ext4)
# Extract the filename from the debugfs output line like:
#
@@ -715,6 +728,9 @@ _require_get_ciphertext_filename_support()
_notrun "dump.f2fs (f2fs-tools) is too old; doesn't support showing unambiguous on-disk filenames"
fi
;;
+ btrfs)
+ _require_command "$BTRFS_UTIL_PROG" btrfs
+ ;;
*)
_notrun "_get_ciphertext_filename() isn't implemented on $FSTYP"
;;