Use AFS_PROC consistently

Make consistent use of AFS_PROC in portable and mixed files, adding the define
for platforms which lacked it.  This completes a change that has been ongoing
for several years.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/642
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
matt@linuxbox.com 2009-10-10 09:09:53 -04:00 committed by Derrick Brashear
parent d705e26eac
commit 76ae0f5189
12 changed files with 39 additions and 35 deletions

View File

@ -29,6 +29,8 @@ extern time_t time;
/* This gets redefined from ucred to cred in osi_vfs.h, just do it right */
#define AFS_UCRED struct cred
#define AFS_PROC struct proc
#undef gop_lookupname
#define gop_lookupname(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),NULL,(compvpp), NULL)

View File

@ -28,6 +28,8 @@
#define AFS_UCRED struct usr_ucred
#define AFS_PROC struct usr_proc
#define AFS_KALLOC(A) afs_osi_Alloc(A)
/*

View File

@ -72,7 +72,7 @@ lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid)
flid_t flid;
get_current_flid(&flid);
# else
struct proc *procp = OSI_GET_CURRENT_PROCP();
AFS_PROC *procp = OSI_GET_CURRENT_PROCP();
# endif
if (slp) {
@ -96,7 +96,7 @@ void
lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid)
{
# if !defined(AFS_AIX32_ENV)
struct proc *procp = u.u_procp;
AFS_PROC *procp = u.u_procp;
# endif
if (slp) {
@ -175,9 +175,9 @@ lockIdcmp2(struct AFS_FLOCK *flock1, struct vcache *vp,
#else
#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
#ifdef AFS_SGI64_ENV
struct proc *procp = curprocp;
AFS_PROC *procp = curprocp;
#else /* AFS_SGI64_ENV */
struct proc *procp = u.u_procp;
AFS_PROC *procp = u.u_procp;
#endif /* AFS_SGI64_ENV */
#endif
#endif
@ -894,7 +894,7 @@ GetFlockCount(struct vcache *avc, struct vrequest *areq)
extern struct fileops afs_fileops;
int
afs_xflock(struct proc *p, void *args, int *retval)
afs_xflock(AFS_PROC *p, void *args, int *retval)
#else /* AFS_OSF_ENV */
int
afs_xflock(void)

View File

@ -588,8 +588,8 @@ afs_ResourceInit(int preallocs)
static void
afs_procsize_init(void)
{
struct proc *p0; /* pointer to process 0 */
struct proc *pN; /* pointer to process 0's first child */
AFS_PROC *p0; /* pointer to process 0 */
AFS_PROC *pN; /* pointer to process 0's first child */
#ifdef AFS_AIX51_ENV
struct pvproc *pV;
#endif
@ -597,13 +597,13 @@ afs_procsize_init(void)
ptrdiff_t pN_offset;
int procsize;
p0 = (struct proc *)v.vb_proc;
p0 = (AFS_PROC *)v.vb_proc;
if (!p0) {
afs_gcpags = AFS_GCPAGS_EPROC0;
return;
}
#ifdef AFS_AIX51_ENV
pN = (struct proc *)0;
pN = NULL;
pV = p0->p_pvprocp;
if (pV) {
pV = pV->pv_child;

View File

@ -59,7 +59,7 @@ struct lock__bsd__ afs_global_lock;
#if defined(AFS_XBSD_ENV) && !defined(AFS_FBSD50_ENV)
struct lock afs_global_lock;
struct proc *afs_global_owner;
AFS_PROC *afs_global_owner;
#endif
#ifdef AFS_FBSD50_ENV
struct mtx afs_global_mtx;

View File

@ -28,7 +28,7 @@
void
afs_osi_TraverseProcTable(void)
{
struct proc *prp;
AFS_PROC *prp;
for (prp = practive; prp != NULL; prp = prp->p_next) {
afs_GCPAGs_perproc_func(prp);
}
@ -99,7 +99,7 @@ SGI_ProcScanFunc(void *p, void *arg, int mode)
static int
SGI_ProcScanFunc(proc_t * p, void *arg, int mode)
{
afs_int32(*perproc_func) (struct proc *) = arg;
afs_int32(*perproc_func) (AFS_PROC *) = arg;
int code = 0;
/* we pass in the function pointer for arg,
* mode ==0 for startup call, ==1 for each valid proc,
@ -126,7 +126,7 @@ afs_osi_TraverseProcTable(void)
void
afs_osi_TraverseProcTable(void)
{
struct proc *p;
AFS_PROC *p;
int i;
/*
@ -140,8 +140,8 @@ afs_osi_TraverseProcTable(void)
#ifndef AFS_AIX51_ENV
simple_lock(&proc_tbl_lock);
#endif
for (p = (struct proc *)v.vb_proc, i = 0; p < max_proc;
p = (struct proc *)((char *)p + afs_gcpags_procsize), i++) {
for (p = (AFS_PROC *)v.vb_proc, i = 0; p < max_proc;
p = (AFS_PROC *)((char *)p + afs_gcpags_procsize), i++) {
#ifdef AFS_AIX51_ENV
if (p->p_pvprocp->pv_stat == SNONE)
@ -210,7 +210,7 @@ afs_osi_TraverseProcTable(void)
void
afs_osi_TraverseProcTable(void)
{
struct proc *p;
AFS_PROC *p;
LIST_FOREACH(p, &allproc, p_list) {
if (p->p_stat == SIDL)
continue;

View File

@ -192,7 +192,7 @@ int
#if defined(AFS_SUN5_ENV)
afs_setpag(AFS_UCRED **credpp)
#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
afs_setpag(struct proc *p, void *args, int *retval)
afs_setpag(AFS_PROC *p, void *args, int *retval)
#else
afs_setpag(void)
#endif
@ -294,7 +294,7 @@ int
#if defined(AFS_SUN5_ENV)
afs_setpag_val(AFS_UCRED **credpp, int pagval)
#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
afs_setpag_val(struct proc *p, void *args, int *retval, int pagval)
afs_setpag_val(AFS_PROC *p, void *args, int *retval, int pagval)
#else
afs_setpag_val(int pagval)
#endif
@ -401,7 +401,7 @@ afs_getpag_val(void)
/* Note - needs to be available on AIX, others can be static - rework this */
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
AddPag(struct proc *p, afs_int32 aval, AFS_UCRED **credpp)
AddPag(AFS_PROC *p, afs_int32 aval, AFS_UCRED **credpp)
#else
int
AddPag(afs_int32 aval, AFS_UCRED **credpp)

View File

@ -173,9 +173,9 @@ int afspag_PSetTokens(char *ain, afs_int32 ainSize, AFS_UCRED **acred)
if (set_parent_pag) {
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#if defined(AFS_DARWIN_ENV)
struct proc *p = current_proc(); /* XXX */
AFS_PROC *p = current_proc(); /* XXX */
#else
struct proc *p = curproc; /* XXX */
AFS_PROC *p = curproc; /* XXX */
#endif
#ifndef AFS_DARWIN80_ENV
uprintf("Process %d (%s) tried to change pags in PSetTokens\n",

View File

@ -419,7 +419,7 @@ afs_xioctl(struct afs_ioctl_sys *uap, rval_t *rvp)
{
#elif defined(AFS_OSF_ENV)
int
afs_xioctl(struct proc *p, void *args, long *retval)
afs_xioctl(AFS_PROC *p, void *args, long *retval)
{
struct a {
long fd;
@ -432,7 +432,7 @@ int
afs_xioctl(struct thread *td, register struct ioctl_args *uap,
register_t *retval)
{
struct proc *p = td->td_proc;
AFS_PROC *p = td->td_proc;
#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
struct ioctl_args {
int fd;
@ -441,7 +441,7 @@ struct ioctl_args {
};
int
afs_xioctl(struct proc *p, register struct ioctl_args *uap, register_t *retval)
afs_xioctl(AFS_PROC *p, register struct ioctl_args *uap, register_t *retval)
{
#elif defined(AFS_LINUX22_ENV)
struct afs_ioctl_sys {
@ -712,7 +712,7 @@ afs_pioctl(struct pioctlargs *uap, rval_t * rvp)
}
#elif defined(AFS_OSF_ENV)
afs_pioctl(struct proc *p, void *args, int *retval)
afs_pioctl(AFS_PROC *p, void *args, int *retval)
{
struct a {
char *path;
@ -743,7 +743,7 @@ afs_pioctl(struct thread *td, void *args, int *retval)
#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
afs_pioctl(struct proc *p, void *args, int *retval)
afs_pioctl(AFS_PROC *p, void *args, int *retval)
{
struct a {
char *path;
@ -1567,9 +1567,9 @@ DECL_PIOCTL(PSetTokens)
afs_uint32 pag;
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#if defined(AFS_DARWIN_ENV)
struct proc *p = current_proc(); /* XXX */
AFS_PROC *p = current_proc(); /* XXX */
#else
struct proc *p = curproc; /* XXX */
AFS_PROC *p = curproc; /* XXX */
#endif
#ifndef AFS_DARWIN80_ENV
uprintf("Process %d (%s) tried to change pags in PSetTokens\n",

View File

@ -569,7 +569,7 @@ extern void shutdown_osinet(void);
#if defined(AFS_SUN5_ENV)
extern int afs_setpag(AFS_UCRED **credpp);
#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int afs_setpag(struct proc *p, void *args, int *retval);
extern int afs_setpag(AFS_PROC *p, void *args, int *retval);
#else
extern int afs_setpag(void);
#endif
@ -577,7 +577,7 @@ extern int afs_setpag(void);
extern afs_uint32 genpag(void);
extern afs_uint32 getpag(void);
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
extern int AddPag(struct proc *p, afs_int32 aval, AFS_UCRED **credpp);
extern int AddPag(AFS_PROC *p, afs_int32 aval, AFS_UCRED **credpp);
#else
extern int AddPag(afs_int32 aval, AFS_UCRED **credpp);
#endif
@ -697,7 +697,7 @@ extern int usr_setpag(struct usr_ucred **cred, afs_uint32 pagvalue,
#else
# if defined AFS_XBSD_ENV
# if !defined(AFS_DFBSD_ENV)
extern int setpag(struct proc *proc, struct ucred **cred, afs_uint32 pagvalue,
extern int setpag(AFS_PROC *proc, struct ucred **cred, afs_uint32 pagvalue,
afs_uint32 * newpag, int change_parent);
# endif
# endif

View File

@ -485,7 +485,7 @@ struct afssysa64 {
afs_int32 syscall;
};
int
afs3_syscall(struct proc *p, void *args, unsigned int *retval)
afs3_syscall(AFS_PROC *p, void *args, unsigned int *retval)
{
struct afssysa64 *uap64 = NULL;
struct afssysa *uap = NULL;
@ -495,7 +495,7 @@ afs3_syscall(p, args, retval)
#ifdef AFS_FBSD50_ENV
struct thread *p;
#else
struct proc *p;
AFS_PROC *p;
#endif
void *args;
long *retval;

View File

@ -38,7 +38,7 @@ struct afs_bozoLock {
short count; /* count of excl locks */
char flags; /* bit 1: is anyone waiting? */
char spare; /* for later */
char *proc; /* process holding the lock, really a struct proc * */
char *proc; /* process holding the lock, really an AFS_PROC * */
};
#ifndef AFS_NOBOZO_LOCK
typedef struct afs_bozoLock afs_bozoLock_t;
@ -107,7 +107,7 @@ typedef struct kthread * afs_lock_tracker_t;
#define MyPidxx (u.u_kthreadp)
#define MyPidxx2Pid(x) (x ? kt_tid(x) : 0)
#else
typedef struct proc * afs_lock_tracker_t;
typedef AFS_PROC * afs_lock_tracker_t;
#define MyPidxx (u.u_procp)
#define MyPidxx2Pid(x) (x ? (afs_int32)p_pid(x) : 0)
#endif