Speed up the BEADM LIST -S.

This commit is contained in:
Slawomir Wojciech Wojtczak (vermaden) 2012-08-15 01:47:54 +02:00
parent 3173f8932f
commit e3eb490ed7
1 changed files with 5 additions and 2 deletions

7
beadm
View File

@ -150,6 +150,11 @@ case ${1} in
WIDTH_NAME=$(( ${WIDTH_NAME} - ${#BENAME_STARTS_WITH} - 1 ))
printf "%-${WIDTH_NAME}s %-6s %-10s %6s %6s %s\n" \
BE Active Mountpoint Space Policy Created
if [ "${2}" = "-S" ]
then
# do the detailed space calculation [-S]
USED_ALL=$( zfs list -H -t all -o name,used )
fi
echo "${LIST}" \
| while read NAME USED MOUNTPOINT Y m d H M
do
@ -174,8 +179,6 @@ case ${1} in
esac
if [ "${2}" = "-S" ]
then
# do the detailed space calculation [-S]
USED_ALL=$( zfs list -H -t all -o name,used )
while read I
do
USED=$( echo "${USED_ALL}" | grep -m 1 "^${I}" | awk '{print $2}' )