From 76ae0f51892a703d7bd4aea5fdcf60c586e4a440 Mon Sep 17 00:00:00 2001 From: "matt@linuxbox.com" Date: Sat, 10 Oct 2009 09:09:53 -0400 Subject: [PATCH] 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 Tested-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- src/afs/IRIX/osi_machdep.h | 2 ++ src/afs/UKERNEL/osi_machdep.h | 2 ++ src/afs/VNOPS/afs_vnop_flock.c | 10 +++++----- src/afs/afs_init.c | 8 ++++---- src/afs/afs_osi.c | 2 +- src/afs/afs_osi_gcpags.c | 12 ++++++------ src/afs/afs_osi_pag.c | 6 +++--- src/afs/afs_pag_cred.c | 4 ++-- src/afs/afs_pioctl.c | 14 +++++++------- src/afs/afs_prototypes.h | 6 +++--- src/afs/afs_syscall.c | 4 ++-- src/afs/lock.h | 4 ++-- 12 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/afs/IRIX/osi_machdep.h b/src/afs/IRIX/osi_machdep.h index 10023b636f..7e5ce60cf8 100644 --- a/src/afs/IRIX/osi_machdep.h +++ b/src/afs/IRIX/osi_machdep.h @@ -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) diff --git a/src/afs/UKERNEL/osi_machdep.h b/src/afs/UKERNEL/osi_machdep.h index 646f42cfa1..2eea2ba0b4 100644 --- a/src/afs/UKERNEL/osi_machdep.h +++ b/src/afs/UKERNEL/osi_machdep.h @@ -28,6 +28,8 @@ #define AFS_UCRED struct usr_ucred +#define AFS_PROC struct usr_proc + #define AFS_KALLOC(A) afs_osi_Alloc(A) /* diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 22f4f4b8b9..62a78c0fb7 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -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) diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 46df030c3a..2b1cae72ad 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -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; diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index 9c4caf9e06..b2d8c28bb2 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -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; diff --git a/src/afs/afs_osi_gcpags.c b/src/afs/afs_osi_gcpags.c index f7ec4d81e1..0565183aa5 100644 --- a/src/afs/afs_osi_gcpags.c +++ b/src/afs/afs_osi_gcpags.c @@ -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; diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index ab059112f1..efc2da5284 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -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) diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c index 6f61bfee40..fae552877b 100644 --- a/src/afs/afs_pag_cred.c +++ b/src/afs/afs_pag_cred.c @@ -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", diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 3a7a9eba0f..ba23ebfaa4 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -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", diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index a1b3500336..aa5715660a 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -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 diff --git a/src/afs/afs_syscall.c b/src/afs/afs_syscall.c index 52c2b475f9..02fcb404ee 100644 --- a/src/afs/afs_syscall.c +++ b/src/afs/afs_syscall.c @@ -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; diff --git a/src/afs/lock.h b/src/afs/lock.h index 3e22707168..3dc881298e 100644 --- a/src/afs/lock.h +++ b/src/afs/lock.h @@ -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