mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common/rc: factor out _scratch_xfs_[get|set]_sb_field
It's common to get and set the values of fields in XFS super block, so factor them out as scratch_xfs_[get|set]_sb_field, reimplement them based on _scratch_xfs_[get|set]_metadata_field, and update the related test cases accordingly. Also move _scratch_xfs_[get|set]_metadata_field from common/fuzzy to common/xfs. Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
+2
-9
@@ -71,18 +71,11 @@ _set_agf_data() {
|
||||
}
|
||||
|
||||
_get_sb_data() {
|
||||
field="$1"
|
||||
shift
|
||||
|
||||
_scratch_xfs_db -c 'sb 0' "$@" -c "p $field" | awk '{print $3}'
|
||||
_scratch_xfs_get_sb_field "$@"
|
||||
}
|
||||
|
||||
_set_sb_data() {
|
||||
field="$1"
|
||||
value="$2"
|
||||
shift; shift
|
||||
|
||||
_scratch_xfs_db -x -c 'sb 0' "$@" -c "write $field -- $value" >> $seqres.full
|
||||
_scratch_xfs_set_sb_field "$@" >> $seqres.full
|
||||
}
|
||||
|
||||
_filter_leftover() {
|
||||
|
||||
Reference in New Issue
Block a user