summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-io-pagecache.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-09-10 17:29:39 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-07-14 19:00:16 -0400
commit7554a8bb6ddeeca87fa8abd1d9766111477a6643 (patch)
tree289b73e37804d7d5ba45b338d774ae18f6d7558d /fs/bcachefs/fs-io-pagecache.h
parent95924420b038a0d025c4d16c75be2a858e7c09df (diff)
downloadlwn-7554a8bb6ddeeca87fa8abd1d9766111477a6643.tar.gz
lwn-7554a8bb6ddeeca87fa8abd1d9766111477a6643.zip
bcachefs: Ensure buffered writes write as much as they can
This adds a new helper, bch2_folio_reservation_get_partial(), which reserves as many blocks as possible and may return partial success. __bch2_buffered_write() is switched to the new helper - this fixes fstests generic/275, the write until -ENOSPC test. generic/230 now fails: this appears to be a test bug, where xfs_io isn't looping after a partial write to get the error code. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-io-pagecache.h')
-rw-r--r--fs/bcachefs/fs-io-pagecache.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/fs-io-pagecache.h b/fs/bcachefs/fs-io-pagecache.h
index 828c3d7c8f19..fd7d692c087e 100644
--- a/fs/bcachefs/fs-io-pagecache.h
+++ b/fs/bcachefs/fs-io-pagecache.h
@@ -153,7 +153,12 @@ int bch2_folio_reservation_get(struct bch_fs *,
struct bch_inode_info *,
struct folio *,
struct bch2_folio_reservation *,
- unsigned, unsigned);
+ size_t, size_t);
+ssize_t bch2_folio_reservation_get_partial(struct bch_fs *,
+ struct bch_inode_info *,
+ struct folio *,
+ struct bch2_folio_reservation *,
+ size_t, size_t);
void bch2_set_folio_dirty(struct bch_fs *,
struct bch_inode_info *,