diff options
author | Benno Lossin | 2023-10-26 20:19:33 +0000 |
---|---|---|
committer | Miguel Ojeda | 2023-12-14 20:14:01 +0100 |
commit | 88c2e1169f5f0c2ccdd0a001e4447a1b0da2b661 (patch) | |
tree | ca6c672d6c4925f404068061c49f294b2dfaacbc /fs/iomap | |
parent | 2dc318ea9681c14c37bad2715097df4380a3c547 (diff) |
rust: macros: improve `#[vtable]` documentation
Traits marked with `#[vtable]` need to provide default implementations
for optional functions. The C side represents these with `NULL` in the
vtable, so the default functions are never actually called. We do not
want to replicate the default behavior from C in Rust, because that is
not maintainable. Therefore we should use `build_error` in those default
implementations. The error message for that is provided at
`kernel::error::VTABLE_DEFAULT_ERROR`.
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Finn Behrens <me@kloenk.dev>
Link: https://lore.kernel.org/r/20231026201855.1497680-1-benno.lossin@proton.me
[ Wrapped paragraph to 80 as requested and capitalized sentence. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'fs/iomap')
0 files changed, 0 insertions, 0 deletions