Skip to content

Commit

Permalink
fs/vfs: skip uio logic if only one iovcnt in slot
Browse files Browse the repository at this point in the history
to improve the performance

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Jan 22, 2025
1 parent 98f9218 commit a30f976
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/vfs/fs_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ ssize_t file_readv(FAR struct file *filep,

else if (inode != NULL && inode->u.i_ops)
{
if (inode->u.i_ops->readv)
if (iovcnt > 1 && inode->u.i_ops->readv)
{
struct uio uio;

Expand Down
2 changes: 1 addition & 1 deletion fs/vfs/fs_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ ssize_t file_writev(FAR struct file *filep,
inode = filep->f_inode;
if (inode != NULL && inode->u.i_ops)
{
if (inode->u.i_ops->writev)
if (iovcnt > 1 && inode->u.i_ops->writev)
{
struct uio uio;

Expand Down

0 comments on commit a30f976

Please sign in to comment.