+_user_do_get_encpolicy()
+{
+ local file=$1
+ shift
+
+ _user_do "$XFS_IO_PROG -c \"get_encpolicy $*\" \"$file\""
+}
+
+# Add an encryption key to the given filesystem.
+_add_enckey()
+{
+ local mnt=$1
+ local raw_key=$2
+ shift 2
+
+ echo -ne "$raw_key" | $XFS_IO_PROG -c "add_enckey $*" "$mnt"
+}
+
+_user_do_add_enckey()
+{
+ local mnt=$1
+ local raw_key=$2
+ shift 2
+
+ _user_do "echo -ne \"$raw_key\" | $XFS_IO_PROG -c \"add_enckey $*\" \"$mnt\""
+}
+
+# Remove the given encryption key from the given filesystem.
+_rm_enckey()
+{
+ local mnt=$1
+ local keyspec=$2
+ shift 2
+
+ $XFS_IO_PROG -c "rm_enckey $* $keyspec" "$mnt"
+}
+
+_user_do_rm_enckey()
+{
+ local mnt=$1
+ local keyspec=$2
+ shift 2
+
+ _user_do "$XFS_IO_PROG -c \"rm_enckey $* $keyspec\" \"$mnt\""
+}
+
+# Get the status of the given encryption key on the given filesystem.
+_enckey_status()
+{
+ local mnt=$1
+ local keyspec=$2
+ shift 2
+
+ $XFS_IO_PROG -c "enckey_status $* $keyspec" "$mnt"
+}
+
+_user_do_enckey_status()
+{
+ local mnt=$1
+ local keyspec=$2
+ shift 2
+
+ _user_do "$XFS_IO_PROG -c \"enckey_status $* $keyspec\" \"$mnt\""
+}
+