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 @@ -557,6 +557,37 @@ Ext4WriteFile (
557557 return EFI_WRITE_PROTECTED ;
558558}
559559
560+ /**
561+ Flushes all modified data associated with a file to a device
562+
563+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the file
564+ handle to flush data.
565+
566+ @retval EFI_SUCCESS The data was flushed.
567+ @retval EFI_NO_MEDIA The device has no medium.
568+ @retval EFI_DEVICE_ERROR The device reported an error.
569+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
570+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
571+ @retval EFI_ACCESS_DENIED The file was opened read only.
572+ @retval EFI_VOLUME_FULL The volume is full.
573+
574+ **/
575+ EFI_STATUS
576+ EFIAPI
577+ Ext4Flush (
578+ IN EFI_FILE_PROTOCOL * This
579+ )
580+ {
581+ EXT4_FILE * File ;
582+
583+ File = EXT4_FILE_FROM_THIS (This );
584+ if (!(File -> OpenMode & EFI_FILE_MODE_WRITE )) {
585+ return EFI_ACCESS_DENIED ;
586+ }
587+
588+ return EFI_WRITE_PROTECTED ;
589+ }
590+
560591/**
561592 Returns a file's current position.
562593
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