Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # SPDX-License-Identifier: LGPL-2.1
0003 
0004 [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
0005 
0006 printf "static const char *mount_flags[] = {\n"
0007 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MS_([[:alnum:]_]+)[[:space:]]+([[:digit:]]+)[[:space:]]*.*'
0008 egrep $regex ${header_dir}/mount.h | egrep -v '(MSK|VERBOSE|MGC_VAL)\>' | \
0009         sed -r "s/$regex/\2 \2 \1/g" | sort -n | \
0010         xargs printf "\t[%s ? (ilog2(%s) + 1) : 0] = \"%s\",\n"
0011 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MS_([[:alnum:]_]+)[[:space:]]+\(1<<([[:digit:]]+)\)[[:space:]]*.*'
0012 egrep $regex ${header_dir}/mount.h | \
0013         sed -r "s/$regex/\2 \1/g" | \
0014         xargs printf "\t[%s + 1] = \"%s\",\n"
0015 printf "};\n"