summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-10-11 05:34:38 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-10-11 05:34:38 -0700
commit106c646cd67330b6583a5769582b7ba1bd74460d (patch)
tree6ad6f85b2740b702775d69fb998238639e1d952c /include/linux
parent700ee9f089eddb576b4acffb0d86a0807d994402 (diff)
[PATCH] kNFSd: Stub support for name lookup
NFSv4 need to be able to make from user/group name to user/group id. This include file contains some simple stubs to do this. They will be replaced with something that really works later.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sunrpc/name_lookup.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/sunrpc/name_lookup.h b/include/linux/sunrpc/name_lookup.h
new file mode 100644
index 000000000000..0c97ec324ada
--- /dev/null
+++ b/include/linux/sunrpc/name_lookup.h
@@ -0,0 +1,38 @@
+
+/*
+ * map between user/group name and id for a given 'client'
+ */
+
+struct name_ent {
+ char name[20];
+};
+static inline int name_get_user(int uid, struct name_ent **namep)
+{
+ struct name_ent *n = kmalloc(sizeof(*n),GFP_KERNEL);
+ if (n) sprintf(n->name, "%d",uid);
+ *namep = n;
+ return n ? 0 : -ENOMEM;
+}
+static inline int name_get_group(int uid, struct name_ent **namep)
+{
+ struct name_ent *n = kmalloc(sizeof(*n),GFP_KERNEL);
+ if (n) sprintf(n->name, "%d",uid);
+ *namep = n;
+ return n ? 0 : -ENOMEM;
+}
+static inline int name_get_uid(char *name, int name_len, int *uidp)
+{
+ *uidp = simple_strtoul(name, NULL, 0);
+ return 0;
+}
+
+static inline int name_get_gid(char *name, int name_len, int *gidp)
+{
+ *gidp = simple_strtoul(name, NULL, 0);
+ return 0;
+}
+
+static inline void name_put(struct name_ent *ent)
+{
+ kfree(ent);
+}