]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/010: use _extent_count() helper
authorWang Shilong <wangshilong1991@gmail.com>
Tue, 14 Oct 2014 11:59:38 +0000 (22:59 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 14 Oct 2014 11:59:38 +0000 (22:59 +1100)
cleanup to swith _extent_count(), this way we remove a
dependence on filefrag.

Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/010 [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 371f1b8..6cfc561
@@ -40,6 +40,7 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/defrag
 
 # real QA test starts here
 
@@ -47,7 +48,6 @@ _cleanup()
 _supported_fs btrfs
 _supported_os Linux
 _require_scratch
-_require_command "/usr/sbin/filefrag"
 
 rm -f $seqres.full
 
@@ -71,9 +71,9 @@ done
 
 $BTRFS_UTIL_PROG filesystem defrag $subvol/foobar && sync
 
-num_extent_orig=`filefrag $subvol/foobar | awk -F ' ' '{print $2}'`
-num_extent_snap1=`filefrag $SCRATCH_MNT/snap-1/foobar | awk -F ' ' '{print $2}'`
-num_extent_snap2=`filefrag $SCRATCH_MNT/snap-2/foobar | awk -F ' ' '{print $2}'`
+num_extent_orig=`_extent_count $subvol/foobar`
+num_extent_snap1=`_extent_count $SCRATCH_MNT/snap-1/foobar`
+num_extent_snap2=`_extent_count $SCRATCH_MNT/snap-2/foobar`
 
 echo "$num_extent_orig $num_extent_snap1 $num_extent_snap2" >> $seqres.full