diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-01 04:01:01 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-01 04:04:17 -0400 |
commit | a64865a93fdb22dee230d57a0a3c684668545acd (patch) | |
tree | d84e80a98ddcc763d82b5ff99bbe2e428d6cd748 /sys/include/fs | |
parent | ba76ec6d4eb0bac8af9a3a6c0e9f53e53eb8d3f3 (diff) |
kernel: tmpfs: Store the *real* size in a node
The 'len' field within the tmpfs node stores the buffer length which is
relative to the tmpfs block size. Introduce a real size which returns
the amount of data actually present within those buffers.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/fs')
-rw-r--r-- | sys/include/fs/tmpfs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/include/fs/tmpfs.h b/sys/include/fs/tmpfs.h index b2a5bbe..ca24060 100644 --- a/sys/include/fs/tmpfs.h +++ b/sys/include/fs/tmpfs.h @@ -53,6 +53,7 @@ struct tmpfs_node; * @rpath: /tmp/ relative path (for lookups) * @type: The tmpfs node type [one-to-one to vtype] * @len: Length of buffer + * @real_size: Actual size of file * @data: The backing file data * @dirvp: Vnode of the parent node * @vp: Vnode of the current node @@ -62,6 +63,7 @@ struct tmpfs_node { char rpath[PATH_MAX]; uint8_t type; size_t len; + size_t real_size; void *data; struct vnode *dirvp; struct vnode *vp; |