fsstress: get rid of attr_list
[xfstests-dev.git] / common / f2fs
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright 2020 Google LLC
4
5 # Require f2fs compression support on the scratch filesystem.
6 # Optionally, check for support for a specific compression algorithm.
7 _require_scratch_f2fs_compression()
8 {
9         local algorithm=$1
10
11         _require_scratch
12
13         if [ ! -e /sys/fs/f2fs/features/compression ]; then
14                 _notrun "Kernel doesn't support f2fs compression"
15         fi
16         # Note: '-O compression' is only accepted when used in
17         # combination with extra_attr.
18         if ! _scratch_mkfs -O compression,extra_attr >> $seqres.full; then
19                 _notrun "f2fs-tools doesn't support compression"
20         fi
21         if [ -n "$algorithm" ]; then
22                 if ! _scratch_mount "-o compress_algorithm=$algorithm"; then
23                         _notrun "Kernel doesn't support $algorithm compression algorithm for f2fs"
24                 fi
25                 _scratch_unmount
26         fi
27 }