return NULL;
}
-static efi_status_t efi_file_open_int(struct efi_file_handle *this,
- struct efi_file_handle **new_handle,
- u16 *file_name, u64 open_mode,
- u64 attributes)
+efi_status_t efi_file_open_int(struct efi_file_handle *this,
+ struct efi_file_handle **new_handle,
+ u16 *file_name, u64 open_mode,
+ u64 attributes)
{
struct file_handle *fh = to_fh(this);
efi_status_t ret;
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI efi_file_close(struct efi_file_handle *file)
+efi_status_t efi_file_close_int(struct efi_file_handle *file)
{
struct file_handle *fh = to_fh(file);
+
+ return file_close(fh);
+}
+
+static efi_status_t EFIAPI efi_file_close(struct efi_file_handle *file)
+{
EFI_ENTRY("%p", file);
- return EFI_EXIT(file_close(fh));
+ return EFI_EXIT(efi_file_close_int(file));
}
static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file)
return EFI_SUCCESS;
}
-static efi_status_t efi_file_read_int(struct efi_file_handle *this,
- efi_uintn_t *buffer_size, void *buffer)
+efi_status_t efi_file_read_int(struct efi_file_handle *this,
+ efi_uintn_t *buffer_size, void *buffer)
{
struct file_handle *fh = to_fh(this);
efi_status_t ret = EFI_SUCCESS;
return EFI_EXIT(ret);
}
-/**
- * efi_file_setpos() - set current position in file
- *
- * This function implements the SetPosition service of the EFI file protocol.
- * See the UEFI spec for details.
- *
- * @file: file handle
- * @pos: new file position
- * Return: status code
- */
-static efi_status_t EFIAPI efi_file_setpos(struct efi_file_handle *file,
- u64 pos)
+efi_status_t efi_file_setpos_int(struct efi_file_handle *file, u64 pos)
{
struct file_handle *fh = to_fh(file);
efi_status_t ret = EFI_SUCCESS;
- EFI_ENTRY("%p, %llu", file, pos);
-
if (fh->isdir) {
if (pos != 0) {
ret = EFI_UNSUPPORTED;
fh->offset = pos;
error:
+ return ret;
+}
+
+/**
+ * efi_file_setpos() - set current position in file
+ *
+ * This function implements the SetPosition service of the EFI file protocol.
+ * See the UEFI spec for details.
+ *
+ * @file: file handle
+ * @pos: new file position
+ * Return: status code
+ */
+static efi_status_t EFIAPI efi_file_setpos(struct efi_file_handle *file,
+ u64 pos)
+{
+ efi_status_t ret = EFI_SUCCESS;
+
+ EFI_ENTRY("%p, %llu", file, pos);
+
+ ret = efi_file_setpos_int(file, pos);
+
return EFI_EXIT(ret);
}
return f;
}
+efi_status_t efi_open_volume_int(struct efi_simple_file_system_protocol *this,
+ struct efi_file_handle **root)
+{
+ struct file_system *fs = to_fs(this);
+
+ *root = file_open(fs, NULL, NULL, 0, 0);
+
+ return EFI_SUCCESS;
+}
+
static efi_status_t EFIAPI
efi_open_volume(struct efi_simple_file_system_protocol *this,
struct efi_file_handle **root)
{
- struct file_system *fs = to_fs(this);
-
EFI_ENTRY("%p, %p", this, root);
- *root = file_open(fs, NULL, NULL, 0, 0);
-
- return EFI_EXIT(EFI_SUCCESS);
+ return EFI_EXIT(efi_open_volume_int(this, root));
}
struct efi_simple_file_system_protocol *