Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • kernel
  • types.rs
Find file BlameHistoryPermalink
  • Kartik Prajapati's avatar
    rust: types: add `ARef::into_raw` · 96fff2dc
    Kartik Prajapati authored Aug 21, 2024
    Add a method for `ARef` that is analogous to `Arc::into_raw`. It is the
    inverse operation of `ARef::from_raw`, and allows you to convert the
    `ARef` back into a raw pointer while retaining ownership of the
    refcount.
    
    This new function will be used by [1] for converting the type in an
    `ARef` using `ARef::from_raw(ARef::into_raw(me).cast())`. Alice has
    also needed the same function for other use-cases in the past, but [1]
    is the first to go upstream.
    
    This was implemented independently by Kartik and Alice. The two versions
    were merged by Alice, so all mistakes are Alice's.
    
    Link: https://lore.kernel.org/r/20240801-vma-v3-1-db6c1c0afda9@google.com [1]
    Link: https://github.com/Rust-for-Linux/linux/issues/1044
    
    
    Signed-off-by: default avatarKartik Prajapati <kartikprajapati987@gmail.com>
    Co-developed-by: default avatarAlice Ryhl <aliceryhl@google.com>
    Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
    Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
    [ Reworded to correct the author reference and changed tag to Link
      since it is not a bug. - Miguel ]
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    96fff2dc
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7