proc: deduplicate /proc/*/cmdline implementation
commit3cb4e162e4e258d906c07c411283b42b7f20a285
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 8 Jun 2018 00:10:02 +0000 (7 17:10 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Jun 2018 00:34:38 +0000 (7 17:34 -0700)
tree3a1d74c7ebd16d3dc9f3fbe7edce9a926b29251b
parent6a6cbe75dbdfaed6c4bbc2f109d69808f9cfa421
proc: deduplicate /proc/*/cmdline implementation

Code can be sonsolidated if a dummy region of 0 length is used in normal
case of \0-separated command line:

1) [arg_start, arg_end) + [dummy len=0]
2) [arg_start, arg_end) + [env_start, env_end)

Link: http://lkml.kernel.org/r/20180221193335.GB28678@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c