mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 13:38:01 +00:00
getpid-20050429
rename our getpid() to osi_getpid() to avoid name collision with kernel version
This commit is contained in:
parent
a15d665e1d
commit
ff6259a9c4
@ -72,13 +72,14 @@ extern struct simplelock afs_rxglobal_lock;
|
|||||||
extern struct vop_vector afs_vnodeops;
|
extern struct vop_vector afs_vnodeops;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef osi_getpid
|
||||||
#if defined(AFS_FBSD50_ENV)
|
#if defined(AFS_FBSD50_ENV)
|
||||||
#define VT_AFS "afs"
|
#define VT_AFS "afs"
|
||||||
#define VROOT VV_ROOT
|
#define VROOT VV_ROOT
|
||||||
#define v_flag v_vflag
|
#define v_flag v_vflag
|
||||||
#define osi_curcred() (curthread->td_ucred)
|
#define osi_curcred() (curthread->td_ucred)
|
||||||
#define afs_suser(x) (!suser(curthread))
|
#define afs_suser(x) (!suser(curthread))
|
||||||
#define getpid() (curthread->td_proc->p_pid)
|
#define osi_getpid() (curthread->td_proc->p_pid)
|
||||||
#define simple_lock(x) mtx_lock(x)
|
#define simple_lock(x) mtx_lock(x)
|
||||||
#define simple_unlock(x) mtx_unlock(x)
|
#define simple_unlock(x) mtx_unlock(x)
|
||||||
#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
|
#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
|
||||||
@ -93,7 +94,7 @@ extern struct lock afs_global_lock;
|
|||||||
|
|
||||||
#define osi_curcred() (curproc->p_cred->pc_ucred)
|
#define osi_curcred() (curproc->p_cred->pc_ucred)
|
||||||
#define afs_suser(x) (!suser(curproc))
|
#define afs_suser(x) (!suser(curproc))
|
||||||
#define getpid() (curproc->p_pid)
|
#define osi_getpid() (curproc->p_pid)
|
||||||
#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
|
#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
|
||||||
vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc)
|
vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc)
|
||||||
extern struct proc *afs_global_owner;
|
extern struct proc *afs_global_owner;
|
||||||
|
@ -190,6 +190,8 @@ typedef struct {
|
|||||||
typedef struct timeval osi_timeval_t;
|
typedef struct timeval osi_timeval_t;
|
||||||
#endif /* AFS_SGI61_ENV */
|
#endif /* AFS_SGI61_ENV */
|
||||||
|
|
||||||
|
#define osi_getpid() getpid()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* osi_ThreadUnique() should yield a value that can be found in ps
|
* osi_ThreadUnique() should yield a value that can be found in ps
|
||||||
* output in order to draw correspondences between ICL traces and what
|
* output in order to draw correspondences between ICL traces and what
|
||||||
|
@ -141,39 +141,40 @@ getpag(void)
|
|||||||
|
|
||||||
static int afs_pag_sleepcnt = 0;
|
static int afs_pag_sleepcnt = 0;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
afs_pag_sleep(struct AFS_UCRED **acred)
|
afs_pag_sleep(struct AFS_UCRED **acred)
|
||||||
{
|
{
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
if(!afs_suser(acred)) {
|
|
||||||
if(osi_Time() - pag_epoch < pagCounter) {
|
|
||||||
rv = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
if (!afs_suser(acred)) {
|
||||||
|
if(osi_Time() - pag_epoch < pagCounter) {
|
||||||
|
rv = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
afs_pag_wait(struct AFS_UCRED **acred)
|
afs_pag_wait(struct AFS_UCRED **acred)
|
||||||
{
|
{
|
||||||
if(afs_pag_sleep(acred)) {
|
if (afs_pag_sleep(acred)) {
|
||||||
if(!afs_pag_sleepcnt) {
|
if (!afs_pag_sleepcnt) {
|
||||||
printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n",
|
printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n",
|
||||||
"afs_pag_wait", getpid(), afs_pag_sleepcnt);
|
"afs_pag_wait", osi_getpid(), afs_pag_sleepcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
afs_pag_sleepcnt++;
|
|
||||||
|
|
||||||
do {
|
|
||||||
/* XXX spins on EINTR */
|
|
||||||
afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
|
|
||||||
} while(afs_pag_sleep(acred));
|
|
||||||
|
|
||||||
afs_pag_sleepcnt--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
afs_pag_sleepcnt++;
|
||||||
|
|
||||||
|
do {
|
||||||
|
/* XXX spins on EINTR */
|
||||||
|
afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
|
||||||
|
} while (afs_pag_sleep(acred));
|
||||||
|
|
||||||
|
afs_pag_sleepcnt--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user