End-of-File
}
+#
+# extended file attribute flags
+#
+_mk_fillconfig_xattr()
+{
+ cat <<End-of-File >$tmp.config
+# pathname size user group perm name
+#
+xflag_realtime 10 $nobody $nobody 777 XFS_XFLAG_REALTIME
+xflag_prealloc 10 $nobody $nobody 777 XFS_XFLAG_PREALLOC
+xflag_immutable 10 $nobody $nobody 777 XFS_XFLAG_IMMUTABLE
+xflag_append 10 $nobody $nobody 777 XFS_XFLAG_APPEND
+xflag_sync 10 $nobody $nobody 777 XFS_XFLAG_SYNC
+xflag_noatime 10 $nobody $nobody 777 XFS_XFLAG_NOATIME
+xflag_nodump 10 $nobody $nobody 777 XFS_XFLAG_NODUMP
+xflag_hasattr 10 $nobody $nobody 777 XFS_XFLAG_HASATTR
+End-of-File
+}
+
#
# Create a bunch of directories/files of different sizes
# filled with data.
if [ -n "$perms" ]; then
chmod $perms $file
fi
+ # extended attributes (EA)
if [ -n "$ea_name" -a -n "$ea_value" ]; then
if [ "X$namespace" = "Xroot" ]; then
attr -R -s $ea_name -V $ea_value $file
else
attr -s $ea_name -V $ea_value $file
fi
+ # extended file attribute flags - no value - NOT EAs
+ elif [ -n "$ea_name" -a -z "$ea_value" ]; then
+ # set the flag
+ # TODO XXX
+ # use xfs_io to send the ioctl
+ :
fi
$verbose && echo -n "."
done
/^c/ { date = $9; sub(date,"DATE"); print}
/^d/ { size = $5; sub(size,"SIZE"); print}
{print}' \
- | sed -e 's/total [0-9][0-9]*/total TOTAL/'
+ | sed -e 's/total [0-9][0-9]*/total TOTAL/' -e 's/[ \t][ \t]*/ /g'
}
# sort |\
# and this is now the Linux way...
echo "User names"
- getfattr --absolute-names -Rh $_path |\
+ getfattr --absolute-names -Rh -m user $_path |\
perl -wn -e '
if (m/^# file: (\S+)/) { $file = $1 }
elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
attr -g $ea_name $file
done
+ if [ "$USE_ATTR_SECURE" = yes ]; then
+ echo "Security names"
+ getfattr --absolute-names -Rh -m security $_path |\
+ perl -wn -e '
+ if (m/^# file: (\S+)/) { $file = $1 }
+ elsif (m/^security\.(\w+)/) { print $file, " ",$1,"\n" }' |\
+ sort |\
+ while read file ea_name; do
+ attr -g $ea_name $file
+ done
+ fi
+
echo "Root names"
getfattr --absolute-names -Rh -m trusted $_path |\
perl -wn -e '