mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
efi_loader: implement a file delete
'Delete' will be implemented here by calling fs_unlink() which relies on underlying file system's implementation. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
d4b751e9f3
commit
d39f6a617c
1 changed files with 13 additions and 1 deletions
|
@ -230,9 +230,21 @@ static efi_status_t EFIAPI efi_file_close(struct efi_file_handle *file)
|
|||
static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file)
|
||||
{
|
||||
struct file_handle *fh = to_fh(file);
|
||||
efi_status_t ret = EFI_SUCCESS;
|
||||
|
||||
EFI_ENTRY("%p", file);
|
||||
|
||||
if (set_blk_dev(fh)) {
|
||||
ret = EFI_DEVICE_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (fs_unlink(fh->path))
|
||||
ret = EFI_DEVICE_ERROR;
|
||||
file_close(fh);
|
||||
return EFI_EXIT(EFI_WARN_DELETE_FAILURE);
|
||||
|
||||
error:
|
||||
return EFI_EXIT(ret);
|
||||
}
|
||||
|
||||
static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size,
|
||||
|
|
Loading…
Add table
Reference in a new issue