ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_space_t Struct Reference

A mounted volume's capacity, free space, and cluster geometry. More...

#include <ra8_fs_meta.h>

Data Fields

uint64_t total_bytes
 Whole data region, in bytes.
uint64_t free_bytes
 Unallocated data region, in bytes.
uint64_t used_bytes
 Allocated data region, in bytes.
uint32_t bytes_per_cluster
 Allocation-unit size in bytes.
uint32_t total_clusters
 Data-region cluster count.
uint32_t free_clusters
 Clusters not currently allocated.
uint32_t used_clusters
 Clusters currently allocated.

Detailed Description

A mounted volume's capacity, free space, and cluster geometry.

What ra8_fs_free_space reports. Byte counts are 64-bit because a 2 TiB volume's byte total overflows 32 bits even though FAT file sizes stay 32-bit; the cluster counts and the per-cluster byte size are 32-bit, matching the on-disk fields they come from.

Invariant
used_clusters + free_clusters == total_clusters.
total_bytes == (uint64_t)total_clusters * bytes_per_cluster (and likewise for free_bytes / used_bytes).
bytes_per_cluster == sectors_per_cluster * bytes_per_sector.
Example:
if (ra8_fs_free_space(mnt, &sp) == k_ra8_ok && sp.free_bytes < need) {
// not enough room -- roll the log or refuse the run
}
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
ra8_err_t ra8_fs_free_space(const ra8_fs_mount_t *handle, ra8_fs_space_t *out)
Report a mounted volume's total, free, and used space.
A mounted volume's capacity, free space, and cluster geometry.
Definition ra8_fs_meta.h:84
uint64_t free_bytes
Unallocated data region, in bytes.
Definition ra8_fs_meta.h:86
See also
ra8_fs_free_space()
Since
0.1.0

Definition at line 84 of file ra8_fs_meta.h.

Field Documentation

◆ bytes_per_cluster

uint32_t ra8_fs_space_t::bytes_per_cluster

Allocation-unit size in bytes.

Definition at line 88 of file ra8_fs_meta.h.

◆ free_bytes

uint64_t ra8_fs_space_t::free_bytes

Unallocated data region, in bytes.

Definition at line 86 of file ra8_fs_meta.h.

Referenced by internal_space().

◆ free_clusters

uint32_t ra8_fs_space_t::free_clusters

Clusters not currently allocated.

Definition at line 90 of file ra8_fs_meta.h.

◆ total_bytes

uint64_t ra8_fs_space_t::total_bytes

Whole data region, in bytes.

Definition at line 85 of file ra8_fs_meta.h.

Referenced by internal_space().

◆ total_clusters

uint32_t ra8_fs_space_t::total_clusters

Data-region cluster count.

Definition at line 89 of file ra8_fs_meta.h.

◆ used_bytes

uint64_t ra8_fs_space_t::used_bytes

Allocated data region, in bytes.

Definition at line 87 of file ra8_fs_meta.h.

Referenced by internal_space().

◆ used_clusters

uint32_t ra8_fs_space_t::used_clusters

Clusters currently allocated.

Definition at line 91 of file ra8_fs_meta.h.


The documentation for this struct was generated from the following file: