Lines Matching refs:file
36 #include "file-item.h"
38 #include "file.h"
188 * that would be a good hint to the block allocator for this file.
313 * delete it, otherwise we would insert a new file extent item
314 * with the same key (offset) as that 0 bytes length file
1131 struct file *file = iocb->ki_filp;
1132 struct inode *inode = file_inode(file);
1149 ret = file_remove_privs(file);
1178 struct file *file = iocb->ki_filp;
1180 struct inode *inode = file_inode(file);
1455 struct file *file = iocb->ki_filp;
1456 struct inode *inode = file_inode(file);
1505 * Re-check since file size may have changed just before taking the
1521 * The iov_iter can be mapped to the same file range we are writing to.
1531 * memory mapped to the same file range, since the iomap DIO code always
1532 * invalidates pages in the target file range (after starting and waiting
1566 * Also, in case the iov refers to pages in the file range of the
1567 * file we want to write to (due to a mmap), we could enter an
1621 invalidate_mapping_pages(file->f_mapping, pos >> PAGE_SHIFT,
1630 struct file *file = iocb->ki_filp;
1631 struct inode *inode = file_inode(file);
1661 struct file *file = iocb->ki_filp;
1662 struct btrfs_inode *inode = BTRFS_I(file_inode(file));
1667 * have opened a file as writable, we have to stop this write operation
1703 int btrfs_release_file(struct inode *inode, struct file *filp)
1715 * Set by setattr when we are about to truncate a file from a non-zero
1718 * a file in place.
1779 int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
1781 struct dentry *dentry = file_dentry(file);
1791 trace_btrfs_sync_file(file, datasync);
1797 * several problems, from missing file extent items to represent holes
1833 * Therefore after the log replay we will have a file extent item
1905 ret = filemap_check_wb_err(inode->i_mapping, file->f_wb_err);
1935 * version of the file in the log. It is possible that
1936 * someone will come in and modify the file, but that's
1938 * have references to all of the file's extents
1941 * file again, but that will end up using the synchronization
2005 err = file_check_and_advance_wb_err(file);
2022 static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma)
2322 * the file range with an extent.
2428 * file extent is inserted here.
2466 * transaction we used to replace/drop file extent items. So
2471 * file extent items we need.
2514 * NO_HOLES is enabled) file extent items and did not setup new extent
2527 * ends at (or beyond) lockend. Since we have no file extent items to
2538 * Don't insert file hole extent item if it's for a range beyond eof
2586 static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len)
2588 struct inode *inode = file_inode(file);
2621 ret = file_modified(file);
2630 * We needn't truncate any block which is beyond the end of the file
3022 static long btrfs_fallocate(struct file *file, int mode,
3025 struct inode *inode = file_inode(file);
3059 return btrfs_punch_hole(file, offset, len);
3069 ret = file_modified(file);
3087 * If we are fallocating from the end of the file onward we
3099 * locking the file range, flush all dealloc in the range and wait for
3101 * the file range and, due to the previous locking we did, we know there
3201 * size of the file so we need to update i_size and the inode item.
3273 * 1) When delalloc is flushed, the file range is locked, we clear the
3277 * and inserts the new file extent item in the subvolume's btree;
3454 static loff_t find_desired_extent(struct file *file, loff_t offset, int whence)
3456 struct btrfs_inode *inode = BTRFS_I(file->f_mapping->host);
3457 struct btrfs_file_private *private = file->private_data;
3490 * lseek SEEK_HOLE/DATA calls to a file when there's delalloc,
3493 file->private_data = private;
3503 * the very start of the file.
3645 * Else, we are seeking for a hole, check the next file
3682 static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
3684 struct inode *inode = file->f_mapping->host;
3688 return generic_file_llseek(file, offset, whence);
3692 offset = find_desired_extent(file, offset, whence);
3700 return vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
3703 static int btrfs_file_open(struct inode *inode, struct file *filp)