Skip to content

Commit 4316b4c

Browse files
Add footnote on file_operations API changes
The main text's 'struct file_operations' example is intentionally kept at the v5.4 LTS version to ensure compatibility with the guide's code. To bridge the gap with modern kernels, a new footnote is introduced. It summarizes the evolution of the struct up to Linux v6.12, documenting key additions, removals, and modifications to its members. This provides crucial context for readers working with newer kernel versions. Co-authored-by: EricccTaiwan <[email protected]>
1 parent 0337d8d commit 4316b4c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lkmpg.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,18 @@ \subsection{The file\_operations Structure}
954954
Some operations are not implemented by a driver.
955955
For example, a driver that handles a video card will not need to read from a directory structure.
956956
The corresponding entries in the \cpp|file_operations| structure should be set to \cpp|NULL|.
957+
\footnote{
958+
As of Linux kernel 6.12, several member fields have been added or removed, or had their prototypes changed:
959+
\begin{itemize}
960+
\item Added: \texttt{fop\_flags}, \texttt{splice\_eof}, \texttt{uring\_cmd}, \texttt{uring\_cmd\_iopoll}, \texttt{mmap\_capabilities}
961+
\item Removed: \texttt{iterate}, \texttt{sendpage}, \texttt{mmap\_supported\_flags} (!CONFIG\_MMU)
962+
\item Modified:
963+
\begin{itemize}
964+
\item \texttt{iopoll} now takes \texttt{struct io\_comp\_batch *} and \texttt{unsigned int flag}
965+
\item \texttt{setlease} now uses \texttt{struct file\_lease **} and \texttt{int} instead of \texttt{long}
966+
\end{itemize}
967+
\end{itemize}
968+
}
957969

958970
There is a gcc extension that makes assigning to this structure more convenient.
959971
You will see it in modern drivers, and may catch you by surprise.

0 commit comments

Comments
 (0)