diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index a83bcb9154..ed6ab5ad80 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -27,14 +27,13 @@ #include "osi_compat.h" #ifdef AFS_LINUX26_ONEGROUP_ENV -# define NUMPAGGROUPS 1 static afs_uint32 afs_linux_pag_from_groups(struct group_info *group_info) { afs_uint32 g0 = 0; afs_uint32 i; - if (group_info->ngroups < NUMPAGGROUPS) + if (group_info->ngroups < AFS_NUMPAGGROUPS) return NOPAG; for (i = 0; i < group_info->ngroups; i++) { @@ -54,7 +53,7 @@ afs_linux_pag_to_groups(afs_uint32 newpag, afs_kgid_t newkgid = afs_make_kgid(newpag); if (afs_linux_pag_from_groups(old) == NOPAG) - need_space = NUMPAGGROUPS; + need_space = AFS_NUMPAGGROUPS; *new = groups_alloc(old->ngroups + need_space); @@ -75,12 +74,11 @@ afs_linux_pag_to_groups(afs_uint32 newpag, } #else -# define NUMPAGGROUPS 2 static inline afs_uint32 afs_linux_pag_from_groups(struct group_info *group_info) { - if (group_info->ngroups < NUMPAGGROUPS) + if (group_info->ngroups < AFS_NUMPAGGROUPS) return NOPAG; return afs_get_pag_from_groups(GROUP_AT(group_info, 0), GROUP_AT(group_info, 1)); @@ -95,7 +93,7 @@ afs_linux_pag_to_groups(afs_uint32 newpag, gid_t g1; if (afs_linux_pag_from_groups(old) == NOPAG) - need_space = NUMPAGGGROUPS; + need_space = AFS_NUMPAGGROUPS; *new = groups_alloc(old->ngroups + need_space); diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index dfb6b184ff..d31f2ac6fe 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -448,4 +448,10 @@ extern afs_ucred_t afs_osi_cred, *afs_osi_credp; #define osi_curcred() (u.u_cred) #endif +#ifdef AFS_LINUX26_ONEGROUP_ENV +#define AFS_NUMPAGGROUPS 1 +#else +#define AFS_NUMPAGGROUPS 2 +#endif + #endif /* _AFS_OSI_ */ diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 34ca9b2f5c..9b8c5b52f3 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -42,13 +42,6 @@ afs_uint32 pagCounter = 1; afs_uint32 pagCounter = 0; #endif /* UKERNEL */ -#ifdef AFS_LINUX26_ONEGROUP_ENV -#define NUMPAGGROUPS 1 -#else -#define NUMPAGGROUPS 2 -#endif -/* Local variables */ - /* * Pags are implemented as follows: the set of groups whose long * representation is '41XXXXXX' hex are used to represent the pags. @@ -633,7 +626,7 @@ osi_get_group_pag(afs_ucred_t *cred) if (cred->cr_ngrps < 2) return NOPAG; # elif defined(AFS_LINUX26_ENV) - if (afs_cr_group_info(cred)->ngroups < NUMPAGGROUPS) + if (afs_cr_group_info(cred)->ngroups < AFS_NUMPAGGROUPS) return NOPAG; # elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV) # if defined(AFS_SUN510_ENV)