%-------------------------------------------------------------------------------
% file_fmt_subsystem_integration.tex - subsystem integration as image
%-------------------------------------------------------------------------------
% author   : Manuel Bentele
% date     : Aug 29, 2019
% copyright: (c) 2019 Manuel Bentele
%-------------------------------------------------------------------------------

\begin{tikzpicture}[
        box/.style = {rectangle, draw, minimum height = 0.15\textheight},
        bwidth/.style = {minimum width = 0.35\textwidth},
        old/.style = {dashed, fill = gray!10},
        arrow/.style = {-triangle 45},
        desc/.style = {font = \small}
    ]
    \node[box, old, minimum height = 0.08\textheight, bwidth] (blk) {Block layer};
    \node[box, old, below = 0.6 of blk, bwidth] (loop) {Loop device module};
    \node[box, old, minimum height = 0.1\textheight,
        xshift = -0.1\textheight, yshift = -0.01\textheight] (lodevs)
            at (loop.south east) {Loop devices};
    \node[box, fill = hdr, right = 2 of loop] (subsys) {File format subsystem};
    \node[box, fill = dat, minimum height = 0.1\textheight,
        xshift = -0.1\textheight, yshift = -0.01\textheight] (drvs)
            at (subsys.south east) {File format drivers};
    \node[box, right = 2 of subsys, old] (file) {Backing files};
    
    \draw[arrow] (blk) -- node[right, desc] {Requests} (loop);
    \draw[arrow] (loop) -- node[above, desc] {Requests} (subsys);
    \draw[arrow] (subsys) --
        node[anchor = west, rotate = 90, align = left, desc]
            {read\\write\\\ \ \vdots} (file);
\end{tikzpicture}