Commit 11a8b927 authored by Eric W. Biederman's avatar Eric W. Biederman

userns: Don't special case a count of 0

We can always use a count of 1 so there is no reason to have
a special case of a count of 0.
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 6397fac4
...@@ -232,11 +232,7 @@ static int cmp_map_id(const void *k, const void *e) ...@@ -232,11 +232,7 @@ static int cmp_map_id(const void *k, const void *e)
const struct idmap_key *key = k; const struct idmap_key *key = k;
const struct uid_gid_extent *el = e; const struct uid_gid_extent *el = e;
/* handle map_id_range_down() */ id2 = key->id + key->count - 1;
if (key->count)
id2 = key->id + key->count - 1;
else
id2 = key->id;
/* handle map_id_{down,up}() */ /* handle map_id_{down,up}() */
if (key->map_up) if (key->map_up)
...@@ -362,7 +358,7 @@ static u32 map_id_down(struct uid_gid_map *map, u32 id) ...@@ -362,7 +358,7 @@ static u32 map_id_down(struct uid_gid_map *map, u32 id)
if (extents <= UID_GID_MAP_MAX_BASE_EXTENTS) if (extents <= UID_GID_MAP_MAX_BASE_EXTENTS)
return map_id_down_base(map, id); return map_id_down_base(map, id);
return map_id_range_down_max(map, id, 0); return map_id_range_down_max(map, id, 1);
} }
/** /**
...@@ -404,7 +400,7 @@ static u32 map_id_up_max(struct uid_gid_map *map, u32 id) ...@@ -404,7 +400,7 @@ static u32 map_id_up_max(struct uid_gid_map *map, u32 id)
struct idmap_key key; struct idmap_key key;
key.map_up = true; key.map_up = true;
key.count = 0; key.count = 1;
key.id = id; key.id = id;
extents = map->nr_extents; extents = map->nr_extents;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment