Skip to content

move ARef<T> and AlwaysRefCounted to sync #1173

Closed

Description

@BennoLossin

ARef<T> and AlwaysRefCounted are currently defined in types.rs which doesn't really fit. Thus move them to sync/aref.rs.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag, and a Link: tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.

Activity

  1. added
    good first issue
    easy
    on Jun 22, 2025
  2. Shankari02 commented on Jun 22, 2025

    @Shankari02

    Hello,

    I would be interested to work on this issue. Will send a patch to the mailing-list according to the specified instructions.

  3. added
    • lib
    on Jun 22, 2025
  4. Shankari02 commented on Jun 23, 2025

    @Shankari02

    Hello @BennoLossin,

    I've moved ARef<T> and AlwaysRefCounted from types.rs to sync/aref.rs as suggested. However, several modules across the kernel tree currently import these types from crate::types.

    Would you prefer that I:
    Re-export them from types.rs to maintain compatibility, or
    Update all call sites to import directly from sync::aref?

    Let me know which approach you'd prefer for this patch. Thanks!

  5. ojeda commented on Jun 23, 2025

    @ojeda
    Member

    If there are not too many, it may be possible to do it at once early in a kernel cycle. In general, we may need a transition period, i.e. we do one kernel cycle with all existing instances moved, and then early the next kernel cycle we remove the re-export at the same time that we move any new ones that appeared during the last one.

    (Side-note: for bigger ones in the future, we may want to leverage Clippy).

  6. Shankari02 commented on Jun 23, 2025

    @Shankari02

    If there are not too many, it may be possible to do it at once early in a kernel cycle. In general, we may need a transition period, i.e. we do one kernel cycle with all existing instances moved, and then early the next kernel cycle we remove the re-export at the same time that we move any new ones that appeared during the last one.

    (Side-note: for bigger ones in the future, we may want to leverage Clippy).

    I can see around 29 references. Possibly I'll re-export them from types.rs to aref.rs in this patch and in the next patch, i'll update the call sites to import from sync::aref?

  7. BennoLossin commented on Jun 23, 2025

    @BennoLossin
    MemberAuthor

    splitting the update patch from the moving patch sounds like a good idea.

    I don't think that we need to split the two patches over different cycles. As Miguel said, we can just pick it early in the cycle.

  8. Shankari02 commented on Jun 23, 2025

    @Shankari02
  9. 143 remaining items

  10. ojeda commented on Mar 15, 2026

    @ojeda
    Member

    And now we finally finished the move with the removal of the temporary re-export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

easygood first issue• lib

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions