Lines Matching refs:file

6 #include <linux/file.h>
31 static int generic_remap_checks(struct file *file_in, loff_t pos_in,
32 struct file *file_out, loff_t pos_out,
85 /* Don't allow overlapped cloning within the same file. */
102 static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
115 ret = security_file_permission(file, mask);
119 return fsnotify_file_area_perm(file, mask, &pos, len);
127 * For clone we only link a partial EOF block above or at the destination file's
129 * destination file's EOF (can not link it into the middle of a file).
159 /* Read a page's worth of file data into the page cache. */
160 static struct folio *vfs_dedupe_get_folio(struct file *file, loff_t pos)
162 return read_mapping_folio(file->f_mapping, pos >> PAGE_SHIFT, file);
167 * are from the same file.
192 static int vfs_dedupe_file_range_compare(struct file *src, loff_t srcoff,
193 struct file *dest, loff_t dstoff,
225 * mapped to the file data we're interested in. If not,
277 __generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
278 struct file *file_out, loff_t pos_out,
313 /* Check that we don't violate system file offset limits. */
360 /* If can't alter the file contents, we're done. */
367 int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
368 struct file *file_out, loff_t pos_out,
376 loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
377 struct file *file_out, loff_t pos_out,
415 /* Check whether we are allowed to dedupe the destination file */
416 static bool may_dedupe_file(struct file *file)
418 struct mnt_idmap *idmap = file_mnt_idmap(file);
419 struct inode *inode = file_inode(file);
423 if (file->f_mode & FMODE_WRITE)
432 loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
433 struct file *dst_file, loff_t dst_pos,
492 int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
495 struct inode *src = file_inode(file);
503 if (!(file->f_mode & FMODE_READ))
518 if (!file->f_op->remap_file_range)
521 ret = remap_verify_area(file, off, len, false);
540 struct file *dst_file = dst_fd.file;
552 deduped = vfs_dedupe_file_range_one(file, off, dst_file,