X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Ffuse%2Ffile.c;h=8092f0d9fd1fa590ac87f7f0ec7a79331760acb6;hb=c54f9da1c8ceee19436430afac0798a989eb886d;hp=9ced35b006867e1445af3f9fe010906ac0684f87;hpb=c2a3b233450d5bc426c063ea2d8a74351db29ea4;p=linux-2.6-omap-h63xx.git diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9ced35b0068..8092f0d9fd1 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -804,6 +804,8 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req, if (offset == PAGE_CACHE_SIZE) offset = 0; + if (!fc->big_writes) + break; } while (iov_iter_count(ii) && count < fc->max_write && req->num_pages < FUSE_MAX_PAGES_PER_REQ && offset == 0); @@ -934,7 +936,7 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf, nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; - npages = min(max(npages, 1), FUSE_MAX_PAGES_PER_REQ); + npages = clamp(npages, 1, FUSE_MAX_PAGES_PER_REQ); down_read(¤t->mm->mmap_sem); npages = get_user_pages(current, current->mm, user_addr, npages, write, 0, req->pages, NULL);