All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fuse: Consider the ->big_writes for allocing fuse_req when do writing
@ 2013-03-27  2:02 majianpeng
  2013-05-02 15:05 ` Miklos Szeredi
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-03-27  2:02 UTC (permalink / raw)
  To: miklos; +Cc: fuse-devel, linux-kernel

If fc->big_writes == 0, for write-operation it only do 4k in func fuse_fill_write_pages.
So when alloc fuse_req,we should consider this restrict in order to
do additional operations.
The additional operations are memset-opeartion in func fuse_requenst_alloc and alloc more space if nr_pages is larger than FUSE_REQ_MIN_PAGES.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
fs/fuse/file.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 34b80ba..c584a31 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -912,8 +912,13 @@ static ssize_t fuse_perform_write(struct file *file,
do {
struct fuse_req *req;
ssize_t count;
- unsigned nr_pages = fuse_wr_pages(pos, iov_iter_count(ii));
+ unsigned nr_pages;

+ if (!fc->big_writes)
+ nr_pages = 1;
+ else
+ nr_pages = fuse_wr_pages(pos, iov_iter_count(ii));
+
req = fuse_get_req(fc, nr_pages);
if (IS_ERR(req)) {
err = PTR_ERR(req);
-- 
1.8.2.rc2.4.g7799588


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fuse: Consider the ->big_writes for allocing fuse_req when do writing
  2013-03-27  2:02 [PATCH] fuse: Consider the ->big_writes for allocing fuse_req when do writing majianpeng
@ 2013-05-02 15:05 ` Miklos Szeredi
  0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2013-05-02 15:05 UTC (permalink / raw)
  To: majianpeng; +Cc: fuse-devel, Kernel Mailing List

On Wed, Mar 27, 2013 at 3:02 AM, majianpeng <majianpeng@gmail.com> wrote:
> If fc->big_writes == 0, for write-operation it only do 4k in func fuse_fill_write_pages.
> So when alloc fuse_req,we should consider this restrict in order to
> do additional operations.
> The additional operations are memset-opeartion in func fuse_requenst_alloc and alloc more space if nr_pages is larger than FUSE_REQ_MIN_PAGES.

Your mailer is removing whitespace from the patch.   Anyway, I applied
it by hand, thanks.

Miklos

>
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
> fs/fuse/file.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 34b80ba..c584a31 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -912,8 +912,13 @@ static ssize_t fuse_perform_write(struct file *file,
> do {
> struct fuse_req *req;
> ssize_t count;
> - unsigned nr_pages = fuse_wr_pages(pos, iov_iter_count(ii));
> + unsigned nr_pages;
>
> + if (!fc->big_writes)
> + nr_pages = 1;
> + else
> + nr_pages = fuse_wr_pages(pos, iov_iter_count(ii));
> +
> req = fuse_get_req(fc, nr_pages);
> if (IS_ERR(req)) {
> err = PTR_ERR(req);
> --
> 1.8.2.rc2.4.g7799588
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-02 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27  2:02 [PATCH] fuse: Consider the ->big_writes for allocing fuse_req when do writing majianpeng
2013-05-02 15:05 ` Miklos Szeredi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.