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()
262 /* We can NOCOW, so only need to reserve metadata space. */ in btrfs_get_blocks_direct_write()
302 * If we could not allocate data space before locking the file in btrfs_get_blocks_direct_write()
303 * range and we can't do a NOCOW write, then we have to fail. in btrfs_get_blocks_direct_write()
311 * We have to COW and we have already reserved data space before, in btrfs_get_blocks_direct_write()
312 * so now we reserve only metadata. in btrfs_get_blocks_direct_write()
333 * We have created our ordered extent, so we can now release our reservation in btrfs_get_blocks_direct_write()
340 * readers will get the updated i_size when we unlock. in btrfs_get_blocks_direct_write()
370 * We could potentially fault if we have a buffer > PAGE_SIZE, and if in btrfs_dio_iomap_begin()
371 * we're NOWAIT we may submit a bio for a partial range and return in btrfs_dio_iomap_begin()
375 * of iocb's, so we could submit the partial bio, return and fault in in btrfs_dio_iomap_begin()
377 * range. However we don't have that currently, so simply return in btrfs_dio_iomap_begin()
384 * Cap the size of reads to that usually seen in buffered I/O as we need in btrfs_dio_iomap_begin()
395 * enough if we've written compressed pages to this area, so we need to in btrfs_dio_iomap_begin()
399 * time the second flush returns we know bios for the compressed pages in btrfs_dio_iomap_begin()
402 * If we have a NOWAIT request and we have any pages in the range that in btrfs_dio_iomap_begin()
403 * are locked, likely due to compression still in progress, we don't want in btrfs_dio_iomap_begin()
404 * to block on page locks. We also don't want to block on pages marked as in btrfs_dio_iomap_begin()
406 * iomap_dio_rw() did the same check, but after that and before we got in btrfs_dio_iomap_begin()
408 * (readpage() and readahead(), which lock pages), as we haven't locked in btrfs_dio_iomap_begin()
428 * We always try to allocate data space and must do it before locking in btrfs_dio_iomap_begin()
431 * current i_size (the inode lock is taken in shared mode). If we fail to in btrfs_dio_iomap_begin()
432 * allocate data space here we continue and later, after locking the in btrfs_dio_iomap_begin()
433 * file range, we fail with ENOSPC only if we figure out we can not do a in btrfs_dio_iomap_begin()
448 * If this errors out it's because we couldn't invalidate pagecache for in btrfs_dio_iomap_begin()
449 * this range and we need to fallback to buffered IO, or we are doing a in btrfs_dio_iomap_begin()
450 * NOWAIT read/write and we need to block. in btrfs_dio_iomap_begin()
463 * Ok for INLINE and COMPRESSED extents we need to fallback on buffered in btrfs_dio_iomap_begin()
464 * io. INLINE is special, and we could probably kludge it in here, but in btrfs_dio_iomap_begin()
468 * For COMPRESSED we _have_ to read the entire extent in so we can in btrfs_dio_iomap_begin()
469 * decompress it, so there will be buffering required no matter what we in btrfs_dio_iomap_begin()
472 * We return -ENOTBLK because that's what makes DIO go ahead and go back in btrfs_dio_iomap_begin()
473 * to buffered IO. Don't blame me, this is the price we pay for using in btrfs_dio_iomap_begin()
479 * If we are in a NOWAIT context, return -EAGAIN in order to in btrfs_dio_iomap_begin()
480 * fallback to buffered IO. This is not only because we can in btrfs_dio_iomap_begin()
483 * space - this happens if we were able to read some data from in btrfs_dio_iomap_begin()
484 * previous non-compressed extents and then when we fallback to in btrfs_dio_iomap_begin()
486 * filemap_read(), we fail to fault in pages for the read buffer, in btrfs_dio_iomap_begin()
497 * If we have a NOWAIT request and the range contains multiple extents in btrfs_dio_iomap_begin()
498 * (or a mix of extents and holes), then we return -EAGAIN to make the in btrfs_dio_iomap_begin()
500 * NOWAIT) request. This way we avoid doing partial IO and returning in btrfs_dio_iomap_begin()
504 * When doing a read, because we use IOMAP_DIO_PARTIAL when calling in btrfs_dio_iomap_begin()
505 * iomap_dio_rw(), we can end up returning less data then what the caller in btrfs_dio_iomap_begin()
507 * That is, the caller asked to read N bytes and we return less than that, in btrfs_dio_iomap_begin()
508 * which is wrong unless we are crossing EOF. This happens if we get a in btrfs_dio_iomap_begin()
510 * associated to the struct iov_iter passed to iomap_dio_rw(), and we in btrfs_dio_iomap_begin()
513 * those bios have completed by the time we get the page fault error, in btrfs_dio_iomap_begin()
514 * which we return back to our caller - we should only return EIOCBQUEUED in btrfs_dio_iomap_begin()
515 * after we have submitted bios for all the extents in the range. in btrfs_dio_iomap_begin()
552 * We trim the extents (and move the addr) even though iomap code does in btrfs_dio_iomap_begin()
553 * that, since we have locked only the parts we are performing I/O in. in btrfs_dio_iomap_begin()
570 * writes only hold it for this part. We hold the extent lock until in btrfs_dio_iomap_begin()
571 * we're completely done with the extent map to make sure it remains in btrfs_dio_iomap_begin()
580 /* We didn't use everything, unlock the dio extent for the remainder. */ in btrfs_dio_iomap_begin()
589 * Don't use EXTENT_LOCK_BITS here in case we extend it later and forget in btrfs_dio_iomap_begin()
590 * to update this, be explicit that we expect EXTENT_LOCKED and in btrfs_dio_iomap_begin()
591 * EXTENT_DIO_LOCKED to be set here, and so that's what we're clearing. in btrfs_dio_iomap_begin()
690 * Don't split the extent_map for NOCOW extents, as we're writing into in btrfs_extract_ordered_extent()
727 * Check if we are doing a partial write. If we are, we need to split in btrfs_dio_submit_io()
860 * The iov_iter can be mapped to the same file range we are writing to. in btrfs_direct_write()
861 * If that's the case, then we will deadlock in the iomap code, because in btrfs_direct_write()
864 * iov_iter refers to. During the fault in we end up in the readahead in btrfs_direct_write()
868 * obviously the ordered extent can never complete as we didn't submit in btrfs_direct_write()
874 * So here we disable page faults in the iov_iter and then retry if we in btrfs_direct_write()
886 * If we have a synchronous write, we must make sure the fsync in btrfs_direct_write()
888 * deadlock on the inode lock - we are already holding it and we in btrfs_direct_write()
889 * can't call it after unlocking because we may need to complete in btrfs_direct_write()
906 * We have more data left to write. Try to fault in as many as in btrfs_direct_write()
907 * possible of the remainder pages and retry. We do this without in btrfs_direct_write()
912 * file we want to write to (due to a mmap), we could enter an in btrfs_direct_write()
913 * infinite loop if we retry after faulting the pages in, since in btrfs_direct_write()
915 * it tries to fault in the pages of the iov. So we keep track of in btrfs_direct_write()
917 * to buffered IO in case we haven't made any progress. in btrfs_direct_write()
931 * If 'ret' is -ENOTBLK or we have not written all data, then it means in btrfs_direct_write()
932 * we must fallback to buffered IO. in btrfs_direct_write()
939 * If we are in a NOWAIT context, then return -EAGAIN to signal the caller in btrfs_direct_write()
941 * because even if we end up not blocking during the buffered IO attempt in btrfs_direct_write()
942 * below, we will block when flushing and waiting for the IO. in btrfs_direct_write()
956 * Ensure all data is persisted. We want the next direct IO read to be in btrfs_direct_write()
1015 * This is similar to what we do for direct IO writes, see the comment in btrfs_direct_read()
1016 * at btrfs_direct_write(), but we also disable page faults in addition in btrfs_direct_read()
1022 * The difference to direct IO writes is that we deadlock when trying in btrfs_direct_read()
1044 * We didn't make any progress since the last attempt, in btrfs_direct_read()
1052 * We made some progress since the last retry or this is in btrfs_direct_read()
1053 * the first time we are retrying. Fault in as many pages in btrfs_direct_read()