Separate out the duplicated code to mnconf-common.c. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>