Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
0003 # SPDX-License-Identifier: LGPL-2.1
0004 
0005 [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
0006 
0007 fs_header=${header_dir}/fs.h
0008 
0009 printf "static const char *rename_flags[] = {\n"
0010 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+RENAME_([[:alnum:]_]+)[[:space:]]+\(1[[:space:]]*<<[[:space:]]*([[:xdigit:]]+)[[:space:]]*\)[[:space:]]*.*'
0011 egrep -q $regex ${fs_header} && \
0012 (egrep $regex ${fs_header} | \
0013         sed -r "s/$regex/\2 \1/g"       | \
0014         xargs printf "\t[%d + 1] = \"%s\",\n")
0015 printf "};\n"