summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/msdosfs')
-rw-r--r--sys/fs/msdosfs/denode.h2
-rw-r--r--sys/fs/msdosfs/msdosfs_denode.c24
-rw-r--r--sys/fs/msdosfs/msdosfs_lookup.c22
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c94
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c82
5 files changed, 112 insertions, 112 deletions
diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h
index f7ba83b..6083de6 100644
--- a/sys/fs/msdosfs/denode.h
+++ b/sys/fs/msdosfs/denode.h
@@ -280,6 +280,6 @@ int dosdirempty __P((struct denode *dep));
int createde __P((struct denode *dep, struct denode *ddep, struct denode **depp, struct componentname *cnp));
int deupdat __P((struct denode *dep, int waitfor));
int removede __P((struct denode *pdep, struct denode *dep));
-int detrunc __P((struct denode *dep, u_long length, int flags, struct ucred *cred, struct proc *p));
+int detrunc __P((struct denode *dep, u_long length, int flags, struct ucred *cred, struct thread *td));
int doscheckpath __P(( struct denode *source, struct denode *target));
#endif /* _KERNEL */
diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index bf176bd..8ab7f11 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -125,7 +125,7 @@ msdosfs_hashget(dev, dirclust, diroff)
u_long dirclust;
u_long diroff;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct denode *dep;
struct vnode *vp;
@@ -139,7 +139,7 @@ loop:
vp = DETOV(dep);
mtx_lock(&vp->v_interlock);
mtx_unlock(&dehash_mtx);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td))
goto loop;
return (dep);
}
@@ -209,7 +209,7 @@ deget(pmp, dirclust, diroffset, depp)
struct denode *ldep;
struct vnode *nvp;
struct buf *bp;
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct timeval tv;
#ifdef MSDOSFS_DEBUG
@@ -278,7 +278,7 @@ deget(pmp, dirclust, diroffset, depp)
* of at the start of msdosfs_hashins() so that reinsert() can
* call msdosfs_hashins() with a locked denode.
*/
- if (VOP_LOCK(nvp, LK_EXCLUSIVE, p) != 0)
+ if (VOP_LOCK(nvp, LK_EXCLUSIVE, td) != 0)
panic("deget: unexpected lock failure");
/*
@@ -414,12 +414,12 @@ deupdat(dep, waitfor)
* Truncate the file described by dep to the length specified by length.
*/
int
-detrunc(dep, length, flags, cred, p)
+detrunc(dep, length, flags, cred, td)
struct denode *dep;
u_long length;
int flags;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
int error;
int allerror;
@@ -520,7 +520,7 @@ detrunc(dep, length, flags, cred, p)
dep->de_FileSize = length;
if (!isadir)
dep->de_flag |= DE_UPDATE|DE_MODIFIED;
- allerror = vtruncbuf(DETOV(dep), cred, p, length, pmp->pm_bpcluster);
+ allerror = vtruncbuf(DETOV(dep), cred, td, length, pmp->pm_bpcluster);
#ifdef MSDOSFS_DEBUG
if (allerror)
printf("detrunc(): vtruncbuf error %d\n", allerror);
@@ -671,12 +671,12 @@ int
msdosfs_inactive(ap)
struct vop_inactive_args /* {
struct vnode *a_vp;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
struct denode *dep = VTODE(vp);
- struct proc *p = ap->a_p;
+ struct thread *td = ap->a_td;
int error = 0;
#ifdef MSDOSFS_DEBUG
@@ -702,14 +702,14 @@ msdosfs_inactive(ap)
dep, dep->de_refcnt, vp->v_mount->mnt_flag, MNT_RDONLY);
#endif
if (dep->de_refcnt <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
- error = detrunc(dep, (u_long) 0, 0, NOCRED, p);
+ error = detrunc(dep, (u_long) 0, 0, NOCRED, td);
dep->de_flag |= DE_UPDATE;
dep->de_Name[0] = SLOT_DELETED;
}
deupdat(dep, 0);
out:
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
/*
* If we are done with the denode, reclaim it
* so that it can be reused immediately.
@@ -719,6 +719,6 @@ out:
dep->de_Name[0]);
#endif
if (dep->de_Name[0] == SLOT_DELETED)
- vrecycle(vp, NULL, p);
+ vrecycle(vp, NULL, td);
return (error);
}
diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c
index 987ac3b..3f0bb76 100644
--- a/sys/fs/msdosfs/msdosfs_lookup.c
+++ b/sys/fs/msdosfs/msdosfs_lookup.c
@@ -110,7 +110,7 @@ msdosfs_lookup(ap)
u_char dosfilename[12];
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
int unlen;
int wincnt = 1;
@@ -340,7 +340,7 @@ notfound:
* Access for write is interpreted as allowing
* creation of files in the directory.
*/
- error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_proc);
+ error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_thread);
if (error)
return (error);
/*
@@ -365,7 +365,7 @@ notfound:
*/
cnp->cn_flags |= SAVENAME;
if (!lockparent) {
- VOP_UNLOCK(vdp, 0, p);
+ VOP_UNLOCK(vdp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
return (EJUSTRETURN);
@@ -438,7 +438,7 @@ foundroot:
/*
* Write access to directory required to delete files.
*/
- error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_proc);
+ error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_thread);
if (error)
return (error);
@@ -456,7 +456,7 @@ foundroot:
return (error);
*vpp = DETOV(tdp);
if (!lockparent) {
- VOP_UNLOCK(vdp, 0, p);
+ VOP_UNLOCK(vdp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
return (0);
@@ -473,7 +473,7 @@ foundroot:
if (blkoff == MSDOSFSROOT_OFS)
return EROFS; /* really? XXX */
- error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_proc);
+ error = VOP_ACCESS(vdp, VWRITE, cnp->cn_cred, cnp->cn_thread);
if (error)
return (error);
@@ -489,7 +489,7 @@ foundroot:
*vpp = DETOV(tdp);
cnp->cn_flags |= SAVENAME;
if (!lockparent) {
- VOP_UNLOCK(vdp, 0, p);
+ VOP_UNLOCK(vdp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
return (0);
@@ -516,16 +516,16 @@ foundroot:
*/
pdp = vdp;
if (flags & ISDOTDOT) {
- VOP_UNLOCK(pdp, 0, p);
+ VOP_UNLOCK(pdp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
error = deget(pmp, cluster, blkoff, &tdp);
if (error) {
- vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
cnp->cn_flags &= ~PDIRUNLOCK;
return (error);
}
if (lockparent && (flags & ISLASTCN)) {
- error = vn_lock(pdp, LK_EXCLUSIVE, p);
+ error = vn_lock(pdp, LK_EXCLUSIVE, td);
if (error) {
vput(DETOV(tdp));
return (error);
@@ -540,7 +540,7 @@ foundroot:
if ((error = deget(pmp, cluster, blkoff, &tdp)) != 0)
return (error);
if (!lockparent || !(flags & ISLASTCN)) {
- VOP_UNLOCK(pdp, 0, p);
+ VOP_UNLOCK(pdp, 0, td);
cnp->cn_flags |= PDIRUNLOCK;
}
*vpp = DETOV(tdp);
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index 1962daf..cd1e404 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -88,17 +88,17 @@ static MALLOC_DEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOSFS file allocation table
static int update_mp __P((struct mount *mp, struct msdosfs_args *argp));
static int mountmsdosfs __P((struct vnode *devvp, struct mount *mp,
- struct proc *p, struct msdosfs_args *argp));
+ struct thread *td, struct msdosfs_args *argp));
static int msdosfs_fhtovp __P((struct mount *, struct fid *,
struct vnode **));
static int msdosfs_mount __P((struct mount *, char *, caddr_t,
- struct nameidata *, struct proc *));
+ struct nameidata *, struct thread *));
static int msdosfs_root __P((struct mount *, struct vnode **));
static int msdosfs_statfs __P((struct mount *, struct statfs *,
- struct proc *));
+ struct thread *));
static int msdosfs_sync __P((struct mount *, int, struct ucred *,
- struct proc *));
-static int msdosfs_unmount __P((struct mount *, int, struct proc *));
+ struct thread *));
+static int msdosfs_unmount __P((struct mount *, int, struct thread *));
static int msdosfs_vptofh __P((struct vnode *, struct fid *));
static int
@@ -159,7 +159,7 @@ int
msdosfs_mountroot()
{
register struct mount *mp;
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
size_t size;
int error;
struct msdosfs_args args;
@@ -189,13 +189,13 @@ msdosfs_mountroot()
}
if ((error = update_mp(mp, &args)) != 0) {
- (void)msdosfs_unmount(mp, 0, p);
+ (void)msdosfs_unmount(mp, 0, td);
free(mp, M_MOUNT);
return (error);
}
if ((error = vfs_lock(mp)) != 0) {
- (void)msdosfs_unmount(mp, 0, p);
+ (void)msdosfs_unmount(mp, 0, td);
free(mp, M_MOUNT);
return (error);
}
@@ -208,7 +208,7 @@ msdosfs_mountroot()
(void) copystr(ROOTNAME, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
- (void)msdosfs_statfs(mp, &mp->mnt_stat, p);
+ (void)msdosfs_statfs(mp, &mp->mnt_stat, td);
vfs_unlock(mp);
return (0);
}
@@ -220,12 +220,12 @@ msdosfs_mountroot()
* special file to treat as a filesystem.
*/
static int
-msdosfs_mount(mp, path, data, ndp, p)
+msdosfs_mount(mp, path, data, ndp, td)
struct mount *mp;
char *path;
caddr_t data;
struct nameidata *ndp;
- struct proc *p;
+ struct thread *td;
{
struct vnode *devvp; /* vnode for blk device to mount */
struct msdosfs_args args; /* will hold data from mount request */
@@ -263,16 +263,16 @@ msdosfs_mount(mp, path, data, ndp, p)
* If upgrade to read-write by non-root, then verify
* that user has necessary permissions on the device.
*/
- if (p->p_ucred->cr_uid != 0) {
+ if (td->td_proc->p_ucred->cr_uid != 0) {
devvp = pmp->pm_devvp;
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = VOP_ACCESS(devvp, VREAD | VWRITE,
- p->p_ucred, p);
+ td->td_proc->p_ucred, td);
if (error) {
- VOP_UNLOCK(devvp, 0, p);
+ VOP_UNLOCK(devvp, 0, td);
return (error);
}
- VOP_UNLOCK(devvp, 0, p);
+ VOP_UNLOCK(devvp, 0, td);
}
pmp->pm_flags &= ~MSDOSFSMNT_RONLY;
}
@@ -295,7 +295,7 @@ msdosfs_mount(mp, path, data, ndp, p)
* Not an update, or updating the name: look up the name
* and verify that it refers to a sensible block device.
*/
- NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p);
+ NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, td);
error = namei(ndp);
if (error)
return (error);
@@ -310,20 +310,20 @@ msdosfs_mount(mp, path, data, ndp, p)
* If mount by non-root, then verify that user has necessary
* permissions on the device.
*/
- if (p->p_ucred->cr_uid != 0) {
+ if (td->td_proc->p_ucred->cr_uid != 0) {
accessmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ error = VOP_ACCESS(devvp, accessmode, td->td_proc->p_ucred, td);
if (error) {
vput(devvp);
return (error);
}
- VOP_UNLOCK(devvp, 0, p);
+ VOP_UNLOCK(devvp, 0, td);
}
if ((mp->mnt_flag & MNT_UPDATE) == 0) {
- error = mountmsdosfs(devvp, mp, p, &args);
+ error = mountmsdosfs(devvp, mp, td, &args);
#ifdef MSDOSFS_DEBUG /* only needed for the printf below */
pmp = VFSTOMSDOSFS(mp);
#endif
@@ -340,13 +340,13 @@ msdosfs_mount(mp, path, data, ndp, p)
error = update_mp(mp, &args);
if (error) {
- msdosfs_unmount(mp, MNT_FORCE, p);
+ msdosfs_unmount(mp, MNT_FORCE, td);
return error;
}
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
- (void) msdosfs_statfs(mp, &mp->mnt_stat, p);
+ (void) msdosfs_statfs(mp, &mp->mnt_stat, td);
#ifdef MSDOSFS_DEBUG
printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap);
#endif
@@ -354,10 +354,10 @@ msdosfs_mount(mp, path, data, ndp, p)
}
static int
-mountmsdosfs(devvp, mp, p, argp)
+mountmsdosfs(devvp, mp, td, argp)
struct vnode *devvp;
struct mount *mp;
- struct proc *p;
+ struct thread *td;
struct msdosfs_args *argp;
{
struct msdosfsmount *pmp;
@@ -386,16 +386,16 @@ mountmsdosfs(devvp, mp, p, argp)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
return (EBUSY);
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0);
- VOP_UNLOCK(devvp, 0, p);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0);
+ VOP_UNLOCK(devvp, 0, td);
if (error)
return (error);
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
- VOP_UNLOCK(devvp, 0, p);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td);
+ VOP_UNLOCK(devvp, 0, td);
if (error)
return (error);
@@ -415,7 +415,7 @@ mountmsdosfs(devvp, mp, p, argp)
* Let's check it...
*/
error = VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart,
- FREAD, NOCRED, p);
+ FREAD, NOCRED, td);
if (error)
goto error_exit;
tmp = dpart.part->p_fstype;
@@ -724,7 +724,7 @@ mountmsdosfs(devvp, mp, p, argp)
error_exit:
if (bp)
brelse(bp);
- (void) VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, p);
+ (void) VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE, NOCRED, td);
if (pmp) {
if (pmp->pm_inusemap)
free(pmp->pm_inusemap, M_MSDOSFSFAT);
@@ -738,10 +738,10 @@ error_exit:
* Unmount the filesystem described by mp.
*/
static int
-msdosfs_unmount(mp, mntflags, p)
+msdosfs_unmount(mp, mntflags, td)
struct mount *mp;
int mntflags;
- struct proc *p;
+ struct thread *td;
{
struct msdosfsmount *pmp;
int error, flags;
@@ -778,7 +778,7 @@ msdosfs_unmount(mp, mntflags, p)
#endif
error = VOP_CLOSE(pmp->pm_devvp,
(pmp->pm_flags&MSDOSFSMNT_RONLY) ? FREAD : FREAD | FWRITE,
- NOCRED, p);
+ NOCRED, td);
vrele(pmp->pm_devvp);
free(pmp->pm_inusemap, M_MSDOSFSFAT);
free(pmp, M_MSDOSFSMNT);
@@ -807,10 +807,10 @@ msdosfs_root(mp, vpp)
}
static int
-msdosfs_statfs(mp, sbp, p)
+msdosfs_statfs(mp, sbp, td)
struct mount *mp;
struct statfs *sbp;
- struct proc *p;
+ struct thread *td;
{
struct msdosfsmount *pmp;
@@ -832,11 +832,11 @@ msdosfs_statfs(mp, sbp, p)
}
static int
-msdosfs_sync(mp, waitfor, cred, p)
+msdosfs_sync(mp, waitfor, cred, td)
struct mount *mp;
int waitfor;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
struct vnode *vp, *nvp;
struct denode *dep;
@@ -879,17 +879,17 @@ loop:
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)
goto loop;
continue;
}
- error = VOP_FSYNC(vp, cred, waitfor, p);
+ error = VOP_FSYNC(vp, cred, waitfor, td);
if (error)
allerror = error;
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
vrele(vp);
mtx_lock(&mntvnode_mtx);
}
@@ -899,11 +899,11 @@ loop:
* Flush filesystem control info.
*/
if (waitfor != MNT_LAZY) {
- vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY, p);
- error = VOP_FSYNC(pmp->pm_devvp, cred, waitfor, p);
+ vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ error = VOP_FSYNC(pmp->pm_devvp, cred, waitfor, td);
if (error)
allerror = error;
- VOP_UNLOCK(pmp->pm_devvp, 0, p);
+ VOP_UNLOCK(pmp->pm_devvp, 0, td);
}
return (allerror);
}
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 77d2760..bbdcecb 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -211,7 +211,7 @@ msdosfs_close(ap)
struct vnode *a_vp;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -233,7 +233,7 @@ msdosfs_access(ap)
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -273,7 +273,7 @@ msdosfs_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct denode *dep = VTODE(ap->a_vp);
@@ -339,7 +339,7 @@ msdosfs_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -351,7 +351,7 @@ msdosfs_setattr(ap)
#ifdef MSDOSFS_DEBUG
printf("msdosfs_setattr(): vp %p, vap %p, cred %p, p %p\n",
- ap->a_vp, vap, cred, ap->a_p);
+ ap->a_vp, vap, cred, ap->a_td);
#endif
/*
@@ -376,7 +376,7 @@ msdosfs_setattr(ap)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != pmp->pm_uid &&
- (error = suser_xxx(cred, ap->a_p, PRISON_ROOT)))
+ (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)))
return (error);
/*
* We are very inconsistent about handling unsupported
@@ -417,7 +417,7 @@ msdosfs_setattr(ap)
gid = pmp->pm_gid;
if ((cred->cr_uid != pmp->pm_uid || uid != pmp->pm_uid ||
(gid != pmp->pm_gid && !groupmember(gid, cred))) &&
- (error = suser_xxx(cred, ap->a_p, PRISON_ROOT)))
+ (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)))
return error;
if (uid != pmp->pm_uid || gid != pmp->pm_gid)
return EINVAL;
@@ -441,7 +441,7 @@ msdosfs_setattr(ap)
default:
break;
}
- error = detrunc(dep, vap->va_size, 0, cred, ap->a_p);
+ error = detrunc(dep, vap->va_size, 0, cred, ap->a_td);
if (error)
return error;
}
@@ -449,9 +449,9 @@ msdosfs_setattr(ap)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != pmp->pm_uid &&
- (error = suser_xxx(cred, ap->a_p, PRISON_ROOT)) &&
+ (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)) &&
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
- (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_p))))
+ (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_td))))
return (error);
if (vp->v_type != VDIR) {
if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 &&
@@ -472,7 +472,7 @@ msdosfs_setattr(ap)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != pmp->pm_uid &&
- (error = suser_xxx(cred, ap->a_p, PRISON_ROOT)))
+ (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)))
return (error);
if (vp->v_type != VDIR) {
/* We ignore the read and execute bits. */
@@ -601,7 +601,7 @@ msdosfs_write(ap)
struct buf *bp;
int ioflag = ap->a_ioflag;
struct uio *uio = ap->a_uio;
- struct proc *p = uio->uio_procp;
+ struct thread *td = uio->uio_td;
struct vnode *vp = ap->a_vp;
struct vnode *thisvp;
struct denode *dep = VTODE(vp);
@@ -636,12 +636,12 @@ msdosfs_write(ap)
/*
* If they've exceeded their filesize limit, tell them about it.
*/
- if (p &&
+ if (td &&
((uoff_t)uio->uio_offset + uio->uio_resid >
- p->p_rlimit[RLIMIT_FSIZE].rlim_cur)) {
- PROC_LOCK(p);
- psignal(p, SIGXFSZ);
- PROC_UNLOCK(p);
+ td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur)) {
+ PROC_LOCK(td->td_proc);
+ psignal(td->td_proc, SIGXFSZ);
+ PROC_UNLOCK(td->td_proc);
return (EFBIG);
}
@@ -795,7 +795,7 @@ msdosfs_fsync(ap)
struct vnode *a_vp;
struct ucred *a_cred;
int a_waitfor;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -931,7 +931,7 @@ msdosfs_rename(ap)
struct vnode *tvp = ap->a_tvp;
struct componentname *tcnp = ap->a_tcnp;
struct componentname *fcnp = ap->a_fcnp;
- struct proc *p = fcnp->cn_proc;
+ struct thread *td = fcnp->cn_thread;
struct denode *ip, *xp, *dp, *zp;
u_char toname[11], oldname[11];
u_long from_diroffset, to_diroffset;
@@ -987,7 +987,7 @@ abortit:
goto abortit;
}
- error = vn_lock(fvp, LK_EXCLUSIVE, p);
+ error = vn_lock(fvp, LK_EXCLUSIVE, td);
if (error)
goto abortit;
dp = VTODE(fdvp);
@@ -1008,7 +1008,7 @@ abortit:
(fcnp->cn_flags & ISDOTDOT) ||
(tcnp->cn_flags & ISDOTDOT) ||
(ip->de_flag & DE_RENAME)) {
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
error = EINVAL;
goto abortit;
}
@@ -1038,8 +1038,8 @@ abortit:
* to namei, as the parent directory is unlocked by the
* call to doscheckpath().
*/
- error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc);
- VOP_UNLOCK(fvp, 0, p);
+ error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread);
+ VOP_UNLOCK(fvp, 0, td);
if (VTODE(fdvp)->de_StartCluster != VTODE(tdvp)->de_StartCluster)
newparent = 1;
if (doingdirectory && newparent) {
@@ -1108,7 +1108,7 @@ abortit:
if ((fcnp->cn_flags & SAVESTART) == 0)
panic("msdosfs_rename: lost from startdir");
if (!newparent)
- VOP_UNLOCK(tdvp, 0, p);
+ VOP_UNLOCK(tdvp, 0, td);
if (relookup(fdvp, &fvp, fcnp) == 0)
vrele(fdvp);
if (fvp == NULL) {
@@ -1119,7 +1119,7 @@ abortit:
panic("rename: lost dir entry");
vrele(ap->a_fvp);
if (newparent)
- VOP_UNLOCK(tdvp, 0, p);
+ VOP_UNLOCK(tdvp, 0, td);
vrele(tdvp);
return 0;
}
@@ -1139,9 +1139,9 @@ abortit:
if (doingdirectory)
panic("rename: lost dir entry");
vrele(ap->a_fvp);
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
if (newparent)
- VOP_UNLOCK(fdvp, 0, p);
+ VOP_UNLOCK(fdvp, 0, td);
xp = NULL;
} else {
vrele(fvp);
@@ -1163,8 +1163,8 @@ abortit:
if (error) {
bcopy(oldname, ip->de_Name, 11);
if (newparent)
- VOP_UNLOCK(fdvp, 0, p);
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fdvp, 0, td);
+ VOP_UNLOCK(fvp, 0, td);
goto bad;
}
ip->de_refcnt++;
@@ -1173,8 +1173,8 @@ abortit:
if (error) {
/* XXX should really panic here, fs is corrupt */
if (newparent)
- VOP_UNLOCK(fdvp, 0, p);
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fdvp, 0, td);
+ VOP_UNLOCK(fvp, 0, td);
goto bad;
}
if (!doingdirectory) {
@@ -1183,8 +1183,8 @@ abortit:
if (error) {
/* XXX should really panic here, fs is corrupt */
if (newparent)
- VOP_UNLOCK(fdvp, 0, p);
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fdvp, 0, td);
+ VOP_UNLOCK(fvp, 0, td);
goto bad;
}
if (ip->de_dirclust == MSDOSFSROOT)
@@ -1194,7 +1194,7 @@ abortit:
}
reinsert(ip);
if (newparent)
- VOP_UNLOCK(fdvp, 0, p);
+ VOP_UNLOCK(fdvp, 0, td);
}
/*
@@ -1213,7 +1213,7 @@ abortit:
if (error) {
/* XXX should really panic here, fs is corrupt */
brelse(bp);
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
goto bad;
}
dotdotp = (struct direntry *)bp->b_data + 1;
@@ -1223,12 +1223,12 @@ abortit:
error = bwrite(bp);
if (error) {
/* XXX should really panic here, fs is corrupt */
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
goto bad;
}
}
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
bad:
if (xp)
vput(tvp);
@@ -1392,7 +1392,7 @@ msdosfs_rmdir(ap)
register struct vnode *dvp = ap->a_dvp;
register struct componentname *cnp = ap->a_cnp;
register struct denode *ip, *dp;
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
int error;
ip = VTODE(vp);
@@ -1427,14 +1427,14 @@ msdosfs_rmdir(ap)
* the name cache.
*/
cache_purge(dvp);
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
/*
* Truncate the directory that is being deleted.
*/
- error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred, p);
+ error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred, td);
cache_purge(vp);
- vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
out:
return (error);
}
OpenPOWER on IntegriCloud