File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -715,6 +715,28 @@ Ext4WriteFile (
715715 IN VOID * Buffer
716716 );
717717
718+ /**
719+ Flushes all modified data associated with a file to a device
720+
721+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the file
722+ handle to flush data.
723+
724+ @retval EFI_SUCCESS The data was flushed.
725+ @retval EFI_NO_MEDIA The device has no medium.
726+ @retval EFI_DEVICE_ERROR The device reported an error.
727+ @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
728+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
729+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
730+ @retval EFI_ACCESS_DENIED The file was opened read only.
731+ @retval EFI_VOLUME_FULL The volume is full.
732+
733+ **/
734+ EFI_STATUS
735+ EFIAPI
736+ Ext4Flush (
737+ IN EFI_FILE_PROTOCOL * This
738+ );
739+
718740/**
719741 Returns a file's current position.
720742
Original file line number Diff line number Diff line change @@ -558,6 +558,37 @@ Ext4WriteFile (
558558 return EFI_WRITE_PROTECTED ;
559559}
560560
561+ /**
562+ Flushes all modified data associated with a file to a device
563+
564+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the file
565+ handle to flush data.
566+
567+ @retval EFI_SUCCESS The data was flushed.
568+ @retval EFI_NO_MEDIA The device has no medium.
569+ @retval EFI_DEVICE_ERROR The device reported an error.
570+ @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
571+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
572+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
573+ @retval EFI_ACCESS_DENIED The file was opened read only.
574+ @retval EFI_VOLUME_FULL The volume is full.
575+
576+ **/
577+ EFI_STATUS
578+ EFIAPI
579+ Ext4Flush (
580+ IN EFI_FILE_PROTOCOL * This
581+ ) {
582+ EXT4_FILE * File ;
583+
584+ File = EXT4_FILE_FROM_THIS (This );
585+ if (!(File -> OpenMode & EFI_FILE_MODE_WRITE )) {
586+ return EFI_ACCESS_DENIED ;
587+ }
588+
589+ return EFI_WRITE_PROTECTED ;
590+ }
591+
561592/**
562593 Returns a file's current position.
563594
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ Ext4SetupFile (
8989 File -> Protocol .GetPosition = Ext4GetPosition ;
9090 File -> Protocol .GetInfo = Ext4GetInfo ;
9191 File -> Protocol .SetInfo = Ext4SetInfo ;
92+ File -> Protocol .Flush = Ext4Flush ;
9293
9394 File -> Partition = Partition ;
9495}
You can’t perform that action at this time.
0 commit comments