Re: [f2fs-dev] [PATCH v2] common/rc: support f2fs in _require_fanotify_ioerrors()

Anand Suveer Jain via Linux-f2fs-devel <[email protected]>
Newsgroups net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.fstests
Message-ID <[email protected]>

> How about this?
> 
> f2fs)
>     local feat_file="/sys/fs/f2fs/features/fserror"
>     if [ -f "$feat_file" ] && [ "$(cat "$feat_file")" = "supported" ]; then
>         return 0
>     fi
>     ;;


This is a check we will use often.
Why not add a helper like the untested code below [1]?
Furthermore, I can clean up _require_btrfs_fs_feature()
to use [1] as well.


[1]
common/rc:

_require_fs_feature_attr()
{
	local feat="$1"
	local attr="$2"

	modprobe $FSTYP > /dev/null 2>&1

	[ -e /sys/fs/$FSTYP/features/$feat ] || \
		_notrun "Feature $feat not supported on $FSTYP"

	if [ -n "$attr" ]; then
		if ! grep -qw "$attr" /sys/fs/$FSTYP/features/$feat; then
			_notrun "Feature $feat attribute $attr missing"
		fi
	fi
}



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.