Lines Matching full:we

62 		 * We're concerned with the entire range that we're going to be  in lock_extent_direct()
63 * doing DIO to, so we need to make sure there's no ordered in lock_extent_direct()
70 * We need to make sure there are no buffered pages in this in lock_extent_direct()
71 * range either, we could have raced between the invalidate in in lock_extent_direct()
90 * If we are doing a DIO read and the ordered extent we in lock_extent_direct()
91 * found is for a buffered write, we can not wait for it in lock_extent_direct()
92 * to complete and retry, because if we do so we can in lock_extent_direct()
99 * range and this range started (we unlock the ranges in lock_extent_direct()
112 * We could trigger writeback for this range (and wait in lock_extent_direct()
118 * ordered dio extent we created before but did not have in lock_extent_direct()
233 * We don't allocate a new extent in the following cases in btrfs_get_blocks_direct_write()
235 * 1) The inode is marked as NODATACOW. In this case we'll just use the in btrfs_get_blocks_direct_write()
237 * 2) The extent is marked as PREALLOC. We're good to go here and can in btrfs_get_blocks_direct_write()
263 /* We can NOCOW, so only need to reserve metadata space. */ in btrfs_get_blocks_direct_write()
303 * If we could not allocate data space before locking the file in btrfs_get_blocks_direct_write()
304 * range and we can't do a NOCOW write, then we have to fail. in btrfs_get_blocks_direct_write()
312 * We have to COW and we have already reserved data space before, in btrfs_get_blocks_direct_write()
313 * so now we reserve only metadata. in btrfs_get_blocks_direct_write()
334 * We have created our ordered extent, so we can now release our reservation in btrfs_get_blocks_direct_write()
341 * readers will get the updated i_size when we unlock. in btrfs_get_blocks_direct_write()
371 * We could potentially fault if we have a buffer > PAGE_SIZE, and if in btrfs_dio_iomap_begin()
372 * we're NOWAIT we may submit a bio for a partial range and return in btrfs_dio_iomap_begin()
376 * of iocb's, so we could submit the partial bio, return and fault in in btrfs_dio_iomap_begin()
378 * range. However we don't have that currently, so simply return in btrfs_dio_iomap_begin()
385 * Cap the size of reads to that usually seen in buffered I/O as we need in btrfs_dio_iomap_begin()
396 * enough if we've written compressed pages to this area, so we need to in btrfs_dio_iomap_begin()
400 * time the second flush returns we know bios for the compressed pages in btrfs_dio_iomap_begin()
403 * If we have a NOWAIT request and we have any pages in the range that in btrfs_dio_iomap_begin()
404 * are locked, likely due to compression still in progress, we don't want in btrfs_dio_iomap_begin()
405 * to block on page locks. We also don't want to block on pages marked as in btrfs_dio_iomap_begin()
407 * iomap_dio_rw() did the same check, but after that and before we got in btrfs_dio_iomap_begin()
409 * (readpage() and readahead(), which lock pages), as we haven't locked in btrfs_dio_iomap_begin()
429 * We always try to allocate data space and must do it before locking in btrfs_dio_iomap_begin()
432 * current i_size (the inode lock is taken in shared mode). If we fail to in btrfs_dio_iomap_begin()
433 * allocate data space here we continue and later, after locking the in btrfs_dio_iomap_begin()
434 * file range, we fail with ENOSPC only if we figure out we can not do a in btrfs_dio_iomap_begin()
449 * If this errors out it's because we couldn't invalidate pagecache for in btrfs_dio_iomap_begin()
450 * this range and we need to fallback to buffered IO, or we are doing a in btrfs_dio_iomap_begin()
451 * NOWAIT read/write and we need to block. in btrfs_dio_iomap_begin()
464 * Ok for INLINE and COMPRESSED extents we need to fallback on buffered in btrfs_dio_iomap_begin()
465 * io. INLINE is special, and we could probably kludge it in here, but in btrfs_dio_iomap_begin()
469 * For COMPRESSED we _have_ to read the entire extent in so we can in btrfs_dio_iomap_begin()
470 * decompress it, so there will be buffering required no matter what we in btrfs_dio_iomap_begin()
473 * We return -ENOTBLK because that's what makes DIO go ahead and go back in btrfs_dio_iomap_begin()
474 * to buffered IO. Don't blame me, this is the price we pay for using in btrfs_dio_iomap_begin()
480 * If we are in a NOWAIT context, return -EAGAIN in order to in btrfs_dio_iomap_begin()
481 * fallback to buffered IO. This is not only because we can in btrfs_dio_iomap_begin()
484 * space - this happens if we were able to read some data from in btrfs_dio_iomap_begin()
485 * previous non-compressed extents and then when we fallback to in btrfs_dio_iomap_begin()
487 * filemap_read(), we fail to fault in pages for the read buffer, in btrfs_dio_iomap_begin()
498 * If we have a NOWAIT request and the range contains multiple extents in btrfs_dio_iomap_begin()
499 * (or a mix of extents and holes), then we return -EAGAIN to make the in btrfs_dio_iomap_begin()
501 * NOWAIT) request. This way we avoid doing partial IO and returning in btrfs_dio_iomap_begin()
505 * When doing a read, because we use IOMAP_DIO_PARTIAL when calling in btrfs_dio_iomap_begin()
506 * iomap_dio_rw(), we can end up returning less data then what the caller in btrfs_dio_iomap_begin()
508 * That is, the caller asked to read N bytes and we return less than that, in btrfs_dio_iomap_begin()
509 * which is wrong unless we are crossing EOF. This happens if we get a in btrfs_dio_iomap_begin()
511 * associated to the struct iov_iter passed to iomap_dio_rw(), and we in btrfs_dio_iomap_begin()
514 * those bios have completed by the time we get the page fault error, in btrfs_dio_iomap_begin()
515 * which we return back to our caller - we should only return EIOCBQUEUED in btrfs_dio_iomap_begin()
516 * after we have submitted bios for all the extents in the range. in btrfs_dio_iomap_begin()
553 * We trim the extents (and move the addr) even though iomap code does in btrfs_dio_iomap_begin()
554 * that, since we have locked only the parts we are performing I/O in. in btrfs_dio_iomap_begin()
571 * writes only hold it for this part. We hold the extent lock until in btrfs_dio_iomap_begin()
572 * we're completely done with the extent map to make sure it remains in btrfs_dio_iomap_begin()
581 /* We didn't use everything, unlock the dio extent for the remainder. */ in btrfs_dio_iomap_begin()
590 * Don't use EXTENT_LOCK_BITS here in case we extend it later and forget in btrfs_dio_iomap_begin()
591 * to update this, be explicit that we expect EXTENT_LOCKED and in btrfs_dio_iomap_begin()
592 * EXTENT_DIO_LOCKED to be set here, and so that's what we're clearing. in btrfs_dio_iomap_begin()
691 * Don't split the extent_map for NOCOW extents, as we're writing into in btrfs_extract_ordered_extent()
728 * Check if we are doing a partial write. If we are, we need to split in btrfs_dio_submit_io()
861 * The iov_iter can be mapped to the same file range we are writing to. in btrfs_direct_write()
862 * If that's the case, then we will deadlock in the iomap code, because in btrfs_direct_write()
865 * iov_iter refers to. During the fault in we end up in the readahead in btrfs_direct_write()
869 * obviously the ordered extent can never complete as we didn't submit in btrfs_direct_write()
875 * So here we disable page faults in the iov_iter and then retry if we in btrfs_direct_write()
887 * If we have a synchronous write, we must make sure the fsync in btrfs_direct_write()
889 * deadlock on the inode lock - we are already holding it and we in btrfs_direct_write()
890 * can't call it after unlocking because we may need to complete in btrfs_direct_write()
907 * We have more data left to write. Try to fault in as many as in btrfs_direct_write()
908 * possible of the remainder pages and retry. We do this without in btrfs_direct_write()
913 * file we want to write to (due to a mmap), we could enter an in btrfs_direct_write()
914 * infinite loop if we retry after faulting the pages in, since in btrfs_direct_write()
916 * it tries to fault in the pages of the iov. So we keep track of in btrfs_direct_write()
918 * to buffered IO in case we haven't made any progress. in btrfs_direct_write()
932 * If 'ret' is -ENOTBLK or we have not written all data, then it means in btrfs_direct_write()
933 * we must fallback to buffered IO. in btrfs_direct_write()
940 * If we are in a NOWAIT context, then return -EAGAIN to signal the caller in btrfs_direct_write()
942 * because even if we end up not blocking during the buffered IO attempt in btrfs_direct_write()
943 * below, we will block when flushing and waiting for the IO. in btrfs_direct_write()
957 * Ensure all data is persisted. We want the next direct IO read to be in btrfs_direct_write()
1016 * This is similar to what we do for direct IO writes, see the comment in btrfs_direct_read()
1017 * at btrfs_direct_write(), but we also disable page faults in addition in btrfs_direct_read()
1023 * The difference to direct IO writes is that we deadlock when trying in btrfs_direct_read()
1045 * We didn't make any progress since the last attempt, in btrfs_direct_read()
1053 * We made some progress since the last retry or this is in btrfs_direct_read()
1054 * the first time we are retrying. Fault in as many pages in btrfs_direct_read()