Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # SPDX-License-Identifier: LGPL-2.1
0003 
0004 if [ $# -ne 1 ] ; then
0005         linux_header_dir=tools/include/uapi/linux
0006 else
0007         linux_header_dir=$1
0008 fi
0009 
0010 linux_mount=${linux_header_dir}/mount.h
0011 
0012 # Remove MOUNT_ATTR_RELATIME as it is zeros, handle it a special way in the beautifier
0013 # Only handle MOUNT_ATTR_ followed by a capital letter/num as __ is special case
0014 # for things like MOUNT_ATTR__ATIME that is a mask for the possible ATIME handling
0015 # bits. Special case it as well in the beautifier
0016 
0017 printf "static const char *fsmount_attr_flags[] = {\n"
0018 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MOUNT_ATTR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
0019 egrep $regex ${linux_mount} | grep -v MOUNT_ATTR_RELATIME | \
0020         sed -r "s/$regex/\2 \1/g"       | \
0021         xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
0022 printf "};\n"