HomeFreeBSD

shmfd: posix_fallocate(2): only take rangelock for section we need

Description

shmfd: posix_fallocate(2): only take rangelock for section we need

Other mechanisms that resize the shmfd grab a write lock from 0 to OFF_MAX
for safety, so we still get proper synchronization of shmfd->shm_size in
effect. There's no need to block readers/writers of earlier segments when
we're just reserving more space, so narrow the scope -- it would likely be
safe to narrow it completely to just the section of the range that extends
beyond our current size, but this likely isn't worth it since the size isn't
stable until the writelock is granted the first time.

Suggested by: cem (passing comment)

Details

Provenance
kevansAuthored on
Parents
rS356536: if_vmove: return proper error status
Branches
Unknown
Tags
Unknown