summaryrefslogtreecommitdiffstats
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2019-09-10 15:04:08 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2019-09-10 16:29:48 +0200
commitc500ebaa908dbf6b3c562778a25d7e945b04f40f (patch)
treee433ccd73444293158058a954f6665a17e7e2a83 /fs/fuse/dev.c
parentfuse: simplify 'nofail' request (diff)
downloadlinux-c500ebaa908dbf6b3c562778a25d7e945b04f40f.tar.xz
linux-c500ebaa908dbf6b3c562778a25d7e945b04f40f.zip
fuse: convert flush to simple api
Add 'force' to fuse_args and use fuse_get_req_nofail_nopages() to allocate the request in that case. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 7833aee97565..a7be13b5d6ef 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -255,7 +255,7 @@ EXPORT_SYMBOL_GPL(fuse_get_req_for_background);
* filesystem should not have it's own file open. If deadlock is
* intentional, it can still be broken by "aborting" the filesystem.
*/
-struct fuse_req *fuse_get_req_nofail_nopages(struct fuse_conn *fc)
+static struct fuse_req *fuse_get_req_nofail_nopages(struct fuse_conn *fc)
{
struct fuse_req *req;
@@ -570,9 +570,14 @@ ssize_t fuse_simple_request(struct fuse_conn *fc, struct fuse_args *args)
struct fuse_req *req;
ssize_t ret;
- req = fuse_get_req(fc, 0);
- if (IS_ERR(req))
- return PTR_ERR(req);
+ if (args->force) {
+ req = fuse_get_req_nofail_nopages(fc);
+ __set_bit(FR_FORCE, &req->flags);
+ } else {
+ req = fuse_get_req(fc, 0);
+ if (IS_ERR(req))
+ return PTR_ERR(req);
+ }
/* Needs to be done after fuse_get_req() so that fc->minor is valid */
fuse_adjust_compat(fc, args);