proc: deduplicate /proc/*/cmdline implementation
authorAlexey Dobriyan <[email protected]>
Fri, 8 Jun 2018 00:10:02 +0000 (17:10 -0700)
committerLinus Torvalds <[email protected]>
Fri, 8 Jun 2018 00:34:38 +0000 (17:34 -0700)
commit3cb4e162e4e258d906c07c411283b42b7f20a285
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 <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/base.c