summaryrefslogtreecommitdiffstats
path: root/sys/fs/cd9660
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/cd9660')
-rw-r--r--sys/fs/cd9660/cd9660_lookup.c10
-rw-r--r--sys/fs/cd9660/cd9660_node.c17
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c74
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c10
4 files changed, 55 insertions, 56 deletions
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c
index b2d5057..979c0bd 100644
--- a/sys/fs/cd9660/cd9660_lookup.c
+++ b/sys/fs/cd9660/cd9660_lookup.c
@@ -120,7 +120,7 @@ cd9660_lookup(ap)
struct componentname *cnp = ap->a_cnp;
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
bp = NULL;
*vpp = NULL;
@@ -351,16 +351,16 @@ found:
* it's a relocated directory.
*/
if (flags & ISDOTDOT) {
- VOP_UNLOCK(pdp, 0, p); /* race to get the inode */
+ VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
error = cd9660_vget_internal(vdp->v_mount, dp->i_ino, &tdp,
dp->i_ino != ino, ep);
brelse(bp);
if (error) {
- vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
}
if (lockparent && (flags & ISLASTCN)) {
- if ((error = vn_lock(pdp, LK_EXCLUSIVE, p)) != 0) {
+ if ((error = vn_lock(pdp, LK_EXCLUSIVE, td)) != 0) {
cnp->cn_flags |= PDIRUNLOCK;
vput(tdp);
return (error);
@@ -380,7 +380,7 @@ found:
return (error);
if (!lockparent || !(flags & ISLASTCN)) {
cnp->cn_flags |= PDIRUNLOCK;
- VOP_UNLOCK(pdp, 0, p);
+ VOP_UNLOCK(pdp, 0, td);
}
*vpp = tdp;
}
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index 00f79e8..53ffeca 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -97,7 +97,7 @@ cd9660_ihashget(dev, inum)
dev_t dev;
ino_t inum;
{
- struct proc *p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
struct iso_node *ip;
struct vnode *vp;
@@ -108,7 +108,7 @@ loop:
vp = ITOV(ip);
mtx_lock(&vp->v_interlock);
mtx_unlock(&cd9660_ihash_mtx);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td))
goto loop;
return (vp);
}
@@ -124,7 +124,6 @@ void
cd9660_ihashins(ip)
struct iso_node *ip;
{
- struct proc *p = curproc; /* XXX */
struct iso_node **ipp, *iq;
mtx_lock(&cd9660_ihash_mtx);
@@ -136,7 +135,7 @@ cd9660_ihashins(ip)
*ipp = ip;
mtx_unlock(&cd9660_ihash_mtx);
- lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct mtx *)0, p);
+ lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct mtx *)0, curthread);
}
/*
@@ -167,11 +166,11 @@ int
cd9660_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 proc *p = ap->a_p;
+ struct thread *td = ap->a_td;
register struct iso_node *ip = VTOI(vp);
int error = 0;
@@ -179,13 +178,13 @@ cd9660_inactive(ap)
vprint("cd9660_inactive: pushing active", vp);
ip->i_flag = 0;
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
/*
* If we are done with the inode, reclaim it
* so that it can be reused immediately.
*/
if (ip->inode.iso_mode == 0)
- vrecycle(vp, NULL, p);
+ vrecycle(vp, NULL, td);
return error;
}
@@ -196,7 +195,7 @@ int
cd9660_reclaim(ap)
struct vop_reclaim_args /* {
struct vnode *a_vp;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 0b42933..73a5bce 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -65,10 +65,10 @@ MALLOC_DEFINE(M_ISOFSMNT, "ISOFS mount", "ISOFS mount structure");
MALLOC_DEFINE(M_ISOFSNODE, "ISOFS node", "ISOFS vnode private part");
static int cd9660_mount __P((struct mount *,
- char *, caddr_t, struct nameidata *, struct proc *));
-static int cd9660_unmount __P((struct mount *, int, struct proc *));
+ char *, caddr_t, struct nameidata *, struct thread *));
+static int cd9660_unmount __P((struct mount *, int, struct thread *));
static int cd9660_root __P((struct mount *, struct vnode **));
-static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *));
+static int cd9660_statfs __P((struct mount *, struct statfs *, struct thread *));
static int cd9660_vget __P((struct mount *, ino_t, struct vnode **));
static int cd9660_fhtovp __P((struct mount *, struct fid *, struct vnode **));
static int cd9660_vptofh __P((struct vnode *, struct fid *));
@@ -97,9 +97,9 @@ MODULE_VERSION(cd9660, 1);
* Called by vfs_mountroot when iso is going to be mounted as root.
*/
-static int iso_get_ssector __P((dev_t dev, struct proc *p));
+static int iso_get_ssector __P((dev_t dev, struct thread *td));
static int iso_mountfs __P((struct vnode *devvp, struct mount *mp,
- struct proc *p, struct iso_args *argp));
+ struct thread *td, struct iso_args *argp));
/*
* Try to find the start of the last data track on this CD-ROM. This
@@ -107,9 +107,9 @@ static int iso_mountfs __P((struct vnode *devvp, struct mount *mp,
* and return 0 if we fail, this is always a safe bet.
*/
static int
-iso_get_ssector(dev, p)
+iso_get_ssector(dev, td)
dev_t dev;
- struct proc *p;
+ struct thread *td;
{
struct ioc_toc_header h;
struct ioc_read_toc_single_entry t;
@@ -122,13 +122,13 @@ iso_get_ssector(dev, p)
if (ioctlp == NULL)
return 0;
- if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) != 0)
+ if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, td) != 0)
return 0;
for (i = h.ending_track; i >= 0; i--) {
t.address_format = CD_LBA_FORMAT;
t.track = i;
- if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) != 0)
+ if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, td) != 0)
return 0;
if ((t.entry.control & 4) != 0)
/* found a data track */
@@ -141,12 +141,12 @@ iso_get_ssector(dev, p)
return ntohl(t.entry.addr.lba);
}
-static int iso_mountroot __P((struct mount *mp, struct proc *p));
+static int iso_mountroot __P((struct mount *mp, struct thread *td));
static int
-iso_mountroot(mp, p)
+iso_mountroot(mp, td)
struct mount *mp;
- struct proc *p;
+ struct thread *td;
{
struct iso_args args;
int error;
@@ -156,14 +156,14 @@ iso_mountroot(mp, p)
return (error);
}
args.flags = ISOFSMNT_ROOT;
- args.ssector = iso_get_ssector(rootdev, p);
+ args.ssector = iso_get_ssector(rootdev, td);
if (bootverbose)
printf("iso_mountroot(): using session at block %d\n",
args.ssector);
- if ((error = iso_mountfs(rootvp, mp, p, &args)) != 0)
+ if ((error = iso_mountfs(rootvp, mp, td, &args)) != 0)
return (error);
- (void)cd9660_statfs(mp, &mp->mnt_stat, p);
+ (void)cd9660_statfs(mp, &mp->mnt_stat, td);
return (0);
}
@@ -173,12 +173,12 @@ iso_mountroot(mp, p)
* mount system call
*/
static int
-cd9660_mount(mp, path, data, ndp, p)
+cd9660_mount(mp, path, data, ndp, td)
register struct mount *mp;
char *path;
caddr_t data;
struct nameidata *ndp;
- struct proc *p;
+ struct thread *td;
{
struct vnode *devvp;
struct iso_args args;
@@ -188,7 +188,7 @@ cd9660_mount(mp, path, data, ndp, p)
struct iso_mnt *imp = 0;
if ((mp->mnt_flag & MNT_ROOTFS) != 0) {
- return (iso_mountroot(mp, p));
+ return (iso_mountroot(mp, td));
}
if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args))))
return (error);
@@ -209,7 +209,7 @@ cd9660_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);
if ((error = namei(ndp)))
return (error);
NDFREE(ndp, NDF_ONLY_PNBUF);
@@ -225,18 +225,18 @@ cd9660_mount(mp, path, data, ndp, p)
* or has superuser abilities
*/
accessmode = VREAD;
- 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)
- error = suser(p);
+ error = suser_td(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 = iso_mountfs(devvp, mp, p, &args);
+ error = iso_mountfs(devvp, mp, td, &args);
} else {
if (devvp != imp->im_devvp)
error = EINVAL; /* needs translation */
@@ -251,7 +251,7 @@ cd9660_mount(mp, path, data, ndp, p)
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
- (void) cd9660_statfs(mp, &mp->mnt_stat, p);
+ (void) cd9660_statfs(mp, &mp->mnt_stat, td);
return 0;
}
@@ -259,10 +259,10 @@ cd9660_mount(mp, path, data, ndp, p)
* Common code for mount and mountroot
*/
static int
-iso_mountfs(devvp, mp, p, argp)
+iso_mountfs(devvp, mp, td, argp)
register struct vnode *devvp;
struct mount *mp;
- struct proc *p;
+ struct thread *td;
struct iso_args *argp;
{
register struct iso_mnt *isomp = (struct iso_mnt *)0;
@@ -295,12 +295,12 @@ iso_mountfs(devvp, mp, p, argp)
return error;
if (vcount(devvp) > 1 && devvp != rootvp)
return EBUSY;
- if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)))
+ if ((error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0)))
return (error);
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- error = VOP_OPEN(devvp, FREAD, FSCRED, p);
- VOP_UNLOCK(devvp, 0, p);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ error = VOP_OPEN(devvp, FREAD, FSCRED, td);
+ VOP_UNLOCK(devvp, 0, td);
if (error)
return error;
@@ -510,7 +510,7 @@ out:
if (supbp)
brelse(supbp);
if (needclose)
- (void)VOP_CLOSE(devvp, FREAD, NOCRED, p);
+ (void)VOP_CLOSE(devvp, FREAD, NOCRED, td);
if (isomp) {
free((caddr_t)isomp, M_ISOFSMNT);
mp->mnt_data = (qaddr_t)0;
@@ -522,10 +522,10 @@ out:
* unmount system call
*/
static int
-cd9660_unmount(mp, mntflags, p)
+cd9660_unmount(mp, mntflags, td)
struct mount *mp;
int mntflags;
- struct proc *p;
+ struct thread *td;
{
register struct iso_mnt *isomp;
int error, flags = 0;
@@ -543,7 +543,7 @@ cd9660_unmount(mp, mntflags, p)
isomp = VFSTOISOFS(mp);
isomp->im_devvp->v_rdev->si_mountpoint = NULL;
- error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
+ error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, td);
vrele(isomp->im_devvp);
free((caddr_t)isomp, M_ISOFSMNT);
mp->mnt_data = (qaddr_t)0;
@@ -576,10 +576,10 @@ cd9660_root(mp, vpp)
* Get file system statistics.
*/
int
-cd9660_statfs(mp, sbp, p)
+cd9660_statfs(mp, sbp, td)
struct mount *mp;
register struct statfs *sbp;
- struct proc *p;
+ struct thread *td;
{
register struct iso_mnt *isomp;
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index 702823e..a902b58 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -87,7 +87,7 @@ cd9660_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;
@@ -128,7 +128,7 @@ cd9660_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;
@@ -162,7 +162,7 @@ cd9660_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
@@ -197,7 +197,7 @@ cd9660_getattr(ap)
auio.uio_offset = 0;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = ap->a_p;
+ auio.uio_td = ap->a_td;
auio.uio_resid = MAXPATHLEN;
rdlnk.a_uio = &auio;
rdlnk.a_vp = ap->a_vp;
@@ -226,7 +226,7 @@ cd9660_ioctl(ap)
caddr_t a_data;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
OpenPOWER on IntegriCloud