Page MenuHomeFreeBSD

shm_alloc(): cleanup
ClosedPublic

Authored by kib on Oct 8 2024, 5:50 PM.
Tags
None
Referenced Files
F112055332: D47018.id144527.diff
Wed, Mar 12, 4:40 AM
Unknown Object (File)
Wed, Mar 5, 1:22 AM
Unknown Object (File)
Tue, Mar 4, 5:49 PM
Unknown Object (File)
Tue, Mar 4, 10:44 AM
Unknown Object (File)
Mon, Mar 3, 8:18 AM
Unknown Object (File)
Wed, Feb 12, 4:09 PM
Unknown Object (File)
Feb 8 2025, 8:03 PM
Unknown Object (File)
Feb 5 2025, 11:57 PM
Subscribers

Details

Summary
Consistently use the shorter name 'obj' for the new object.
Set OBJ_POSIXSHM flag outside if, it is set on both pathes.

Suggested by:   alc

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Oct 8 2024, 5:50 PM

I think that unlocked assignment to swp/phys_priv is fine,the field is never changed after the initialization. I would even set the flag lockless, since the object is not yet visible, but I think the consistency is useful there, e.g. for sanitizers.

sys/kern/uipc_shm.c
947–948

The assignment to shmfd->shm_object here isn't needed.

kib marked an inline comment as done.

Remove unneeded assignment.

This revision is now accepted and ready to land.Oct 9 2024, 8:10 AM
This revision was automatically updated to reflect the committed changes.