From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org, fuse-devel@lists.sourceforge.net,
miklos@szeredi.hu, akpm@linux-foundation.org, npiggin@suse.de
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 3/6] FUSE: don't let fuse_req->end() put the base reference
Date: Thu, 20 Nov 2008 23:52:17 +0900 [thread overview]
Message-ID: <1227192740-10532-4-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1227192740-10532-1-git-send-email-tj@kernel.org>
fuse_req->end() was supposed to be put the base reference but there's
no reason why it should. It only makes things more complex. Move it
out of ->end() and make it the responsibility of request_end().
Signed-off-by: Tejun Heo <tj@kernel.org>
---
fs/fuse/dev.c | 5 +----
fs/fuse/file.c | 4 +---
fs/fuse/inode.c | 1 -
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index b8f70a0..25a134a 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -296,8 +296,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
wake_up(&req->waitq);
if (end)
end(fc, req);
- else
- fuse_put_request(fc, req);
+ fuse_put_request(fc, req);
}
static void wait_answer_interruptible(struct fuse_conn *fc,
@@ -1052,8 +1051,6 @@ static void end_io_requests(struct fuse_conn *fc)
wake_up(&req->waitq);
if (end) {
req->end = NULL;
- /* The end function will consume this reference */
- __fuse_get_request(req);
spin_unlock(&fc->lock);
wait_event(req->waitq, !req->locked);
end(fc, req);
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 4d535ae..128356b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -85,7 +85,6 @@ static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
{
dput(req->misc.release.dentry);
mntput(req->misc.release.vfsmount);
- fuse_put_request(fc, req);
}
static void fuse_file_put(struct fuse_file *ff)
@@ -506,7 +505,6 @@ static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req)
}
if (req->ff)
fuse_file_put(req->ff);
- fuse_put_request(fc, req);
}
static void fuse_send_readpages(struct fuse_req *req, struct file *file,
@@ -1056,7 +1054,6 @@ static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req)
{
__free_page(req->pages[0]);
fuse_file_put(req->ff);
- fuse_put_request(fc, req);
}
static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
@@ -1100,6 +1097,7 @@ static void fuse_send_writepage(struct fuse_conn *fc, struct fuse_req *req)
fuse_writepage_finish(fc, req);
spin_unlock(&fc->lock);
fuse_writepage_free(fc, req);
+ fuse_put_request(fc, req);
spin_lock(&fc->lock);
}
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index eae4ff9..75f0770 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -781,7 +781,6 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
fc->max_write = max_t(unsigned, 4096, fc->max_write);
fc->conn_init = 1;
}
- fuse_put_request(fc, req);
fc->blocked = 0;
wake_up_all(&fc->blocked_waitq);
}
--
1.5.6
next prev parent reply other threads:[~2008-11-20 15:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-20 14:52 [PATCHSET] FUSE: implement direct mmap Tejun Heo
2008-11-20 14:52 ` [PATCH 1/6] mmap: don't assume f_op->mmap() doesn't change vma->vm_file Tejun Heo
2008-11-20 14:52 ` [PATCH 2/6] fdtable: export alloc_fd() Tejun Heo
2008-11-20 14:52 ` Tejun Heo [this message]
2008-11-20 14:52 ` [PATCH 4/6] FUSE: make request_wait_answer() wait for ->end() completion Tejun Heo
2008-11-20 14:52 ` [PATCH 5/6] FUSE: implement fuse_req->prep() Tejun Heo
2008-11-20 14:52 ` [PATCH 6/6] FUSE: implement direct mmap Tejun Heo
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=1227192740-10532-4-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=npiggin@suse.de \
/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