TianoCore EDK2 master
Loading...
Searching...
No Matches
FuseForget.c
Go to the documentation of this file.
1
9#include "VirtioFsDxe.h"
10
37 IN OUT VIRTIO_FS *VirtioFs,
38 IN UINT64 NodeId
39 )
40{
41 VIRTIO_FS_FUSE_REQUEST CommonReq;
43 VIRTIO_FS_IO_VECTOR ReqIoVec[2];
45 EFI_STATUS Status;
46
47 //
48 // Set up the scatter-gather list (note: only request).
49 //
50 ReqIoVec[0].Buffer = &CommonReq;
51 ReqIoVec[0].Size = sizeof CommonReq;
52 ReqIoVec[1].Buffer = &ForgetReq;
53 ReqIoVec[1].Size = sizeof ForgetReq;
54 ReqSgList.IoVec = ReqIoVec;
55 ReqSgList.NumVec = ARRAY_SIZE (ReqIoVec);
56
57 //
58 // Validate the scatter-gather list (request only); calculate the total
59 // transfer size.
60 //
61 Status = VirtioFsSgListsValidate (VirtioFs, &ReqSgList, NULL);
62 if (EFI_ERROR (Status)) {
63 return Status;
64 }
65
66 //
67 // Populate the common request header.
68 //
69 Status = VirtioFsFuseNewRequest (
70 VirtioFs,
71 &CommonReq,
72 ReqSgList.TotalSize,
73 VirtioFsFuseOpForget,
74 NodeId
75 );
76 if (EFI_ERROR (Status)) {
77 return Status;
78 }
79
80 //
81 // Populate the FUSE_FORGET-specific fields.
82 //
83 ForgetReq.NumberOfLookups = 1;
84
85 //
86 // Submit the request. There's not going to be a response.
87 //
88 Status = VirtioFsSgListsSubmit (VirtioFs, &ReqSgList, NULL);
89 return Status;
90}
EFI_STATUS VirtioFsFuseForget(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId)
Definition: FuseForget.c:36
#define NULL
Definition: Base.h:319
#define ARRAY_SIZE(Array)
Definition: Base.h:1393
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_STATUS VirtioFsFuseNewRequest(IN OUT VIRTIO_FS *VirtioFs, OUT VIRTIO_FS_FUSE_REQUEST *Request, IN UINT32 RequestSize, IN VIRTIO_FS_FUSE_OPCODE Opcode, IN UINT64 NodeId)
Definition: Helpers.c:790
EFI_STATUS VirtioFsSgListsSubmit(IN OUT VIRTIO_FS *VirtioFs, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *RequestSgList, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList OPTIONAL)
Definition: Helpers.c:538
EFI_STATUS VirtioFsSgListsValidate(IN VIRTIO_FS *VirtioFs, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *RequestSgList, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList OPTIONAL)
Definition: Helpers.c:398