Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-22 Thread via GitHub
xiaoxiang781216 merged PR #15603: URL: https://github.com/apache/nuttx/pull/15603 -- 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...@nu

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2606195953 > @yamt thank you. kudo for you to deal with a stubborn person like me patiently. -- This is an automated message from the Apache Git Service. To respond to the message, please log o

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2606190664 @yamt thank you. -- 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 u

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924629788 ## fs/vfs/fs_uio.c: ## @@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio) void uio_advance(FAR struct uio *uio, size_t sz) { FAR const struct iovec

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924628918 ## fs/vfs/fs_uio.c: ## @@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio) void uio_advance(FAR struct uio *uio, size_t sz) { FAR const struct iovec *

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924626091 ## fs/vfs/fs_uio.c: ## @@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio) void uio_advance(FAR struct uio *uio, size_t sz) { FAR const struct iovec

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924624287 ## fs/vfs/fs_read.c: ## @@ -50,19 +50,14 @@ * / -static ssize_t file_readv_compat(FAR str

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924621279 ## fs/vfs/fs_uio.c: ## @@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio) void uio_advance(FAR struct uio *uio, size_t sz) { FAR const struct iovec *

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924617052 ## fs/vfs/fs_read.c: ## @@ -50,19 +50,14 @@ * / -static ssize_t file_readv_compat(FAR s

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924613830 ## fs/vfs/fs_read.c: ## @@ -74,36 +69,36 @@ static ssize_t file_readv_compat(FAR struct file *filep, FAR struct uio *uio) continue; } - buffe

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924600320 ## fs/vfs/fs_read.c: ## @@ -74,36 +69,36 @@ static ssize_t file_readv_compat(FAR struct file *filep, FAR struct uio *uio) continue; } - buffer

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924599451 ## fs/vfs/fs_uio.c: ## @@ -131,7 +131,7 @@ int uio_init(FAR struct uio *uio, FAR const struct iovec *iov, int iovcnt) resid = uio_calc_resid(uio); if (resid < 0)

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924594260 ## fs/vfs/fs_read.c: ## @@ -74,36 +69,36 @@ static ssize_t file_readv_compat(FAR struct file *filep, FAR struct uio *uio) continue; } - buffe

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924592962 ## fs/vfs/fs_read.c: ## @@ -361,5 +352,6 @@ ssize_t read(int fd, FAR void *buf, size_t nbytes) iov.iov_base = buf; iov.iov_len = nbytes; + Review Comment: do

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924592896 ## fs/vfs/fs_uio.c: ## @@ -131,7 +131,7 @@ int uio_init(FAR struct uio *uio, FAR const struct iovec *iov, int iovcnt) resid = uio_calc_resid(uio); if (resid < 0)

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924592489 ## fs/vfs/fs_uio.c: ## @@ -82,8 +82,8 @@ ssize_t uio_calc_resid(FAR const struct uio *uio) void uio_advance(FAR struct uio *uio, size_t sz) { FAR const struct iovec

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924584562 ## fs/vfs/fs_uio.c: ## @@ -131,7 +131,7 @@ int uio_init(FAR struct uio *uio, FAR const struct iovec *iov, int iovcnt) resid = uio_calc_resid(uio); if (resid < 0)

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924580628 ## fs/vfs/fs_read.c: ## @@ -50,19 +50,14 @@ * / -static ssize_t file_readv_compat(FAR str

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2606106302 > > > > i guess the main disagreement between us is on how large the overhead is. anchao seems to think it important. i feel it's negligible. none of us provided any numbers. maybe i can do

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1924580628 ## fs/vfs/fs_read.c: ## @@ -50,19 +50,14 @@ * / -static ssize_t file_readv_compat(FAR str

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604645799 @yamt please review again -- 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 comme

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1923537264 ## fs/vfs/fs_read.c: ## @@ -126,18 +113,21 @@ static ssize_t file_readv_compat(FAR struct file *filep, FAR struct uio *uio) * * Input Parameters: * filep - Fil

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1923536754 ## fs/vfs/fs_read.c: ## @@ -50,19 +50,14 @@ * / -static ssize_t file_readv_compat(FAR s

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1923535040 ## fs/vfs/fs_uio.c: ## @@ -126,12 +126,14 @@ int uio_init(FAR struct uio *uio, FAR const struct iovec *iov, int iovcnt) ssize_t resid; memset(uio, 0, sizeof(*ui

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1923468472 ## fs/vfs/fs_read.c: ## @@ -126,18 +113,21 @@ static ssize_t file_readv_compat(FAR struct file *filep, FAR struct uio *uio) * * Input Parameters: * filep - File

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604384099 > > > i guess the main disagreement between us is on how large the overhead is. anchao seems to think it important. i feel it's negligible. none of us provided any numbers. maybe i can do

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604309102 > > i guess the main disagreement between us is on how large the overhead is. anchao seems to think it important. i feel it's negligible. none of us provided any numbers. maybe i can do some

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604298860 > > > @yamt do you agree to merge this patch after discussing with @anchao ? > > > > > > not really. > > i guess the main disagreement between us is on how large the overhead is

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604258856 > i guess the main disagreement between us is on how large the overhead is. anchao seems to think it important. i feel it's negligible. none of us provided any numbers. maybe i can do

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604177996 > > @yamt do you agree to merge this patch after discussing with @anchao ? > > not really. > > i guess the main disagreement between us is on how large the overhead is. anchao

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2604001483 > @yamt do you agree to merge this patch after discussing with @anchao ? not really. i guess the main disagreement between us is on how large the overhead is. anchao seems to

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-21 Thread via GitHub
xiaoxiang781216 commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2603950728 @yamt do you agree to merge this patch after discussing with @anchao ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to Gi

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-20 Thread via GitHub
acassis commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2602386064 @anchao @yamt I think this solution is good, it avoid overhead for low end MCUs and still working for MCUs that support readv/writev -- This is an automated message from the Apache Git

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-20 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601778746 > 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. I think I may have convinced you a little? Let's go ba

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
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.

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601639703 > > > > [yamt@67c9bc6](https://github.com/yamt/incubator-nuttx/commit/67c9bc6f370eebb80a6a53d4466cd3da170dcf61) (not tested at all) > > > > > > > > > ![image](https://private-use

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601611798 > > > [yamt@67c9bc6](https://github.com/yamt/incubator-nuttx/commit/67c9bc6f370eebb80a6a53d4466cd3da170dcf61) (not tested at all) > > > > > > ![image](https://private-user-imag

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601607607 > > [yamt@67c9bc6](https://github.com/yamt/incubator-nuttx/commit/67c9bc6f370eebb80a6a53d4466cd3da170dcf61) (not tested at all) > > ![image](https://private-user-images.githubusercon

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601603343 > [yamt@67c9bc6](https://github.com/yamt/incubator-nuttx/commit/67c9bc6f370eebb80a6a53d4466cd3da170dcf61) (not tested at all) ![image](https://github.com/user-attachments/asset

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601526890 > > * is it intended to drop the EINVAL check for non-iovec cases? why? > > In the uio case, you need to accumulate the length, but non-iovec not. a single size_t value alone can

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601469267 > * is it intended to drop the EINVAL check for non-iovec cases? why? In the uio case, you need to accumulate the length, but non-iovec not. > * if you just want to save a func

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
yamt commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601455518 * is it intended to drop the EINVAL check for non-iovec cases? why? * if you just want to save a function call for uio_init, i feel it's simpler to make it a macro and inline the iovcnt ==

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601397384 @yamt we could review this PR first, just some uio logic adjustment -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
anchao commented on PR #15603: URL: https://github.com/apache/nuttx/pull/15603#issuecomment-2601242619 Point 1 to answer your question https://github.com/apache/nuttx/pull/15604#issuecomment-2601238122 -- This is an automated message from the Apache Git Service. To respond to the messag

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
anchao commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1921702377 ## fs/vfs/fs_read.c: ## @@ -50,19 +50,16 @@ * / -static ssize_t file_readv_compat(FAR s

Re: [PR] fs/vfs: initialize uio only if lower implement readv/writev [nuttx]

2025-01-19 Thread via GitHub
xiaoxiang781216 commented on code in PR #15603: URL: https://github.com/apache/nuttx/pull/15603#discussion_r1921697274 ## fs/vfs/fs_write.c: ## @@ -95,16 +93,6 @@ static ssize_t file_writev_compat(FAR struct file *filep, { return ntotal; } - Review