1. open the file after return
When applications open a file, you can get an integer that is called a file handle . For each file handle of the application, there is a "struct file" corresponding kernel inside.
We use open When you open a file, the incoming flags, the MODE parameters will be recorded in the corresponding kernel struct file structure in (f_flags, using f_mode):