This commit adds the helper _scratch_get_iext_count() which returns an
inode fork's extent count.
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
return 1
}
+_scratch_get_iext_count()
+{
+ local ino=$1
+ local whichfork=$2
+ local field=""
+
+ case $whichfork in
+ "attr")
+ field=core.naextents
+ ;;
+ "data")
+ field=core.nextents
+ ;;
+ *)
+ return 1
+ esac
+
+ _scratch_xfs_get_metadata_field $field "inode $ino"
+}
+
#
# Ensures that we don't pass any mount options incompatible with XFS v4
#