mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
lxc_fuse: Prefer fuse_file_info::direct_io over mount option
When mounting a FUSE it is possible to bypass kernel cache by specifying -odirect_io mount option. This is what we currently do. However, FUSEv3 has a different approach - the open callback (lxcProcOpen() in our case) can set direct_io member of fuse_file_info struct. This results in the same behaviour, but also works with both FUSEv1 and FUSEv3. The latter does not have the mount option and uses per file approach. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
030faee28d
commit
3f2454ca0c
@ -117,6 +117,7 @@ lxcProcOpen(const char *path,
|
||||
if ((fi->flags & O_ACCMODE) != O_RDONLY)
|
||||
return -EACCES;
|
||||
|
||||
fi->direct_io = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -329,7 +330,6 @@ lxcSetupFuse(struct virLXCFuse **f,
|
||||
|
||||
/* process name is libvirt_lxc */
|
||||
if (fuse_opt_add_arg(&args, "libvirt_lxc") == -1 ||
|
||||
fuse_opt_add_arg(&args, "-odirect_io") == -1 ||
|
||||
fuse_opt_add_arg(&args, "-oallow_other") == -1 ||
|
||||
fuse_opt_add_arg(&args, "-ofsname=libvirt") == -1)
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user