From: Maxim Patlasov <MPatlasov@parallels.com>
To: miklos@szeredi.hu
Cc: fuse-devel@lists.sourceforge.net, avati@gluster.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] fuse: cosmetic rework of fuse_send_readpages
Date: Thu, 21 Aug 2014 20:08:18 +0400 [thread overview]
Message-ID: <20140821160808.11005.97205.stgit@localhost.localdomain> (raw)
In-Reply-To: <20140821160304.11005.15166.stgit@localhost.localdomain>
The patch change arguments of fuse_send_readpages to give it access to inode
(will be used in the next patch of patch-set). The change is cosmetic,
no logic changed.
Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
---
fs/fuse/file.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 912061a..7723b3f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -827,8 +827,17 @@ static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req)
fuse_file_put(req->ff, false);
}
-static void fuse_send_readpages(struct fuse_req *req, struct file *file)
+struct fuse_fill_data {
+ struct fuse_req *req;
+ struct file *file;
+ struct inode *inode;
+ unsigned nr_pages;
+};
+
+static void fuse_send_readpages(struct fuse_fill_data *data)
{
+ struct fuse_req *req = data->req;
+ struct file *file = data->file;
struct fuse_file *ff = file->private_data;
struct fuse_conn *fc = ff->fc;
loff_t pos = page_offset(req->pages[0]);
@@ -850,13 +859,6 @@ static void fuse_send_readpages(struct fuse_req *req, struct file *file)
}
}
-struct fuse_fill_data {
- struct fuse_req *req;
- struct file *file;
- struct inode *inode;
- unsigned nr_pages;
-};
-
static int fuse_readpages_fill(void *_data, struct page *page)
{
struct fuse_fill_data *data = _data;
@@ -872,7 +874,7 @@ static int fuse_readpages_fill(void *_data, struct page *page)
req->pages[req->num_pages - 1]->index + 1 != page->index)) {
int nr_alloc = min_t(unsigned, data->nr_pages,
FUSE_MAX_PAGES_PER_REQ);
- fuse_send_readpages(req, data->file);
+ fuse_send_readpages(data);
if (fc->async_read)
req = fuse_get_req_for_background(fc, nr_alloc);
else
@@ -925,7 +927,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
if (!err) {
if (data.req->num_pages)
- fuse_send_readpages(data.req, file);
+ fuse_send_readpages(&data);
else
fuse_put_request(fc, data.req);
}
next prev parent reply other threads:[~2014-08-21 16:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 16:07 [PATCH 0/6] fuse: handle release synchronously (v3) Maxim Patlasov
2014-08-21 16:08 ` [PATCH 1/6] fuse: add FOPEN_SYNC_RELEASE flag to ff->open_flags Maxim Patlasov
2014-08-21 16:08 ` Maxim Patlasov [this message]
2014-08-21 16:08 ` [PATCH 3/6] fuse: wait for end of IO on release Maxim Patlasov
2014-08-22 14:00 ` Miklos Szeredi
2014-08-25 15:12 ` Maxim Patlasov
2014-08-26 8:42 ` [PATCH 3/6] fuse: wait for end of IO on release (v2) Maxim Patlasov
2014-08-21 16:09 ` [PATCH 4/6] fuse: enable close_wait synchronous release Maxim Patlasov
2014-08-22 14:04 ` Miklos Szeredi
2014-08-25 15:27 ` Maxim Patlasov
2014-08-21 16:09 ` [PATCH 5/6] fuse: fix synchronous case of fuse_file_put() Maxim Patlasov
2014-08-22 14:08 ` Miklos Szeredi
2014-08-25 15:58 ` Maxim Patlasov
2014-09-11 16:14 ` Maxim Patlasov
2014-09-16 8:19 ` Miklos Szeredi
2014-09-24 7:19 ` Maxim Patlasov
2014-08-21 16:09 ` [PATCH 6/6] fuse: add mount option to disable synchronous release Maxim Patlasov
2014-08-22 14:09 ` Miklos Szeredi
2014-08-22 18:10 ` [fuse-devel] " Anand Avati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140821160808.11005.97205.stgit@localhost.localdomain \
--to=mpatlasov@parallels.com \
--cc=avati@gluster.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).