Lines Matching defs:file

6 #include <linux/file.h>
29 static int generic_remap_checks(struct file *file_in, loff_t pos_in,
30 struct file *file_out, loff_t pos_out,
83 /* Don't allow overlapped cloning within the same file. */
100 static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
103 struct inode *inode = file_inode(file);
115 retval = locks_mandatory_area(inode, file, pos, end,
121 return security_file_permission(file, write ? MAY_WRITE : MAY_READ);
129 * For clone we only link a partial EOF block above or at the destination file's
131 * destination file's EOF (can not link it into the middle of a file).
161 /* Read a page's worth of file data into the page cache. */
178 * the same file.
244 * mapped to the file data we're interested in. If not,
293 int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
294 struct file *file_out, loff_t pos_out,
328 /* Check that we don't violate system file offset limits. */
368 /* If can't alter the file contents, we're done. */
376 loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
377 struct file *file_out, loff_t pos_out,
386 * the same mount. Practically, they only need to be on the same file
418 loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
419 struct file *file_out, loff_t pos_out,
433 /* Check whether we are allowed to dedupe the destination file */
434 static bool allow_file_dedupe(struct file *file)
438 if (file->f_mode & FMODE_WRITE)
440 if (uid_eq(current_fsuid(), file_inode(file)->i_uid))
442 if (!inode_permission(file_inode(file), MAY_WRITE))
447 loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
448 struct file *dst_file, loff_t dst_pos,
494 int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
497 struct inode *src = file_inode(file);
505 if (!(file->f_mode & FMODE_READ))
520 if (!file->f_op->remap_file_range)
523 ret = remap_verify_area(file, off, len, false);
542 struct file *dst_file = dst_fd.file;
554 deduped = vfs_dedupe_file_range_one(file, off, dst_file,