ANDROID: fuse: Allow passthrough and not passthrough
Android uses passthrough and nonpassthrough files at the same time Change-Id: I227d82f659e53eb586494c9c09d84150b40d5227 Bug: 333497409 Test: atest android.scopedstorage.cts.general.ScopedStorageDeviceTest Signed-off-by: Daniel Rosenberg <drosen@google.com>
This commit is contained in:
+6
-1
@@ -51,11 +51,15 @@ int fuse_file_cached_io_open(struct inode *inode, struct fuse_file *ff)
|
|||||||
* Check if inode entered passthrough io mode while waiting for parallel
|
* Check if inode entered passthrough io mode while waiting for parallel
|
||||||
* dio write completion.
|
* dio write completion.
|
||||||
*/
|
*/
|
||||||
|
/* Android's use case requires opening files in both passthrough and non
|
||||||
|
* passthrough modes */
|
||||||
|
#if 0
|
||||||
if (fuse_inode_backing(fi)) {
|
if (fuse_inode_backing(fi)) {
|
||||||
clear_bit(FUSE_I_CACHE_IO_MODE, &fi->state);
|
clear_bit(FUSE_I_CACHE_IO_MODE, &fi->state);
|
||||||
spin_unlock(&fi->lock);
|
spin_unlock(&fi->lock);
|
||||||
return -ETXTBSY;
|
return -ETXTBSY;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
WARN_ON(ff->iomode == IOM_UNCACHED);
|
WARN_ON(ff->iomode == IOM_UNCACHED);
|
||||||
if (ff->iomode == IOM_NONE) {
|
if (ff->iomode == IOM_NONE) {
|
||||||
@@ -198,6 +202,7 @@ int fuse_file_io_open(struct file *file, struct inode *inode)
|
|||||||
{
|
{
|
||||||
struct fuse_file *ff = file->private_data;
|
struct fuse_file *ff = file->private_data;
|
||||||
struct fuse_inode *fi = get_fuse_inode(inode);
|
struct fuse_inode *fi = get_fuse_inode(inode);
|
||||||
|
struct fuse_conn *fc = get_fuse_conn(inode);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -212,7 +217,7 @@ int fuse_file_io_open(struct file *file, struct inode *inode)
|
|||||||
* which is already open for passthrough.
|
* which is already open for passthrough.
|
||||||
*/
|
*/
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
if (fuse_inode_backing(fi) && !(ff->open_flags & FOPEN_PASSTHROUGH))
|
if (fuse_inode_backing(fi) && !(ff->open_flags & FOPEN_PASSTHROUGH) && !fc->writeback_cache)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user