This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch polish-buf
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit 6767da95cc1d05babe927b41e68b15059ae00e69
Author: Xuanwo <[email protected]>
AuthorDate: Tue Sep 12 13:24:59 2023 +0800

    Add vectored chunk support
    
    Signed-off-by: Xuanwo <[email protected]>
---
 core/src/services/fs/writer.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/src/services/fs/writer.rs b/core/src/services/fs/writer.rs
index 61361bdaf..6087b622c 100644
--- a/core/src/services/fs/writer.rs
+++ b/core/src/services/fs/writer.rs
@@ -61,7 +61,7 @@ impl oio::Write for FsWriter<tokio::fs::File> {
         let f = self.f.as_mut().expect("FsWriter must be initialized");
 
         Pin::new(f)
-            .poll_write(cx, bs.chunk())
+            .poll_write_vectored(cx, &bs.vectored_chunk())
             .map_err(parse_io_error)
     }
 
@@ -120,7 +120,8 @@ impl oio::BlockingWrite for FsWriter<std::fs::File> {
     fn write(&mut self, bs: &dyn oio::WriteBuf) -> Result<usize> {
         let f = self.f.as_mut().expect("FsWriter must be initialized");
 
-        f.write(bs.chunk()).map_err(parse_io_error)
+        f.write_vectored(&bs.vectored_chunk())
+            .map_err(parse_io_error)
     }
 
     fn close(&mut self) -> Result<()> {

Reply via email to