-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuse: introduce FUSE_PASSTHROUGH capability
FUSE_PASSTHROUGH capability to passthrough FUSE operations to backing files will be made available with kernel config CONFIG_FUSE_PASSTHROUGH. When requesting FUSE_PASSTHROUGH, userspace needs to specify the max_stack_depth that is allowed for FUSE on top of backing files. Introduce the flag FOPEN_PASSTHROUGH and backing_id to fuse_open_out argument that can be used when replying to OPEN request, to setup passthrough of io operations on the fuse inode to a backing file. Introduce a refcounted fuse_backing object that will be used to associate an open backing file with a fuse inode. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
- Loading branch information
Amir Goldstein
authored and
Miklos Szeredi
committed
Feb 23, 2024
1 parent
aed9183
commit 7dc4e97
Showing
6 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* FUSE passthrough to backing file. | ||
* | ||
* Copyright (c) 2023 CTERA Networks. | ||
*/ | ||
|
||
#include "fuse_i.h" | ||
|
||
#include <linux/file.h> | ||
|
||
struct fuse_backing *fuse_backing_get(struct fuse_backing *fb) | ||
{ | ||
if (fb && refcount_inc_not_zero(&fb->count)) | ||
return fb; | ||
return NULL; | ||
} | ||
|
||
static void fuse_backing_free(struct fuse_backing *fb) | ||
{ | ||
if (fb->file) | ||
fput(fb->file); | ||
kfree_rcu(fb, rcu); | ||
} | ||
|
||
void fuse_backing_put(struct fuse_backing *fb) | ||
{ | ||
if (fb && refcount_dec_and_test(&fb->count)) | ||
fuse_backing_free(fb); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters