anchao commented on PR #15603:
URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601667654

   
   > > OK, my opinion has not changed, “uio could be skipped when reading and 
writing a single vector buffer“, could we reach a consensus on this option?
   > 
   > i agree it's possible. however, i don't agree it's a good trade-off. IMO, 
unified api matters more than a small overhead.
   > 
   > btw, do you have any plans on how preadv/pread would look like with your 
approach? (asking because i planned to have a file offset in uio)
   
   we can refer to Linux, but the difference from Linux is that in the single 
vector buffer scenario, we do not use iov_iter(uio):
   
   ```
   pread64
   |
    ->ksys_pread64
      |
       ->vfs_read
         |
          ->file->f_op->read          /* normal read first */
          ->file->f_op->read_iter
          
   preadv
   |
    ->do_preadv
      |
       ->vfs_readv
         |
         |->do_iter_readv_writev      /* uio iov_iter first */
         |  |
         |   -> filp->f_op->read_iter
         |  
          ->do_loop_readv_writev      /* normal loop read, uio is unnecessary */
            |
             ->filp->f_op->read
   ```
   https://github.com/torvalds/linux/blob/master/fs/read_write.c#L1167-L1173
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to