Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file_table.c Create Date:2022-07-28 20:01:52
Last Modify:2020-03-18 10:20:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_file - allocate and initialize a 'struct file'*@path: the (dentry, vfsmount) pair for the new file*@flags: O_... flags with which the new file will be opened*@fop: the 'struct file_operations' for the new file

Proto:static struct file *alloc_file(const struct path *path, int flags, const struct file_operations *fop)

Type:struct file

Parameter:

TypeParameterName
const struct path *path
intflags
const struct file_operations *fop
193  file = Find an unused file structure and return a pointer to it
194  If IS_ERR(file) Then Return file
197  f_path = path
198  cached value = Where the name belongs to - NULL is * negative
199  f_mapping = i_mapping
200  f_wb_err = lemap_sample_wb_err - sample the current errseq_t to test for later errors*@mapping: mapping to be sampled* Writeback errors are always reported relative to a particular sample point* in the past. This function provides those sample points.
201  If f_mode & le is open for reading && Value is more likely to compile time(read || read_iter) Then f_mode |= Has read method(s)
204  If f_mode & le is open for writing && Value is more likely to compile time(write || write_iter) Then f_mode |= Has write method(s)
207  f_mode |= FMODE_OPENED
208  f_op = fop
209  If (f_mode & (le is open for reading | le is open for writing )) == le is open for reading Then i_readcount_inc( Where the name belongs to - NULL is * negative )
211  Return file
Caller
NameDescribe
alloc_file_pseudo
alloc_file_clone