aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2015-01-20 23:55:48 +0000
committerWill Deacon <will.deacon@arm.com>2015-06-01 16:40:11 +0100
commitc6cb7c757339c7f465934dbb81fa01f1659114d5 (patch)
tree2367371fbfbdf7f7e63c8d4bce5b8f8c381f45bc /include
parentfbb8a81d1a37ac9dc43e61ce975a0b27e58b61db (diff)
downloadkvmtool-c6cb7c757339c7f465934dbb81fa01f1659114d5.tar.gz
kvmtool: 9p: teach kvmtool about kuid_t and kgid_t
The 9p kernel code uses separate types for uid_t and gid_t. To avoid changing too much code needlessly, copy over the kernel definitions from uidgid.h into 9p.h. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/9p.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/9p.h b/include/linux/9p.h
index 27dfe857..c7cfd8e1 100644
--- a/include/linux/9p.h
+++ b/include/linux/9p.h
@@ -27,6 +27,29 @@
#ifndef NET_9P_H
#define NET_9P_H
+/* These definitions are from Linux include/linux/uidgid.h */
+typedef struct {
+ uid_t val;
+} kuid_t;
+
+typedef struct {
+ gid_t val;
+} kgid_t;
+
+#define KUIDT_INIT(value) (kuid_t){ value }
+#define KGIDT_INIT(value) (kgid_t){ value }
+
+static inline uid_t __kuid_val(kuid_t uid)
+{
+ return uid.val;
+}
+
+static inline gid_t __kgid_val(kgid_t gid)
+{
+ return gid.val;
+}
+
+
/**
* enum p9_debug_flags - bits for mount time debug parameter
* @P9_DEBUG_ERROR: more verbose error messages including original error string