user-util,storagectl: introduce USERNS_RANGE_SIZE macro
The mount.storage helper open-codes the conventional 64K UID/GID delegation block size as 0x10000 / 0x10000U in four places. Several other places in the tree do the same (nspawn's arg_uid_range default, homed's mount setup, …), but with no shared name. Add USERNS_RANGE_SIZE in user-util.h alongside UID_NOBODY and friends, and switch storagectl over to it. Other call sites can adopt it incrementally. Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "user-util.h"
|
||||
|
||||
/* Helpful constants for the only numbers of UIDs that can currently be allocated */
|
||||
#define NSRESOURCE_UIDS_64K 0x10000U
|
||||
#define NSRESOURCE_UIDS_64K USERNS_RANGE_SIZE
|
||||
#define NSRESOURCE_UIDS_1 1U
|
||||
|
||||
int nsresource_connect(sd_varlink **ret);
|
||||
|
||||
Reference in New Issue
Block a user