diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2019-09-10 09:04:08 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-09-10 10:29:48 -0400 |
commit | c500ebaa908dbf6b3c562778a25d7e945b04f40f (patch) | |
tree | e433ccd73444293158058a954f6665a17e7e2a83 /fs/fuse/dev.c | |
parent | 40ac7ab2d02176f8a70e37b88e41637ed97b304b (diff) |
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.c | 13 |
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); | |||
255 | * filesystem should not have it's own file open. If deadlock is | 255 | * filesystem should not have it's own file open. If deadlock is |
256 | * intentional, it can still be broken by "aborting" the filesystem. | 256 | * intentional, it can still be broken by "aborting" the filesystem. |
257 | */ | 257 | */ |
258 | struct fuse_req *fuse_get_req_nofail_nopages(struct fuse_conn *fc) | 258 | static struct fuse_req *fuse_get_req_nofail_nopages(struct fuse_conn *fc) |
259 | { | 259 | { |
260 | struct fuse_req *req; | 260 | struct fuse_req *req; |
261 | 261 | ||
@@ -570,9 +570,14 @@ ssize_t fuse_simple_request(struct fuse_conn *fc, struct fuse_args *args) | |||
570 | struct fuse_req *req; | 570 | struct fuse_req *req; |
571 | ssize_t ret; | 571 | ssize_t ret; |
572 | 572 | ||
573 | req = fuse_get_req(fc, 0); | 573 | if (args->force) { |
574 | if (IS_ERR(req)) | 574 | req = fuse_get_req_nofail_nopages(fc); |
575 | return PTR_ERR(req); | 575 | __set_bit(FR_FORCE, &req->flags); |
576 | } else { | ||
577 | req = fuse_get_req(fc, 0); | ||
578 | if (IS_ERR(req)) | ||
579 | return PTR_ERR(req); | ||
580 | } | ||
576 | 581 | ||
577 | /* Needs to be done after fuse_get_req() so that fc->minor is valid */ | 582 | /* Needs to be done after fuse_get_req() so that fc->minor is valid */ |
578 | fuse_adjust_compat(fc, args); | 583 | fuse_adjust_compat(fc, args); |