Lines Matching full:file

9  * kernel_read_file() - read file contents into a kernel buffer
11 * @file: file to read from
18 * @file_size: if non-NULL, the full size of @file will be
21 * file contents being read (for LSMs to examine)
24 * (i.e. the caller must be expecting to read partial file contents
26 * will be able to determine when the entire file was read by
28 * file, though, since it is possible that the contents might
35 ssize_t kernel_read_file(struct file *file, loff_t offset, void **buf, in kernel_read_file() argument
48 if (!S_ISREG(file_inode(file)->i_mode)) in kernel_read_file()
51 ret = deny_write_access(file); in kernel_read_file()
55 i_size = i_size_read(file_inode(file)); in kernel_read_file()
60 /* The file is too big for sane activities. */ in kernel_read_file()
65 /* The entire file cannot be read in one buffer. */ in kernel_read_file()
72 ret = security_kernel_read_file(file, id, whole_file); in kernel_read_file()
93 bytes = kernel_read(file, *buf + copied, wanted, &pos); in kernel_read_file()
110 ret = security_kernel_post_read_file(file, *buf, i_size, id); in kernel_read_file()
122 allow_write_access(file); in kernel_read_file()
131 struct file *file; in kernel_read_file_from_path() local
137 file = filp_open(path, O_RDONLY, 0); in kernel_read_file_from_path()
138 if (IS_ERR(file)) in kernel_read_file_from_path()
139 return PTR_ERR(file); in kernel_read_file_from_path()
141 ret = kernel_read_file(file, offset, buf, buf_size, file_size, id); in kernel_read_file_from_path()
142 fput(file); in kernel_read_file_from_path()
152 struct file *file; in kernel_read_file_from_path_initns() local
163 file = file_open_root(&root, path, O_RDONLY, 0); in kernel_read_file_from_path_initns()
165 if (IS_ERR(file)) in kernel_read_file_from_path_initns()
166 return PTR_ERR(file); in kernel_read_file_from_path_initns()
168 ret = kernel_read_file(file, offset, buf, buf_size, file_size, id); in kernel_read_file_from_path_initns()
169 fput(file); in kernel_read_file_from_path_initns()