\r
return EFI_SUCCESS;\r
}\r
+\r
+/**\r
+ Given an EFI_FILE_INFO object received in an EFI_FILE_PROTOCOL.SetInfo()\r
+ call, determine whether updating the size of the file is necessary, relative\r
+ to an EFI_FILE_INFO object describing the current state of the file.\r
+\r
+ @param[in] Info The EFI_FILE_INFO describing the current state of the\r
+ file. The caller is responsible for populating Info on\r
+ input with VirtioFsFuseAttrToEfiFileInfo(), from the\r
+ current FUSE attributes of the file. The Info->Size and\r
+ Info->FileName members are ignored.\r
+\r
+ @param[in] NewInfo The EFI_FILE_INFO object received in the\r
+ EFI_FILE_PROTOCOL.SetInfo() call.\r
+\r
+ @param[out] Update Set to TRUE on output if the file size needs to be\r
+ updated. Set to FALSE otherwise.\r
+\r
+ @param[out] Size If Update is set to TRUE, then Size provides the new file\r
+ size to set. Otherwise, Size is not written to.\r
+**/\r
+VOID\r
+VirtioFsGetFuseSizeUpdate (\r
+ IN EFI_FILE_INFO *Info,\r
+ IN EFI_FILE_INFO *NewInfo,\r
+ OUT BOOLEAN *Update,\r
+ OUT UINT64 *Size\r
+ )\r
+{\r
+ BOOLEAN IsDirectory;\r
+\r
+ IsDirectory = (BOOLEAN)((Info->Attribute & EFI_FILE_DIRECTORY) != 0);\r
+\r
+ if (IsDirectory || Info->FileSize == NewInfo->FileSize) {\r
+ *Update = FALSE;\r
+ return;\r
+ }\r
+ *Update = TRUE;\r
+ *Size = NewInfo->FileSize;\r
+}\r
IN OUT EFI_FILE_INFO *FileInfo\r
);\r
\r
+VOID\r
+VirtioFsGetFuseSizeUpdate (\r
+ IN EFI_FILE_INFO *Info,\r
+ IN EFI_FILE_INFO *NewInfo,\r
+ OUT BOOLEAN *Update,\r
+ OUT UINT64 *Size\r
+ );\r
+\r
//\r
// Wrapper functions for FUSE commands (primitives).\r
//\r