diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index 39dfab5b70..dc3abec21c 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -159,7 +159,7 @@ afs_linux_key_alloc(struct key_type *type, const char *desc, uid_t uid, #endif } -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) static inline struct key* afs_linux_search_keyring(afs_ucred_t *cred, struct key_type *type) { diff --git a/src/afs/LINUX/osi_cred.c b/src/afs/LINUX/osi_cred.c index b40d862571..20be59436a 100644 --- a/src/afs/LINUX/osi_cred.c +++ b/src/afs/LINUX/osi_cred.c @@ -38,7 +38,7 @@ crget(void) if (!tmp) osi_Panic("crget: No more memory for creds!\n"); -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) get_cred(tmp); #else atomic_set(&tmp->cr_ref, 1); @@ -49,7 +49,7 @@ crget(void) void crfree(cred_t * cr) { -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) put_cred(cr); #else if (atomic_dec_and_test(&cr->cr_ref)) { @@ -65,7 +65,7 @@ cred_t * crdup(cred_t * cr) { cred_t *tmp = crget(); -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) afs_copy_creds(tmp, cr); #else afs_set_cr_uid(tmp, afs_cr_uid(cr)); @@ -82,7 +82,7 @@ crdup(cred_t * cr) cred_t * crref(void) { -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) return (cred_t *)get_current_cred(); #else cred_t *cr = crget(); @@ -105,7 +105,7 @@ crref(void) void crset(cred_t * cr) { -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) struct cred *new_creds; /* If our current task doesn't have identical real and effective diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 33c9667cf4..991e677886 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -27,7 +27,7 @@ afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfsmount *afs_cacheMnt; extern struct super_block *afs_cacheSBp; -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) extern struct cred *cache_creds; #endif @@ -53,7 +53,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode) #endif tip->i_flags |= S_NOATIME; /* Disable updating access times. */ -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) /* Use stashed credentials - prevent selinux/apparmor problems */ filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds); if (IS_ERR(filp)) diff --git a/src/afs/LINUX/osi_gcpags.c b/src/afs/LINUX/osi_gcpags.c index ec32c6c9a7..86c7199159 100644 --- a/src/afs/LINUX/osi_gcpags.c +++ b/src/afs/LINUX/osi_gcpags.c @@ -28,7 +28,7 @@ extern rwlock_t tasklist_lock __attribute__((weak)); void afs_osi_TraverseProcTable(void) { -#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK)) +#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK)) struct task_struct *p; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK) @@ -83,7 +83,7 @@ afs_osi_TraverseProcTable(void) * subsequent calls may overwrite the previously returned value. */ -#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(EXPORTED_RCU_READ_LOCK)) +#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(EXPORTED_RCU_READ_LOCK)) const afs_ucred_t * afs_osi_proc2cred(afs_proc_t * pr) { @@ -103,7 +103,7 @@ afs_osi_proc2cred(afs_proc_t * pr) atomic_set(&cr.cr_ref, 1); afs_set_cr_uid(&cr, task_uid(pr)); #if defined(AFS_LINUX26_ENV) -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) get_group_info(pr->cred->group_info); set_cr_group_info(&cr, pr->cred->group_info); #else diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 1c25d30c69..f5a0bd22a4 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -129,7 +129,7 @@ afs_setgroups(cred_t **cr, struct group_info *group_info, int change_parent) crset(*cr); -#if defined(STRUCT_TASK_STRUCT_HAS_PARENT) && !defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_PARENT) && !defined(STRUCT_TASK_STRUCT_HAS_CRED) if (change_parent) { old_info = current->parent->group_info; get_group_info(group_info); diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index 5697fb194d..8389477960 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -144,7 +144,7 @@ static inline long copyinstr(char *from, char *to, int count, int *length) { typedef struct task_struct afs_proc_t; /* Credentials. For newer kernels we use the kernel structure directly. */ -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) typedef struct cred afs_ucred_t; typedef struct cred cred_t; @@ -212,7 +212,7 @@ afs_set_cr_group_info(cred_t *cred, struct group_info *group_info) { #define current_session_keyring() (current->signal->session_keyring) #define crhold(c) atomic_inc(&(c)->cr_ref) -#endif /* defined(STRUCT_TASK_HAS_CRED) */ +#endif /* defined(STRUCT_TASK_STRUCT_HAS_CRED) */ #if !defined(current_cred) #define current_gid() (current->gid) diff --git a/src/afs/LINUX24/osi_cred.c b/src/afs/LINUX24/osi_cred.c index 5627a58de1..bb5b6afdb0 100644 --- a/src/afs/LINUX24/osi_cred.c +++ b/src/afs/LINUX24/osi_cred.c @@ -84,7 +84,7 @@ crref(void) void crset(cred_t * cr) { -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) struct cred *new_creds; /* If our current task doesn't have identical real and effective diff --git a/src/afs/LINUX24/osi_file.c b/src/afs/LINUX24/osi_file.c index 8e965957ca..2dd732e592 100644 --- a/src/afs/LINUX24/osi_file.c +++ b/src/afs/LINUX24/osi_file.c @@ -62,7 +62,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode) tip->i_flags |= MS_NOATIME; /* Disable updating access times. */ #endif -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred()); #else filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR); diff --git a/src/afs/LINUX24/osi_gcpags.c b/src/afs/LINUX24/osi_gcpags.c index aa6759be5b..a589df8de8 100644 --- a/src/afs/LINUX24/osi_gcpags.c +++ b/src/afs/LINUX24/osi_gcpags.c @@ -26,7 +26,7 @@ extern rwlock_t tasklist_lock __attribute__((weak)); void afs_osi_TraverseProcTable(void) { -#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK)) +#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK)) struct task_struct *p; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK) diff --git a/src/afs/LINUX24/osi_machdep.h b/src/afs/LINUX24/osi_machdep.h index 06c89b952f..63babdcdf2 100644 --- a/src/afs/LINUX24/osi_machdep.h +++ b/src/afs/LINUX24/osi_machdep.h @@ -180,7 +180,7 @@ set_cr_group_info(afs_ucred_t *cred, struct group_info *group_info) { #define current_fsgid() (current->fsgid) #define current_fsuid() (current->fsuid) #endif -#if defined(STRUCT_TASK_HAS_CRED) +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) #define current_group_info() (current->cred->group_info) #define task_gid(task) (task->cred->gid) #define task_user(task) (task->cred->user) diff --git a/src/afs/afs.h b/src/afs/afs.h index 8aaab81a41..5b8680731a 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -1431,7 +1431,7 @@ extern int afsd_dynamic_vcaches; * Linux uses the kernel cred structure if available, with the * wrappers defined in LINUX/osi_machdep.h */ -#if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED)) +#if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)) #define afs_cr_uid(cred) ((cred)->cr_uid) #define afs_cr_gid(cred) ((cred)->cr_gid) #define afs_cr_ruid(cred) ((cred)->cr_ruid) diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 90f967a633..0ed611678a 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -22,7 +22,7 @@ #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* afs statistics */ #include "rx/rxstat.h" -#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED) +#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED) #include #endif @@ -54,7 +54,7 @@ static struct vnode *volumeVnode; afs_rwlock_t afs_discon_lock; extern afs_rwlock_t afs_disconDirtyLock; #endif -#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED) +#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED) const struct cred *cache_creds; #endif @@ -158,7 +158,7 @@ afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 ablocks, afs_cacheStats = astatSize; afs_vcacheInit(astatSize); afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags); -#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED) +#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED) /* * Save current credentials for later access to disk cache files. * If selinux, apparmor or other security modules are enabled, @@ -722,7 +722,7 @@ shutdown_cache(void) memset(&cacheDev, 0, sizeof(struct osi_dev)); osi_dnlc_shutdown(); } -#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED) +#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED) put_cred(cache_creds); #endif } /*shutdown_cache */ diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index b04cae18eb..9f4784e100 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -95,7 +95,7 @@ osi_Init(void) #if defined(AFS_DARWIN80_ENV) afs_osi_cred.cr_ref = 1; /* kauth_cred_get_ref needs 1 existing ref */ #else -# if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED)) +# if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)) crhold(&afs_osi_cred); /* don't let it evaporate */ # endif #endif diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 4f2cf7d0ca..ec02da4050 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -611,7 +611,7 @@ PagInCred(afs_ucred_t *cred) * With keyrings but no kernel credentials, look at groups first and fall back * to looking at the keyrings. */ -# if !defined(STRUCT_TASK_HAS_CRED) +# if !defined(STRUCT_TASK_STRUCT_HAS_CRED) pag = osi_get_group_pag(cred); # endif if (pag == NOPAG) diff --git a/src/afs/afs_user.c b/src/afs/afs_user.c index e3cf687c2a..2bfac9b273 100644 --- a/src/afs/afs_user.c +++ b/src/afs/afs_user.c @@ -623,7 +623,7 @@ static size_t afs_GCPAGs_cred_count = 0; /* * LOCKS: afs_GCPAGs_perproc_func requires write lock on afs_xuser */ -#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK)) +#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK)) void afs_GCPAGs_perproc_func(afs_proc_t * pproc) {