9pfs: Don't use file descriptors in core code
v9fs_getattr() currently peeks into V9fsFidOpenState to know if a fid has a valid file descriptor or directory stream. Even though the fields are accessible, this is an implementation detail of the local backend that should not be manipulated directly by the server code. Abstract that with a new has_valid_file_handle() backend operation. Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <20250312152933.383967-3-groug@kaod.org> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
This commit is contained in:
parent
4f82ce8cd9
commit
f2bb367d2b
4 changed files with 21 additions and 3 deletions
|
|
@ -164,6 +164,7 @@ struct FileOperations {
|
|||
int (*renameat)(FsContext *ctx, V9fsPath *olddir, const char *old_name,
|
||||
V9fsPath *newdir, const char *new_name);
|
||||
int (*unlinkat)(FsContext *ctx, V9fsPath *dir, const char *name, int flags);
|
||||
bool (*has_valid_file_handle)(int fid_type, V9fsFidOpenState *fs);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue