diff options
author | David Howells <dhowells@redhat.com> | 2012-10-02 14:24:56 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2012-10-02 14:24:56 -0400 |
commit | f8aa23a55f813c9bddec2a6176e0e67274e6e7c1 (patch) | |
tree | 1b1927cedb4f1d769fac19242f3a365c84e40cec /fs/cifs/cifsacl.c | |
parent | 96b5c8fea6c0861621051290d705ec2e971963f1 (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/cifs/cifsacl.c')
-rw-r--r-- | fs/cifs/cifsacl.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 05f4dc263a23..a8a753c8fcd5 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -537,19 +537,15 @@ init_cifs_idmap(void) | |||
537 | if (!cred) | 537 | if (!cred) |
538 | return -ENOMEM; | 538 | return -ENOMEM; |
539 | 539 | ||
540 | keyring = key_alloc(&key_type_keyring, ".cifs_idmap", 0, 0, cred, | 540 | keyring = keyring_alloc(".cifs_idmap", 0, 0, cred, |
541 | (KEY_POS_ALL & ~KEY_POS_SETATTR) | | 541 | (KEY_POS_ALL & ~KEY_POS_SETATTR) | |
542 | KEY_USR_VIEW | KEY_USR_READ, | 542 | KEY_USR_VIEW | KEY_USR_READ, |
543 | KEY_ALLOC_NOT_IN_QUOTA); | 543 | KEY_ALLOC_NOT_IN_QUOTA, NULL); |
544 | if (IS_ERR(keyring)) { | 544 | if (IS_ERR(keyring)) { |
545 | ret = PTR_ERR(keyring); | 545 | ret = PTR_ERR(keyring); |
546 | goto failed_put_cred; | 546 | goto failed_put_cred; |
547 | } | 547 | } |
548 | 548 | ||
549 | ret = key_instantiate_and_link(keyring, NULL, 0, NULL, NULL); | ||
550 | if (ret < 0) | ||
551 | goto failed_put_key; | ||
552 | |||
553 | ret = register_key_type(&cifs_idmap_key_type); | 549 | ret = register_key_type(&cifs_idmap_key_type); |
554 | if (ret < 0) | 550 | if (ret < 0) |
555 | goto failed_put_key; | 551 | goto failed_put_key; |