Linux Kernel Architecture

(Jacob Rumans) #1

Chapter 1: Introduction and Overview


create_new_namespace

clone_nsproxy

copy_mnt_ns

put_uts_ns

put_mnt_ns

copy_utsname

Error?

Error?

Return error

NO

NO

YES

YES

YES

NO

new_ns->put_ns
not NULL?

new_ns->
mnt_ns not
NULL?

copy_utsname

return result

return-ENOMEM

kmem_cache_free

Error?

Error?

1

1

Figure 1-15: Example of a faithful, but unclear and convoluted code flow diagram.

Instead I employ code flow diagrams that illustrate the essential tasks performed by a function.
Figure 1-16 shows the code flow diagram that I would have employed instead of Figure 1-15.

copy_namespaces

clone_nsproxy

copy_mnt_ns

copy_utsname

copy_ipcs

Figure 1-16: Example of the style
of code flow diagrams used in
this book. They allow
immediately catching all
essential actions without being
distracted by nonessential
standard tasks.

The diagram omits several things, but this is on purpose, and also essential. By looking at the
figure, you will not see every detail of the function implementation, but you will instead imme-
diately realize that the kernel uses a specific routine to create a clone of each namespace, and
the function names provide a sufficient hint of which namespace is copied. This is much more
important!
Free download pdf