diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2025-10-21 00:26:13 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2025-11-05 00:05:38 +0100 |
| commit | db7bd1affa852b61dbc0d2ae2809f0f5bf2e3d9d (patch) | |
| tree | f27e1ae0a9d04c0c9e8f5024a7a6e1ca92095ed0 /rust/kernel/fs/file.rs | |
| parent | 46f045db5a94cd50b24dc1449bdd444e4473b28b (diff) | |
rust: fs: add file::Offset type alias
Add a type alias for file offsets, i.e. bindings::loff_t. Trying to
avoid using raw bindings types, this seems to be the better alternative
compared to just using i64.
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Link: https://patch.msgid.link/20251020222722.240473-2-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/fs/file.rs')
| -rw-r--r-- | rust/kernel/fs/file.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/kernel/fs/file.rs b/rust/kernel/fs/file.rs index cd6987850332..23ee689bd240 100644 --- a/rust/kernel/fs/file.rs +++ b/rust/kernel/fs/file.rs @@ -17,6 +17,11 @@ use crate::{ }; use core::ptr; +/// Primitive type representing the offset within a [`File`]. +/// +/// Type alias for `bindings::loff_t`. +pub type Offset = bindings::loff_t; + /// Flags associated with a [`File`]. pub mod flags { /// File is opened in append mode. |
