Skip to content

Commit 56e7a8b

Browse files
committed
Merge tag 'vfs-6.15-rc1.rust' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs rust updates from Christian Brauner: "This contains minor fixes and improvements to rust file bindings: - Optimize rust symbol generation for FileDescriptorReservation - Optimize rust symbol generation for SeqFile" * tag 'vfs-6.15-rc1.rust' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: rust: optimize rust symbol generation for SeqFile rust: file: optimize rust symbol generation for FileDescriptorReservation
2 parents 912b82d + 0b9817c commit 56e7a8b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

rust/kernel/fs/file.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ pub struct FileDescriptorReservation {
392392

393393
impl FileDescriptorReservation {
394394
/// Creates a new file descriptor reservation.
395+
#[inline]
395396
pub fn get_unused_fd_flags(flags: u32) -> Result<Self> {
396397
// SAFETY: FFI call, there are no safety requirements on `flags`.
397398
let fd: i32 = unsafe { bindings::get_unused_fd_flags(flags) };
@@ -405,6 +406,7 @@ impl FileDescriptorReservation {
405406
}
406407

407408
/// Returns the file descriptor number that was reserved.
409+
#[inline]
408410
pub fn reserved_fd(&self) -> u32 {
409411
self.fd
410412
}
@@ -413,6 +415,7 @@ impl FileDescriptorReservation {
413415
///
414416
/// The previously reserved file descriptor is bound to `file`. This method consumes the
415417
/// [`FileDescriptorReservation`], so it will not be usable after this call.
418+
#[inline]
416419
pub fn fd_install(self, file: ARef<File>) {
417420
// SAFETY: `self.fd` was previously returned by `get_unused_fd_flags`. We have not yet used
418421
// the fd, so it is still valid, and `current` still refers to the same task, as this type
@@ -433,6 +436,7 @@ impl FileDescriptorReservation {
433436
}
434437

435438
impl Drop for FileDescriptorReservation {
439+
#[inline]
436440
fn drop(&mut self) {
437441
// SAFETY: By the type invariants of this type, `self.fd` was previously returned by
438442
// `get_unused_fd_flags`. We have not yet used the fd, so it is still valid, and `current`

rust/kernel/seq_file.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ impl SeqFile {
3030
}
3131

3232
/// Used by the [`seq_print`] macro.
33+
#[inline]
3334
pub fn call_printf(&self, args: core::fmt::Arguments<'_>) {
3435
// SAFETY: Passing a void pointer to `Arguments` is valid for `%pA`.
3536
unsafe {

0 commit comments

Comments
 (0)