File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -715,6 +715,27 @@ 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_VOLUME_CORRUPTED The file system structures are corrupted.
728+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
729+ @retval EFI_ACCESS_DENIED The file was opened read only.
730+ @retval EFI_VOLUME_FULL The volume is full.
731+
732+ **/
733+ EFI_STATUS
734+ EFIAPI
735+ Ext4Flush (
736+ IN EFI_FILE_PROTOCOL * This
737+ );
738+
718739/**
719740 Returns a file's current position.
720741
Original file line number Diff line number Diff line change @@ -555,6 +555,37 @@ Ext4WriteFile (
555555 return EFI_WRITE_PROTECTED ;
556556}
557557
558+ /**
559+ Flushes all modified data associated with a file to a device
560+
561+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the file
562+ handle to flush data.
563+
564+ @retval EFI_SUCCESS The data was flushed.
565+ @retval EFI_NO_MEDIA The device has no medium.
566+ @retval EFI_DEVICE_ERROR The device reported an error.
567+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
568+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
569+ @retval EFI_ACCESS_DENIED The file was opened read only.
570+ @retval EFI_VOLUME_FULL The volume is full.
571+
572+ **/
573+ EFI_STATUS
574+ EFIAPI
575+ Ext4Flush (
576+ IN EFI_FILE_PROTOCOL * This
577+ )
578+ {
579+ EXT4_FILE * File ;
580+
581+ File = EXT4_FILE_FROM_THIS (This );
582+ if (!(File -> OpenMode & EFI_FILE_MODE_WRITE )) {
583+ return EFI_ACCESS_DENIED ;
584+ }
585+
586+ return EFI_WRITE_PROTECTED ;
587+ }
588+
558589/**
559590 Returns a file's current position.
560591
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