aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/cell.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs/cell.c')
-rw-r--r--fs/afs/cell.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/afs/cell.c b/fs/afs/cell.c
index ccfa89f35259..970d38f30565 100644
--- a/fs/afs/cell.c
+++ b/fs/afs/cell.c
@@ -33,6 +33,7 @@ static struct afs_cell *afs_cell_root;
33static struct afs_cell *afs_cell_alloc(const char *name, char *vllist) 33static struct afs_cell *afs_cell_alloc(const char *name, char *vllist)
34{ 34{
35 struct afs_cell *cell; 35 struct afs_cell *cell;
36 struct key *key;
36 size_t namelen; 37 size_t namelen;
37 char keyname[4 + AFS_MAXCELLNAME + 1], *cp, *dp, *next; 38 char keyname[4 + AFS_MAXCELLNAME + 1], *cp, *dp, *next;
38 int ret; 39 int ret;
@@ -89,20 +90,14 @@ static struct afs_cell *afs_cell_alloc(const char *name, char *vllist)
89 do { 90 do {
90 *dp++ = toupper(*cp); 91 *dp++ = toupper(*cp);
91 } while (*cp++); 92 } while (*cp++);
92 cell->anonymous_key = key_alloc(&key_type_rxrpc, keyname, 0, 0, current,
93 KEY_POS_SEARCH, KEY_ALLOC_NOT_IN_QUOTA);
94 if (IS_ERR(cell->anonymous_key)) {
95 _debug("no key");
96 ret = PTR_ERR(cell->anonymous_key);
97 goto error;
98 }
99 93
100 ret = key_instantiate_and_link(cell->anonymous_key, NULL, 0, 94 key = rxrpc_get_null_key(keyname);
101 NULL, NULL); 95 if (IS_ERR(key)) {
102 if (ret < 0) { 96 _debug("no key");
103 _debug("instantiate failed"); 97 ret = PTR_ERR(key);
104 goto error; 98 goto error;
105 } 99 }
100 cell->anonymous_key = key;
106 101
107 _debug("anon key %p{%x}", 102 _debug("anon key %p{%x}",
108 cell->anonymous_key, key_serial(cell->anonymous_key)); 103 cell->anonymous_key, key_serial(cell->anonymous_key));