• Eric W. Biederman's avatar
    userns: Simplify the user and group mapping functions · 3edf652f
    Eric W. Biederman authored
    Consolidate reading the number of extents and computing the return
    value in the map_id_down, map_id_range_down and map_id_range.
    
    This removal of one read of extents makes one smp_rmb unnecessary
    and makes the code safe it is executed during the map write.  Reading
    the number of extents twice and depending on the result being the same
    is not safe, as it could be 0 the first time and > 5 the second time,
    which would lead to misinterpreting the union fields.
    
    The consolidation of the return value just removes a duplicate
    caluculation which should make it easier to understand and maintain
    the code.
    Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
    3edf652f
user_namespace.c 34.4 KB