Skip to content

Commit

Permalink
Merge commit 'f264f5e373eb' into android-3.18
Browse files Browse the repository at this point in the history
Synced to the latest commit for merge:
f264f5e f2fs: run fstrim asynchronously if runtime discard is on

Change-Id: I95a3b0404905f6fe8420ff4336feda3f50a911fa
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
  • Loading branch information
Jaegeuk Kim committed Jul 31, 2018
2 parents 236c076 + f264f5e commit ddfd4da
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 106 deletions.
12 changes: 11 additions & 1 deletion Documentation/filesystems/f2fs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ background_gc=%s Turn on/off cleaning operations, namely garbage
Default value for this option is on. So garbage
collection is on by default.
disable_roll_forward Disable the roll-forward recovery routine
discard Issue discard/TRIM commands when a segment is cleaned.
norecovery Disable the roll-forward recovery routine, mounted read-
only (i.e., -o ro,disable_roll_forward)
discard/nodiscard Enable/disable real-time discard in f2fs, if discard is
enabled, f2fs will issue discard/TRIM commands when a
segment is cleaned.
no_heap Disable heap-style segment allocation which finds free
segments for data from the beginning of main area, while
for node from the end of main area.
Expand All @@ -120,8 +124,14 @@ active_logs=%u Support configuring the number of active logs. In the
disable_ext_identify Disable the extension list configured by mkfs, so f2fs
does not aware of cold files such as media files.
inline_xattr Enable the inline xattrs feature.
noinline_xattr Disable the inline xattrs feature.
inline_data Enable the inline data feature: New created small(<~3.4k)
files can be written into inode block.
inline_dentry Enable the inline dir feature: data in new created
directory entries can be written into inode block. The
space of inode block which is used to store inline
dentries is limited to ~3.4k.
noinline_dentry Diable the inline dentry feature.
flush_merge Merge concurrent cache_flush commands as much as possible
to eliminate redundant command issues. If the underlying
device handles the cache_flush command relatively slowly,
Expand Down
218 changes: 113 additions & 105 deletions scripts/tags.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Generate tags or cscope files
# Usage tags.sh <mode>
#
Expand Down Expand Up @@ -135,11 +135,6 @@ all_kconfigs()
find_other_sources 'Kconfig*'
}

all_defconfigs()
{
find_sources $ALLSOURCE_ARCHS "defconfig"
}

docscope()
{
(echo \-k; echo \-q; all_target_sources) > cscope.files
Expand All @@ -151,11 +146,114 @@ dogtags()
all_target_sources | gtags -i -f -
}

# Basic regular expressions with an optional /kind-spec/ for ctags and
# the following limitations:
# - No regex modifiers
# - Use \{0,1\} instead of \?, because etags expects an unescaped ?
# - \s is not working with etags, use a space or [ \t]
# - \w works, but does not match underscores in etags
# - etags regular expressions have to match at the start of a line;
# a ^[^#] is prepended by setup_regex unless an anchor is already present
regex_asm=(
'/^\(ENTRY\|_GLOBAL\)(\([[:alnum:]_\\]*\)).*/\2/'
)
regex_c=(
'/^SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/sys_\1/'
'/^COMPAT_SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/compat_sys_\1/'
'/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1/'
'/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
'/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1/'
'/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
'/^DEFINE_INSN_CACHE_OPS(\([[:alnum:]_]*\).*/get_\1_slot/'
'/^DEFINE_INSN_CACHE_OPS(\([[:alnum:]_]*\).*/free_\1_slot/'
'/^PAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
'/^PAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
'/^PAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
'/^TESTSETFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
'/^TESTPAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
'/^SETPAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
'/\<__SETPAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
'/\<TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
'/\<__TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
'/\<CLEARPAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
'/\<__CLEARPAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
'/^__PAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
'/^__PAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
'/^PAGEFLAG_FALSE(\([[:alnum:]_]*\).*/Page\1/'
'/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
'/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
'/\<SETPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/SetPage\1/'
'/\<CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/ClearPage\1/'
'/\<__CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/__ClearPage\1/'
'/\<TESTCLEARFLAG_FALSE(\([[:alnum:]_]*\).*/TestClearPage\1/'
'/^PAGE_MAPCOUNT_OPS(\([[:alnum:]_]*\).*/Page\1/'
'/^PAGE_MAPCOUNT_OPS(\([[:alnum:]_]*\).*/__SetPage\1/'
'/^PAGE_MAPCOUNT_OPS(\([[:alnum:]_]*\).*/__ClearPage\1/'
'/^TASK_PFA_TEST([^,]*, *\([[:alnum:]_]*\))/task_\1/'
'/^TASK_PFA_SET([^,]*, *\([[:alnum:]_]*\))/task_set_\1/'
'/^TASK_PFA_CLEAR([^,]*, *\([[:alnum:]_]*\))/task_clear_\1/'
'/^DEF_MMIO_\(IN\|OUT\)_[XD](\([[:alnum:]_]*\),[^)]*)/\2/'
'/^DEBUGGER_BOILERPLATE(\([[:alnum:]_]*\))/\1/'
'/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/'
'/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/'
'/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/'
'/\<DEFINE_\(MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/'
'/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/'
'/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/'
'/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/'
'/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/'
'/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/'
'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
'/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
'/\<DECLARE_WAIT_QUEUE_HEAD(\([[:alnum:]_]*\)/\1/v/'
'/\<DECLARE_\(TASKLET\|WORK\|DELAYED_WORK\)(\([[:alnum:]_]*\)/\2/v/'
'/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/'
'/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/'
'/\<DEFINE_HASHTABLE(\([[:alnum:]_]*\)/\1/v/'
)
regex_kconfig=(
'/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/'
'/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/CONFIG_\2/'
)
setup_regex()
{
local mode=$1 lang tmp=() r
shift

regex=()
for lang; do
case "$lang" in
asm) tmp=("${regex_asm[@]}") ;;
c) tmp=("${regex_c[@]}") ;;
kconfig) tmp=("${regex_kconfig[@]}") ;;
esac
for r in "${tmp[@]}"; do
if test "$mode" = "exuberant"; then
regex[${#regex[@]}]="--regex-$lang=${r}b"
else
# Remove ctags /kind-spec/
case "$r" in
/*/*/?/)
r=${r%?/}
esac
# Prepend ^[^#] unless already anchored
case "$r" in
/^*) ;;
*)
r="/^[^#]*${r#/}"
esac
regex[${#regex[@]}]="--regex=$r"
fi
done
done
}

exuberant()
{
setup_regex exuberant asm c
all_target_sources | xargs $1 -a \
-I __initdata,__exitdata,__initconst, \
-I __cpuinitdata,__initdata_memblock \
-I __initdata_memblock \
-I __refdata,__attribute,__maybe_unused,__always_unused \
-I __acquires,__releases,__deprecated \
-I __read_mostly,__aligned,____cacheline_aligned \
Expand All @@ -166,112 +264,22 @@ exuberant()
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL \
-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
-I static,const \
--extra=+f --c-kinds=+px \
--regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
--regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \
--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
--regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \
--regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \
--regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \
--regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \
--regex-c++='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/' \
--regex-c++='/TESTPAGEFLAG\(([^,)]*).*/Page\1/' \
--regex-c++='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/' \
--regex-c++='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/' \
--regex-c++='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
--regex-c++='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
--regex-c++='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/' \
--regex-c++='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
--regex-c++='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/' \
--regex-c++='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
--regex-c++='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/' \
--regex-c++='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/' \
--regex-c++='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/' \
--regex-c++='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/' \
--regex-c++='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/' \
--regex-c++='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \
--regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
--regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
--regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
--regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
--regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
--regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
--regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
--regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
--regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \
--regex-c='/DEFINE_(RAW_SPINLOCK|RWLOCK|SEQLOCK)\((\w*)/\2/v/' \
--regex-c='/DECLARE_(RWSEM|COMPLETION)\((\w*)/\2/v/' \
--regex-c='/DECLARE_BITMAP\((\w*)/\1/v/' \
--regex-c='/(^|\s)(|L|H)LIST_HEAD\((\w*)/\3/v/' \
--regex-c='/(^|\s)RADIX_TREE\((\w*)/\2/v/' \
--regex-c='/DEFINE_PER_CPU\(([^,]*,\s*)(\w*).*\)/\2/v/' \
--regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
--regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
--regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
--regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \
--regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \
--regex-c='/(^\s)DEFINE\((\w*)/\2/v/' \
--regex-c='/DEFINE_HASHTABLE\((\w*)/\1/v/'
--extra=+fq --c-kinds=+px --fields=+iaS --langmap=c:+.h \
"${regex[@]}"

setup_regex exuberant kconfig
all_kconfigs | xargs $1 -a \
--langdef=kconfig --language-force=kconfig \
--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'
--langdef=kconfig --language-force=kconfig "${regex[@]}"

all_kconfigs | xargs $1 -a \
--langdef=kconfig --language-force=kconfig \
--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/CONFIG_\2/'

all_defconfigs | xargs -r $1 -a \
--langdef=dotconfig --language-force=dotconfig \
--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'
}

emacs()
{
all_target_sources | xargs $1 -a \
--regex='/^\(ENTRY\|_GLOBAL\)(\([^)]*\)).*/\2/' \
--regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
--regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \
--regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
--regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \
--regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \
--regex='/PAGEFLAG(\([^,)]*\).*/SetPage\1/' \
--regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
--regex='/TESTSETFLAG(\([^,)]*\).*/TestSetPage\1/' \
--regex='/TESTPAGEFLAG(\([^,)]*\).*/Page\1/' \
--regex='/SETPAGEFLAG(\([^,)]*\).*/SetPage\1/' \
--regex='/__SETPAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
--regex='/TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
--regex='/__TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
--regex='/CLEARPAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
--regex='/__CLEARPAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
--regex='/__PAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
--regex='/__PAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
--regex='/PAGEFLAG_FALSE(\([^,)]*\).*/Page\1/' \
--regex='/TESTSCFLAG(\([^,)]*\).*/TestSetPage\1/' \
--regex='/TESTSCFLAG(\([^,)]*\).*/TestClearPage\1/' \
--regex='/SETPAGEFLAG_NOOP(\([^,)]*\).*/SetPage\1/' \
--regex='/CLEARPAGEFLAG_NOOP(\([^,)]*\).*/ClearPage\1/' \
--regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
--regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
--regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
--regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
--regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
--regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \
--regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
--regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
--regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
--regex='/[^#]*DEFINE_HASHTABLE(\([^,)]*\)/\1/'

all_kconfigs | xargs $1 -a \
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'

all_kconfigs | xargs $1 -a \
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/CONFIG_\3/'
setup_regex emacs asm c
all_target_sources | xargs $1 -a "${regex[@]}"

all_defconfigs | xargs -r $1 -a \
--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'
setup_regex emacs kconfig
all_kconfigs | xargs $1 -a "${regex[@]}"
}

xtags()
Expand Down

0 comments on commit ddfd4da

Please sign in to comment.