mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
linux-kernel-module: move keyring-specific
function afs_set_session_keyring into if defined(LINUX_KEYRING_SUPPORT) block. Otherwise compilation fails. Change-Id: I44bb015990782793eac9326b983b704b2248b230 Reviewed-on: http://gerrit.openafs.org/10324 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
parent
6016d2291a
commit
b0d75d0687
@ -220,6 +220,26 @@ afs_linux_search_keyring(afs_ucred_t *cred, struct key_type *type)
|
||||
return request_key(type, "_pag", NULL);
|
||||
}
|
||||
# endif /* STRUCT_TASK_STRUCT_HAS_CRED */
|
||||
|
||||
static_inline struct key *
|
||||
afs_set_session_keyring(struct key *keyring)
|
||||
{
|
||||
struct key *old;
|
||||
#if defined(STRUCT_CRED_HAS_SESSION_KEYRING)
|
||||
struct cred *new_creds;
|
||||
old = current_session_keyring();
|
||||
new_creds = prepare_creds();
|
||||
rcu_assign_pointer(new_creds->session_keyring, keyring);
|
||||
commit_creds(new_creds);
|
||||
#else
|
||||
spin_lock_irq(¤t->sighand->siglock);
|
||||
old = task_session_keyring(current);
|
||||
smp_wmb();
|
||||
task_session_keyring(current) = keyring;
|
||||
spin_unlock_irq(¤t->sighand->siglock);
|
||||
#endif
|
||||
return old;
|
||||
}
|
||||
#endif /* LINUX_KEYRING_SUPPORT */
|
||||
|
||||
#ifdef STRUCT_TASK_STRUCT_HAS_CRED
|
||||
@ -561,26 +581,6 @@ afs_putname(afs_name_t name) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static_inline struct key *
|
||||
afs_set_session_keyring(struct key *keyring)
|
||||
{
|
||||
struct key *old;
|
||||
#if defined(STRUCT_CRED_HAS_SESSION_KEYRING)
|
||||
struct cred *new_creds;
|
||||
old = current_session_keyring();
|
||||
new_creds = prepare_creds();
|
||||
rcu_assign_pointer(new_creds->session_keyring, keyring);
|
||||
commit_creds(new_creds);
|
||||
#else
|
||||
spin_lock_irq(¤t->sighand->siglock);
|
||||
old = task_session_keyring(current);
|
||||
smp_wmb();
|
||||
task_session_keyring(current) = keyring;
|
||||
spin_unlock_irq(¤t->sighand->siglock);
|
||||
#endif
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline int
|
||||
afs_truncate(struct inode *inode, int len)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user