9pfs: Introduce ftruncate file op
Add an ftruncate operation to the fs driver and use if when a fid has a valid file descriptor. This is required to support more cases where the client wants to do an action on an unlinked file which it still has an open file decriptor for. Only 9P2000.L was considered. Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <20250312152933.383967-4-groug@kaod.org> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
This commit is contained in:
parent
f2bb367d2b
commit
0c798dd523
6 changed files with 44 additions and 1 deletions
|
|
@ -152,6 +152,8 @@ struct FileOperations {
|
|||
int (*fstat)(FsContext *, int, V9fsFidOpenState *, struct stat *);
|
||||
int (*rename)(FsContext *, const char *, const char *);
|
||||
int (*truncate)(FsContext *, V9fsPath *, off_t);
|
||||
int (*ftruncate)(FsContext *ctx, int fid_type, V9fsFidOpenState *fs,
|
||||
off_t size);
|
||||
int (*fsync)(FsContext *, int, V9fsFidOpenState *, int);
|
||||
int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
|
||||
ssize_t (*lgetxattr)(FsContext *, V9fsPath *,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue