aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/idmap.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-10-02 14:24:56 -0400
committerDavid Howells <dhowells@redhat.com>2012-10-02 14:24:56 -0400
commitf8aa23a55f813c9bddec2a6176e0e67274e6e7c1 (patch)
tree1b1927cedb4f1d769fac19242f3a365c84e40cec /fs/nfs/idmap.c
parent96b5c8fea6c0861621051290d705ec2e971963f1 (diff)
KEYS: Use keyring_alloc() to create special keyrings
Use keyring_alloc() to create special keyrings now that it has a permissions parameter rather than using key_alloc() + key_instantiate_and_link(). Also document and export keyring_alloc() so that modules can use it too. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/nfs/idmap.c')
-rw-r--r--fs/nfs/idmap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index a850079467d8..957134b4c0fd 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -192,19 +192,15 @@ static int nfs_idmap_init_keyring(void)
192 if (!cred) 192 if (!cred)
193 return -ENOMEM; 193 return -ENOMEM;
194 194
195 keyring = key_alloc(&key_type_keyring, ".id_resolver", 0, 0, cred, 195 keyring = keyring_alloc(".id_resolver", 0, 0, cred,
196 (KEY_POS_ALL & ~KEY_POS_SETATTR) | 196 (KEY_POS_ALL & ~KEY_POS_SETATTR) |
197 KEY_USR_VIEW | KEY_USR_READ, 197 KEY_USR_VIEW | KEY_USR_READ,
198 KEY_ALLOC_NOT_IN_QUOTA); 198 KEY_ALLOC_NOT_IN_QUOTA, NULL);
199 if (IS_ERR(keyring)) { 199 if (IS_ERR(keyring)) {
200 ret = PTR_ERR(keyring); 200 ret = PTR_ERR(keyring);
201 goto failed_put_cred; 201 goto failed_put_cred;
202 } 202 }
203 203
204 ret = key_instantiate_and_link(keyring, NULL, 0, NULL, NULL);
205 if (ret < 0)
206 goto failed_put_key;
207
208 ret = register_key_type(&key_type_id_resolver); 204 ret = register_key_type(&key_type_id_resolver);
209 if (ret < 0) 205 if (ret < 0)
210 goto failed_put_key; 206 goto failed_put_key;