diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-30 04:24:05 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-18 04:01:37 -0400 |
commit | f76d207a66c3a53defea67e7d36c3eb1b7d6d61d (patch) | |
tree | 2d2a459c539d6f0b92e8ca856632e65f6c293af7 /kernel/user.c | |
parent | 69552c0c50f3f950f304fb07a4320e46f7f60c21 (diff) |
userns: Add kprojid_t and associated infrastructure in projid.h
Implement kprojid_t a cousin of the kuid_t and kgid_t.
The per user namespace mapping of project id values can be set with
/proc/<pid>/projid_map.
A full compliment of helpers is provided: make_kprojid, from_kprojid,
from_kprojid_munged, kporjid_has_mapping, projid_valid, projid_eq,
projid_eq, projid_lt.
Project identifiers are part of the generic disk quota interface,
although it appears only xfs implements project identifiers currently.
The xfs code allows anyone who has permission to set the project
identifier on a file to use any project identifier so when
setting up the user namespace project identifier mappings I do
not require a capability.
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel/user.c')
-rw-r--r-- | kernel/user.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/user.c b/kernel/user.c index b815fefbe76f..750acffbe9ec 100644 --- a/kernel/user.c +++ b/kernel/user.c | |||
@@ -38,6 +38,14 @@ struct user_namespace init_user_ns = { | |||
38 | .count = 4294967295U, | 38 | .count = 4294967295U, |
39 | }, | 39 | }, |
40 | }, | 40 | }, |
41 | .projid_map = { | ||
42 | .nr_extents = 1, | ||
43 | .extent[0] = { | ||
44 | .first = 0, | ||
45 | .lower_first = 0, | ||
46 | .count = 4294967295U, | ||
47 | }, | ||
48 | }, | ||
41 | .kref = { | 49 | .kref = { |
42 | .refcount = ATOMIC_INIT(3), | 50 | .refcount = ATOMIC_INIT(3), |
43 | }, | 51 | }, |