Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352890
b: refs/heads/master
c: d07f09f
h: refs/heads/master
v: v3
  • Loading branch information
Maxim Patlasov authored and Miklos Szeredi committed Jan 24, 2013
1 parent da52e4f commit 1197384
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8dbdf81821b5ab4c5e86e7b2bd7edb892c159c2
refs/heads/master: d07f09f509fb21482096e1975f160b694c0edf84
13 changes: 11 additions & 2 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,19 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
if (!fc->big_writes)
break;
} while (iov_iter_count(ii) && count < fc->max_write &&
req->num_pages < FUSE_MAX_PAGES_PER_REQ && offset == 0);
req->num_pages < req->max_pages && offset == 0);

return count > 0 ? count : err;
}

static inline unsigned fuse_wr_pages(loff_t pos, size_t len)
{
return min_t(unsigned,
((pos + len - 1) >> PAGE_CACHE_SHIFT) -
(pos >> PAGE_CACHE_SHIFT) + 1,
FUSE_MAX_PAGES_PER_REQ);
}

static ssize_t fuse_perform_write(struct file *file,
struct address_space *mapping,
struct iov_iter *ii, loff_t pos)
Expand All @@ -901,8 +909,9 @@ 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));

req = fuse_get_req(fc, FUSE_MAX_PAGES_PER_REQ);
req = fuse_get_req(fc, nr_pages);
if (IS_ERR(req)) {
err = PTR_ERR(req);
break;
Expand Down

0 comments on commit 1197384

Please sign in to comment.