diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-04-26 10:56:36 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2012-04-26 10:56:36 +0200 |
commit | 519c6040ce04474bc893774f866fd8d907b20429 (patch) | |
tree | 0e114d545be1bc2c432f6256edfc28206a835d1e /fs/fuse/file.c | |
parent | 05ba1f0823004e947748523782e9c2f07f3bff0d (diff) |
fuse: optimize fallocate on permanent failure
If userspace filesystem doesn't support fallocate, remember this and don't send
request next time.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r-- | fs/fuse/file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e3fee88831d4..bbfd571b37e1 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2185,6 +2185,9 @@ long fuse_file_fallocate(struct file *file, int mode, loff_t offset, }; int err; + if (fc->no_fallocate) + return -EOPNOTSUPP; + req = fuse_get_req(fc); if (IS_ERR(req)) return PTR_ERR(req); @@ -2196,6 +2199,10 @@ long fuse_file_fallocate(struct file *file, int mode, loff_t offset, req->in.args[0].value = &inarg; fuse_request_send(fc, req); err = req->out.h.error; + if (err == -ENOSYS) { + fc->no_fallocate = 1; + err = -EOPNOTSUPP; + } fuse_put_request(fc, req); return err; |