mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 16:47:42 +00:00
fuse: optmize missing FUSE_LINK support
If filesystem doesn't support FUSE_LINK (i.e. returns -ENOSYS), then remember this and next time return immediately, without incurring the overhead of a round trip to the server. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
8344213571
commit
eef36cf6a7
@ -1123,6 +1123,9 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
|
|||||||
struct fuse_mount *fm = get_fuse_mount(inode);
|
struct fuse_mount *fm = get_fuse_mount(inode);
|
||||||
FUSE_ARGS(args);
|
FUSE_ARGS(args);
|
||||||
|
|
||||||
|
if (fm->fc->no_link)
|
||||||
|
goto out;
|
||||||
|
|
||||||
memset(&inarg, 0, sizeof(inarg));
|
memset(&inarg, 0, sizeof(inarg));
|
||||||
inarg.oldnodeid = get_node_id(inode);
|
inarg.oldnodeid = get_node_id(inode);
|
||||||
args.opcode = FUSE_LINK;
|
args.opcode = FUSE_LINK;
|
||||||
@ -1138,7 +1141,11 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
|
|||||||
fuse_invalidate_attr(inode);
|
fuse_invalidate_attr(inode);
|
||||||
|
|
||||||
if (err == -ENOSYS)
|
if (err == -ENOSYS)
|
||||||
err = -EPERM;
|
fm->fc->no_link = 1;
|
||||||
|
out:
|
||||||
|
if (fm->fc->no_link)
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,6 +870,9 @@ struct fuse_conn {
|
|||||||
/* Use pages instead of pointer for kernel I/O */
|
/* Use pages instead of pointer for kernel I/O */
|
||||||
unsigned int use_pages_for_kvec_io:1;
|
unsigned int use_pages_for_kvec_io:1;
|
||||||
|
|
||||||
|
/* Is link not implemented by fs? */
|
||||||
|
unsigned int no_link:1;
|
||||||
|
|
||||||
/* Use io_uring for communication */
|
/* Use io_uring for communication */
|
||||||
unsigned int io_uring;
|
unsigned int io_uring;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user