summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ufs/ufs_quota.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/ufs/ufs/ufs_quota.c
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/ufs/ufs/ufs_quota.c')
-rw-r--r--sys/ufs/ufs/ufs_quota.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 6992160..4c10d88 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -386,8 +386,8 @@ chkdquot(ip)
* Q_QUOTAON - set up a quota file for a particular file system.
*/
int
-quotaon(p, mp, type, fname)
- struct proc *p;
+quotaon(td, mp, type, fname)
+ struct thread *td;
struct mount *mp;
register int type;
caddr_t fname;
@@ -400,20 +400,20 @@ quotaon(p, mp, type, fname)
struct nameidata nd;
vpp = &ump->um_quotas[type];
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fname, p);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fname, td);
flags = FREAD | FWRITE;
error = vn_open(&nd, &flags, 0);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
vp = nd.ni_vp;
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
if (vp->v_type != VREG) {
- (void) vn_close(vp, FREAD|FWRITE, p->p_ucred, p);
+ (void) vn_close(vp, FREAD|FWRITE, td->td_proc->p_ucred, td);
return (EACCES);
}
if (*vpp != vp)
- quotaoff(p, mp, type);
+ quotaoff(td, mp, type);
ump->um_qflags[type] |= QTF_OPENING;
mp->mnt_flag |= MNT_QUOTA;
vp->v_flag |= VSYSTEM;
@@ -422,8 +422,8 @@ quotaon(p, mp, type, fname)
* Save the credential of the process that turned on quotas.
* Set up the time limits for this quota.
*/
- crhold(p->p_ucred);
- ump->um_cred[type] = p->p_ucred;
+ crhold(td->td_proc->p_ucred);
+ ump->um_cred[type] = td->td_proc->p_ucred;
ump->um_btime[type] = MAX_DQ_TIME;
ump->um_itime[type] = MAX_IQ_TIME;
if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
@@ -452,7 +452,7 @@ again:
mtx_lock(&mntvnode_mtx);
continue;
}
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
mtx_lock(&mntvnode_mtx);
goto again;
}
@@ -467,7 +467,7 @@ again:
mtx_unlock(&mntvnode_mtx);
ump->um_qflags[type] &= ~QTF_OPENING;
if (error)
- quotaoff(p, mp, type);
+ quotaoff(td, mp, type);
return (error);
}
@@ -475,8 +475,8 @@ again:
* Q_QUOTAOFF - turn off disk quotas for a filesystem.
*/
int
-quotaoff(p, mp, type)
- struct proc *p;
+quotaoff(td, mp, type)
+ struct thread *td;
struct mount *mp;
register int type;
{
@@ -508,7 +508,7 @@ again:
mtx_lock(&mntvnode_mtx);
continue;
}
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
mtx_lock(&mntvnode_mtx);
goto again;
}
@@ -524,7 +524,7 @@ again:
mtx_unlock(&mntvnode_mtx);
dqflush(qvp);
qvp->v_flag &= ~VSYSTEM;
- error = vn_close(qvp, FREAD|FWRITE, p->p_ucred, p);
+ error = vn_close(qvp, FREAD|FWRITE, td->td_proc->p_ucred, td);
ump->um_quotas[type] = NULLVP;
crfree(ump->um_cred[type]);
ump->um_cred[type] = NOCRED;
@@ -675,7 +675,7 @@ qsync(mp)
struct mount *mp;
{
struct ufsmount *ump = VFSTOUFS(mp);
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct vnode *vp, *nextvp;
struct dquot *dq;
int i, error;
@@ -706,7 +706,7 @@ again:
mtx_lock(&mntvnode_mtx);
continue;
}
- error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p);
+ error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td);
if (error) {
mtx_lock(&mntvnode_mtx);
if (error == ENOENT)
@@ -765,7 +765,7 @@ dqget(vp, id, ump, type, dqp)
register int type;
struct dquot **dqp;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct dquot *dq;
struct dqhash *dqh;
struct vnode *dqvp;
@@ -821,7 +821,7 @@ dqget(vp, id, ump, type, dqp)
* Initialize the contents of the dquot structure.
*/
if (vp != dqvp)
- vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td);
LIST_INSERT_HEAD(dqh, dq, dq_hash);
DQREF(dq);
dq->dq_flags = DQ_LOCK;
@@ -836,12 +836,12 @@ dqget(vp, id, ump, type, dqp)
auio.uio_offset = (off_t)(id * sizeof (struct dqblk));
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
- auio.uio_procp = (struct proc *)0;
+ auio.uio_td = (struct thread *)0;
error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]);
if (auio.uio_resid == sizeof(struct dqblk) && error == 0)
bzero((caddr_t)&dq->dq_dqb, sizeof(struct dqblk));
if (vp != dqvp)
- VOP_UNLOCK(dqvp, 0, p);
+ VOP_UNLOCK(dqvp, 0, td);
if (dq->dq_flags & DQ_WANT)
wakeup((caddr_t)dq);
dq->dq_flags = 0;
@@ -915,7 +915,7 @@ dqsync(vp, dq)
struct vnode *vp;
struct dquot *dq;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct vnode *dqvp;
struct iovec aiov;
struct uio auio;
@@ -929,13 +929,13 @@ dqsync(vp, dq)
panic("dqsync: file");
(void) vn_write_suspend_wait(dqvp, NULL, V_WAIT);
if (vp != dqvp)
- vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td);
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
(void) tsleep((caddr_t)dq, PINOD+2, "dqsync", 0);
if ((dq->dq_flags & DQ_MOD) == 0) {
if (vp != dqvp)
- VOP_UNLOCK(dqvp, 0, p);
+ VOP_UNLOCK(dqvp, 0, td);
return (0);
}
}
@@ -948,7 +948,7 @@ dqsync(vp, dq)
auio.uio_offset = (off_t)(dq->dq_id * sizeof (struct dqblk));
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_WRITE;
- auio.uio_procp = (struct proc *)0;
+ auio.uio_td = (struct thread *)0;
error = VOP_WRITE(dqvp, &auio, 0, dq->dq_ump->um_cred[dq->dq_type]);
if (auio.uio_resid && error == 0)
error = EIO;
@@ -956,7 +956,7 @@ dqsync(vp, dq)
wakeup((caddr_t)dq);
dq->dq_flags &= ~(DQ_MOD|DQ_LOCK|DQ_WANT);
if (vp != dqvp)
- VOP_UNLOCK(dqvp, 0, p);
+ VOP_UNLOCK(dqvp, 0, td);
return (error);
}
OpenPOWER on IntegriCloud