summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/gnu/fs')
-rw-r--r--sys/gnu/fs/ext2fs/ext2_extern.h2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode.c6
-rw-r--r--sys/gnu/fs/ext2fs/ext2_lookup.c30
-rw-r--r--sys/gnu/fs/ext2fs/ext2_mount.h2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_readwrite.c16
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c120
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vnops.c44
-rw-r--r--sys/gnu/fs/ext2fs/fs.h4
8 files changed, 112 insertions, 112 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_extern.h b/sys/gnu/fs/ext2fs/ext2_extern.h
index b37b3ec..580683b 100644
--- a/sys/gnu/fs/ext2fs/ext2_extern.h
+++ b/sys/gnu/fs/ext2fs/ext2_extern.h
@@ -62,7 +62,7 @@ int ext2_init __P((struct vfsconf *));
int ext2_reallocblks __P((struct vop_reallocblks_args *));
int ext2_reclaim __P((struct vop_reclaim_args *));
void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t));
-int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
+int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct thread *));
int ext2_update __P((struct vnode *, int));
int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ext2_vfree __P((struct vnode *, ino_t, int));
diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c
index 5a60006..6a3e011 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode.c
@@ -129,12 +129,12 @@ ext2_update(vp, waitfor)
* disk blocks.
*/
int
-ext2_truncate(vp, length, flags, cred, p)
+ext2_truncate(vp, length, flags, cred, td)
struct vnode *vp;
off_t length;
int flags;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
register struct vnode *ovp = vp;
register daddr_t lastblock;
@@ -268,7 +268,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks);
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks);
oip->i_size = osize;
- error = vtruncbuf(ovp, cred, p, length, (int)fs->s_blocksize);
+ error = vtruncbuf(ovp, cred, td, length, (int)fs->s_blocksize);
if (error && (allerror == 0))
allerror = error;
diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c
index 4804ff1..b2e1511 100644
--- a/sys/gnu/fs/ext2fs/ext2_lookup.c
+++ b/sys/gnu/fs/ext2fs/ext2_lookup.c
@@ -322,7 +322,7 @@ ext2_lookup(ap)
struct ucred *cred = cnp->cn_cred;
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->s_blocksize;
@@ -503,7 +503,7 @@ searchloop:
* Access for write is interpreted as allowing
* creation of files in the directory.
*/
- if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0)
return (error);
/*
* Return an indication of where the new directory
@@ -541,7 +541,7 @@ searchloop:
*/
cnp->cn_flags |= SAVENAME;
if (!lockparent)
- VOP_UNLOCK(vdp, 0, p);
+ VOP_UNLOCK(vdp, 0, td);
return (EJUSTRETURN);
}
/*
@@ -584,7 +584,7 @@ found:
/*
* Write access to directory required to delete files.
*/
- if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0)
return (error);
/*
* Return pointer to current entry in dp->i_offset,
@@ -618,7 +618,7 @@ found:
}
*vpp = tdp;
if (!lockparent)
- VOP_UNLOCK(vdp, 0, p);
+ VOP_UNLOCK(vdp, 0, td);
return (0);
}
@@ -630,7 +630,7 @@ found:
*/
if (nameiop == RENAME && wantparent &&
(flags & ISLASTCN)) {
- if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0)
+ if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0)
return (error);
/*
* Careful about locking second inode.
@@ -643,7 +643,7 @@ found:
*vpp = tdp;
cnp->cn_flags |= SAVENAME;
if (!lockparent)
- VOP_UNLOCK(vdp, 0, p);
+ VOP_UNLOCK(vdp, 0, td);
return (0);
}
@@ -668,13 +668,13 @@ found:
*/
pdp = vdp;
if (flags & ISDOTDOT) {
- VOP_UNLOCK(pdp, 0, p); /* race to get the inode */
+ VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) {
- vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
}
if (lockparent && (flags & ISLASTCN) &&
- (error = vn_lock(pdp, LK_EXCLUSIVE, p))) {
+ (error = vn_lock(pdp, LK_EXCLUSIVE, td))) {
vput(tdp);
return (error);
}
@@ -686,7 +686,7 @@ found:
if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0)
return (error);
if (!lockparent || !(flags & ISLASTCN))
- VOP_UNLOCK(pdp, 0, p);
+ VOP_UNLOCK(pdp, 0, td);
*vpp = tdp;
}
@@ -799,7 +799,7 @@ ext2_direnter(ip, dvp, cnp)
auio.uio_iovcnt = 1;
auio.uio_rw = UIO_WRITE;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = (struct proc *)0;
+ auio.uio_td = (struct thread *)0;
error = VOP_WRITE(dvp, &auio, IO_SYNC, cnp->cn_cred);
if (DIRBLKSIZ >
VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_bsize)
@@ -880,7 +880,7 @@ ext2_direnter(ip, dvp, cnp)
dp->i_flag |= IN_CHANGE | IN_UPDATE;
if (!error && dp->i_endoff && dp->i_endoff < dp->i_size)
error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC,
- cnp->cn_cred, cnp->cn_proc);
+ cnp->cn_cred, cnp->cn_thread);
return (error);
}
@@ -983,7 +983,7 @@ ext2_dirempty(ip, parentino, cred)
for (off = 0; off < ip->i_size; off += dp->rec_len) {
error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off,
- UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0);
+ UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct thread *)0);
/*
* Since we read MINDIRSIZ, residual must
* be 0 unless we're at end of file.
@@ -1047,7 +1047,7 @@ ext2_checkpath(source, target, cred)
}
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE,
- IO_NODELOCKED, cred, (int *)0, (struct proc *)0);
+ IO_NODELOCKED, cred, (int *)0, (struct thread *)0);
if (error != 0)
break;
namlen = dirbuf.dotdot_type; /* like ufs little-endian */
diff --git a/sys/gnu/fs/ext2fs/ext2_mount.h b/sys/gnu/fs/ext2fs/ext2_mount.h
index 4c73aa3..85c9866 100644
--- a/sys/gnu/fs/ext2fs/ext2_mount.h
+++ b/sys/gnu/fs/ext2fs/ext2_mount.h
@@ -88,7 +88,7 @@ struct ufsmount {
int um_i_effnlink_valid; /* i_effnlink valid? */
int (*um_balloc) __P((struct vnode *, off_t, int, struct ucred *, int, struct buf **));
int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
- int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
+ int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct thread *));
int (*um_update) __P((struct vnode *, int));
int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **));
int (*um_vfree) __P((struct vnode *, ino_t, int));
diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c
index 62bc27a..2772f7b 100644
--- a/sys/gnu/fs/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c
@@ -172,7 +172,7 @@ WRITE(ap)
register struct inode *ip;
register FS *fs;
struct buf *bp;
- struct proc *p;
+ struct thread *td;
daddr_t lbn;
off_t osize;
int seqcount;
@@ -216,15 +216,15 @@ WRITE(ap)
* Maybe this should be above the vnode op call, but so long as
* file servers have no limits, I don't think it matters.
*/
- p = uio->uio_procp;
+ td = uio->uio_td;
/* For p_rlimit. */
mtx_assert(&Giant, MA_OWNED);
- if (vp->v_type == VREG && p &&
+ if (vp->v_type == VREG && td &&
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);
}
@@ -302,7 +302,7 @@ WRITE(ap)
if (error) {
if (ioflag & IO_UNIT) {
(void)UFS_TRUNCATE(vp, osize,
- ioflag & IO_SYNC, ap->a_cred, uio->uio_procp);
+ ioflag & IO_SYNC, ap->a_cred, uio->uio_td);
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 7263615..713a0cb 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -71,16 +71,16 @@
#include <gnu/ext2fs/ext2_fs_sb.h>
static int ext2_fhtovp __P((struct mount *, struct fid *, struct vnode **));
-static int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p));
+static int ext2_flushfiles __P((struct mount *mp, int flags, struct thread *td));
static int ext2_mount __P((struct mount *,
- char *, caddr_t, struct nameidata *, struct proc *));
-static int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *));
+ char *, caddr_t, struct nameidata *, struct thread *));
+static int ext2_mountfs __P((struct vnode *, struct mount *, struct thread *));
static int ext2_reload __P((struct mount *mountp, struct ucred *cred,
- struct proc *p));
+ struct thread *td));
static int ext2_sbupdate __P((struct ufsmount *, int));
-static int ext2_statfs __P((struct mount *, struct statfs *, struct proc *));
-static int ext2_sync __P((struct mount *, int, struct ucred *, struct proc *));
-static int ext2_unmount __P((struct mount *, int, struct proc *));
+static int ext2_statfs __P((struct mount *, struct statfs *, struct thread *));
+static int ext2_sync __P((struct mount *, int, struct ucred *, struct thread *));
+static int ext2_unmount __P((struct mount *, int, struct thread *));
static int ext2_vget __P((struct mount *, ino_t, struct vnode **));
static int ext2_vptofh __P((struct vnode *, struct fid *));
@@ -130,7 +130,7 @@ ext2_mountroot()
{
register struct ext2_sb_info *fs;
register struct mount *mp;
- struct proc *p = curproc;
+ struct thread *td = curthread;
struct ufsmount *ump;
u_int size;
int error;
@@ -143,12 +143,12 @@ ext2_mountroot()
bzero((char *)mp, (u_long)sizeof(struct mount));
mp->mnt_op = &ext2fs_vfsops;
mp->mnt_flag = MNT_RDONLY;
- if (error = ext2_mountfs(rootvp, mp, p)) {
+ if (error = ext2_mountfs(rootvp, mp, td)) {
bsd_free(mp, M_MOUNT);
return (error);
}
if (error = vfs_lock(mp)) {
- (void)ext2_unmount(mp, 0, p);
+ (void)ext2_unmount(mp, 0, td);
bsd_free(mp, M_MOUNT);
return (error);
}
@@ -164,7 +164,7 @@ ext2_mountroot()
(void) copystr(ROOTNAME, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
- (void)ext2_statfs(mp, &mp->mnt_stat, p);
+ (void)ext2_statfs(mp, &mp->mnt_stat, td);
vfs_unlock(mp);
inittodr(fs->s_es->s_wtime); /* this helps to set the time */
return (0);
@@ -177,12 +177,12 @@ ext2_mountroot()
* mount system call
*/
static int
-ext2_mount(mp, path, data, ndp, p)
+ext2_mount(mp, path, data, ndp, td)
register struct mount *mp;
char *path;
caddr_t data; /* this is actually a (struct ufs_args *) */
struct nameidata *ndp;
- struct proc *p;
+ struct thread *td;
{
struct vnode *devvp;
struct ufs_args args;
@@ -210,10 +210,10 @@ ext2_mount(mp, path, data, ndp, p)
flags = WRITECLOSE;
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
- if (vfs_busy(mp, LK_NOWAIT, 0, p))
+ if (vfs_busy(mp, LK_NOWAIT, 0, td))
return (EBUSY);
- error = ext2_flushfiles(mp, flags, p);
- vfs_unbusy(mp, p);
+ error = ext2_flushfiles(mp, flags, td);
+ vfs_unbusy(mp, td);
if (!error && fs->s_wasvalid) {
fs->s_es->s_state |= EXT2_VALID_FS;
ext2_sbupdate(ump, MNT_WAIT);
@@ -221,7 +221,7 @@ ext2_mount(mp, path, data, ndp, p)
fs->s_rd_only = 1;
}
if (!error && (mp->mnt_flag & MNT_RELOAD))
- error = ext2_reload(mp, ndp->ni_cnd.cn_cred, p);
+ error = ext2_reload(mp, ndp->ni_cnd.cn_cred, td);
if (error)
return (error);
devvp = ump->um_devvp;
@@ -233,14 +233,14 @@ ext2_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 (suser(p)) {
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
+ if (suser_td(td)) {
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
if ((error = VOP_ACCESS(devvp, VREAD | VWRITE,
- p->p_ucred, p)) != 0) {
- VOP_UNLOCK(devvp, 0, p);
+ td->td_proc->p_ucred, td)) != 0) {
+ VOP_UNLOCK(devvp, 0, td);
return (error);
}
- VOP_UNLOCK(devvp, 0, p);
+ VOP_UNLOCK(devvp, 0, td);
}
if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 ||
@@ -271,7 +271,7 @@ ext2_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)) != 0)
return (error);
NDFREE(ndp, NDF_ONLY_PNBUF);
@@ -286,20 +286,20 @@ ext2_mount(mp, path, data, ndp, p)
* If mount by non-root, then verify that user has necessary
* permissions on the device.
*/
- if (suser(p)) {
+ if (suser_td(td)) {
accessmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) {
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ if ((error = VOP_ACCESS(devvp, accessmode, td->td_proc->p_ucred, td)) != 0) {
vput(devvp);
return (error);
}
- VOP_UNLOCK(devvp, 0, p);
+ VOP_UNLOCK(devvp, 0, td);
}
if ((mp->mnt_flag & MNT_UPDATE) == 0) {
- error = ext2_mountfs(devvp, mp, p);
+ error = ext2_mountfs(devvp, mp, td);
} else {
if (devvp != ump->um_devvp)
error = EINVAL; /* needs translation */
@@ -321,7 +321,7 @@ ext2_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)ext2_statfs(mp, &mp->mnt_stat, p);
+ (void)ext2_statfs(mp, &mp->mnt_stat, td);
return (0);
}
@@ -522,10 +522,10 @@ static int compute_sb_data(devvp, es, fs)
* 6) re-read inode data for all active vnodes.
*/
static int
-ext2_reload(mountp, cred, p)
+ext2_reload(mountp, cred, td)
register struct mount *mountp;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
register struct vnode *vp, *nvp, *devvp;
struct inode *ip;
@@ -540,7 +540,7 @@ ext2_reload(mountp, cred, p)
* Step 1: invalidate all cached meta-data.
*/
devvp = VFSTOUFS(mountp)->um_devvp;
- if (vinvalbuf(devvp, 0, cred, p, 0, 0))
+ if (vinvalbuf(devvp, 0, cred, td, 0, 0))
panic("ext2_reload: dirty1");
/*
* Step 2: re-read superblock from disk.
@@ -578,16 +578,16 @@ loop:
/*
* Step 4: invalidate all inactive vnodes.
*/
- if (vrecycle(vp, NULL, p))
+ if (vrecycle(vp, NULL, td))
goto loop;
/*
* Step 5: invalidate all cached file data.
*/
mtx_lock(&vp->v_interlock);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
+ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
goto loop;
}
- if (vinvalbuf(vp, 0, cred, p, 0, 0))
+ if (vinvalbuf(vp, 0, cred, td, 0, 0))
panic("ext2_reload: dirty2");
/*
* Step 6: re-read inode data for all active vnodes.
@@ -615,10 +615,10 @@ loop:
* Common code for mount and mountroot
*/
static int
-ext2_mountfs(devvp, mp, p)
+ext2_mountfs(devvp, mp, td)
register struct vnode *devvp;
struct mount *mp;
- struct proc *p;
+ struct thread *td;
{
register struct ufsmount *ump;
struct buf *bp;
@@ -640,7 +640,7 @@ ext2_mountfs(devvp, mp, p)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
return (EBUSY);
- if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) != 0)
+ if ((error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0)) != 0)
return (error);
#ifdef READONLY
/* turn on this to force it to be read-only */
@@ -648,12 +648,12 @@ ext2_mountfs(devvp, mp, p)
#endif
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);
- if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, p) != 0)
+ if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, td) != 0)
size = DEV_BSIZE;
else {
havepart = 1;
@@ -739,7 +739,7 @@ ext2_mountfs(devvp, mp, p)
out:
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 (ump) {
bsd_free(ump->um_e2fs->s_es, M_UFSMNT);
bsd_free(ump->um_e2fs, M_UFSMNT);
@@ -753,10 +753,10 @@ out:
* unmount system call
*/
static int
-ext2_unmount(mp, mntflags, p)
+ext2_unmount(mp, mntflags, td)
struct mount *mp;
int mntflags;
- struct proc *p;
+ struct thread *td;
{
register struct ufsmount *ump;
register struct ext2_sb_info *fs;
@@ -768,7 +768,7 @@ ext2_unmount(mp, mntflags, p)
return (EINVAL);
flags |= FORCECLOSE;
}
- if ((error = ext2_flushfiles(mp, flags, p)) != 0)
+ if ((error = ext2_flushfiles(mp, flags, td)) != 0)
return (error);
ump = VFSTOUFS(mp);
fs = ump->um_e2fs;
@@ -795,7 +795,7 @@ ext2_unmount(mp, mntflags, p)
ump->um_devvp->v_rdev->si_mountpoint = NULL;
error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE,
- NOCRED, p);
+ NOCRED, td);
vrele(ump->um_devvp);
bsd_free(fs->s_es, M_UFSMNT);
bsd_free(fs, M_UFSMNT);
@@ -809,10 +809,10 @@ ext2_unmount(mp, mntflags, p)
* Flush out all the files in a filesystem.
*/
static int
-ext2_flushfiles(mp, flags, p)
+ext2_flushfiles(mp, flags, td)
register struct mount *mp;
int flags;
- struct proc *p;
+ struct thread *td;
{
register struct ufsmount *ump;
int error;
@@ -828,7 +828,7 @@ ext2_flushfiles(mp, flags, p)
for (i = 0; i < MAXQUOTAS; i++) {
if (ump->um_quotas[i] == NULLVP)
continue;
- quotaoff(p, mp, i);
+ quotaoff(td, mp, i);
}
/*
* Here we fall through to vflush again to ensure
@@ -845,10 +845,10 @@ ext2_flushfiles(mp, flags, p)
* taken from ext2/super.c ext2_statfs
*/
static int
-ext2_statfs(mp, sbp, p)
+ext2_statfs(mp, sbp, td)
struct mount *mp;
register struct statfs *sbp;
- struct proc *p;
+ struct thread *td;
{
unsigned long overhead;
register struct ufsmount *ump;
@@ -904,11 +904,11 @@ ext2_statfs(mp, sbp, p)
* Note: we are always called with the filesystem marked `MPBUSY'.
*/
static int
-ext2_sync(mp, waitfor, cred, p)
+ext2_sync(mp, waitfor, cred, td)
struct mount *mp;
int waitfor;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
struct vnode *nvp, *vp;
struct inode *ip;
@@ -945,16 +945,16 @@ 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;
}
- if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
+ if ((error = VOP_FSYNC(vp, cred, waitfor, td)) != 0)
allerror = error;
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
vrele(vp);
mtx_lock(&mntvnode_mtx);
}
@@ -963,10 +963,10 @@ loop:
* Force stale file system control information to be flushed.
*/
if (waitfor != MNT_LAZY) {
- vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p);
- if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, p)) != 0)
+ vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td);
+ if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, td)) != 0)
allerror = error;
- VOP_UNLOCK(ump->um_devvp, 0, p);
+ VOP_UNLOCK(ump->um_devvp, 0, td);
}
#if QUOTA
qsync(mp);
diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c
index 2bd494b..ad60728 100644
--- a/sys/gnu/fs/ext2fs/ext2_vnops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vnops.c
@@ -191,7 +191,7 @@ ext2_fsync(ap)
struct vnode *a_vp;
struct ucred *a_cred;
int a_waitfor;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -335,7 +335,7 @@ ext2_link(ap)
struct vnode *vp = ap->a_vp;
struct vnode *tdvp = ap->a_tdvp;
struct componentname *cnp = ap->a_cnp;
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
struct inode *ip;
int error;
@@ -347,7 +347,7 @@ ext2_link(ap)
error = EXDEV;
goto out2;
}
- if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) {
+ if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) {
goto out2;
}
ip = VTOI(vp);
@@ -370,7 +370,7 @@ ext2_link(ap)
}
out1:
if (tdvp != vp)
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
out2:
return (error);
}
@@ -396,7 +396,7 @@ ext2_rename(ap)
struct vnode *fdvp = ap->a_fdvp;
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 inode *ip, *xp, *dp;
struct dirtemplate dirbuf;
int doingdirectory = 0, oldparent = 0, newparent = 0;
@@ -487,18 +487,18 @@ abortit:
vput(fvp);
return (error);
}
- if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0)
+ if ((error = vn_lock(fvp, LK_EXCLUSIVE, td)) != 0)
goto abortit;
dp = VTOI(fdvp);
ip = VTOI(fvp);
if (ip->i_nlink >= LINK_MAX) {
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
error = EMLINK;
goto abortit;
}
if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND))
|| (dp->i_flags & APPEND)) {
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
error = EPERM;
goto abortit;
}
@@ -509,7 +509,7 @@ abortit:
if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') ||
dp == ip || (fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT ||
(ip->i_flag & IN_RENAME)) {
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
error = EINVAL;
goto abortit;
}
@@ -537,7 +537,7 @@ abortit:
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
if ((error = UFS_UPDATE(fvp, 1)) != 0) {
- VOP_UNLOCK(fvp, 0, p);
+ VOP_UNLOCK(fvp, 0, td);
goto bad;
}
@@ -551,8 +551,8 @@ abortit:
* to namei, as the parent directory is unlocked by the
* call to checkpath().
*/
- 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 (oldparent != dp->i_number)
newparent = dp->i_number;
if (doingdirectory && newparent) {
@@ -678,7 +678,7 @@ abortit:
if (--xp->i_nlink != 0)
panic("ufs_rename: linked directory");
error = UFS_TRUNCATE(tvp, (off_t)0, IO_SYNC,
- tcnp->cn_cred, tcnp->cn_proc);
+ tcnp->cn_cred, tcnp->cn_thread);
}
xp->i_flag |= IN_CHANGE;
vput(tvp);
@@ -732,7 +732,7 @@ abortit:
error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf,
sizeof (struct dirtemplate), (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED,
- tcnp->cn_cred, (int *)0, (struct proc *)0);
+ tcnp->cn_cred, (int *)0, (struct thread *)0);
if (error == 0) {
/* Like ufs little-endian: */
namlen = dirbuf.dotdot_type;
@@ -749,7 +749,7 @@ abortit:
(off_t)0, UIO_SYSSPACE,
IO_NODELOCKED|IO_SYNC,
tcnp->cn_cred, (int *)0,
- (struct proc *)0);
+ (struct thread *)0);
cache_purge(fdvp);
}
}
@@ -775,7 +775,7 @@ bad:
out:
if (doingdirectory)
ip->i_flag &= ~IN_RENAME;
- if (vn_lock(fvp, LK_EXCLUSIVE, p) == 0) {
+ if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) {
ip->i_nlink--;
ip->i_flag |= IN_CHANGE;
ip->i_flag &= ~IN_RENAME;
@@ -920,7 +920,7 @@ ext2_mkdir(ap)
dirtemplate.dotdot_reclen = DIRBLKSIZ - 12;
error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate,
sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE,
- IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0, (struct proc *)0);
+ IO_NODELOCKED|IO_SYNC, cnp->cn_cred, (int *)0, (struct thread *)0);
if (error) {
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
@@ -970,7 +970,7 @@ ext2_rmdir(ap)
struct vnode *vp = ap->a_vp;
struct vnode *dvp = ap->a_dvp;
struct componentname *cnp = ap->a_cnp;
- struct proc *p = cnp->cn_proc;
+ struct thread *td = cnp->cn_thread;
struct inode *ip, *dp;
int error;
@@ -1005,7 +1005,7 @@ ext2_rmdir(ap)
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
cache_purge(dvp);
- VOP_UNLOCK(dvp, 0, p);
+ VOP_UNLOCK(dvp, 0, td);
/*
* Truncate inode. The only stuff left
* in the directory is "." and "..". The
@@ -1018,9 +1018,9 @@ ext2_rmdir(ap)
* worry about them later.
*/
ip->i_nlink -= 2;
- error = UFS_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred, p);
+ error = UFS_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred, td);
cache_purge(ITOV(ip));
- vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
out:
return (error);
}
@@ -1056,7 +1056,7 @@ ext2_symlink(ap)
} else
error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, (int *)0,
- (struct proc *)0);
+ (struct thread *)0);
if (error)
vput(vp);
return (error);
diff --git a/sys/gnu/fs/ext2fs/fs.h b/sys/gnu/fs/ext2fs/fs.h
index 8bedb05..c7e96c9 100644
--- a/sys/gnu/fs/ext2fs/fs.h
+++ b/sys/gnu/fs/ext2fs/fs.h
@@ -153,8 +153,8 @@ extern u_char *fragtbl[];
* I think I'll try a VOP_LOCK/VOP_UNLOCK on the device vnode
*/
#define DEVVP(inode) (VFSTOUFS(ITOV(inode)->v_mount)->um_devvp)
-#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, curproc)
-#define unlock_super(devvp) VOP_UNLOCK(devvp, 0, curproc)
+#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, curthread)
+#define unlock_super(devvp) VOP_UNLOCK(devvp, 0, curthread)
/*
* To lock a buffer, set the B_LOCKED flag and then brelse() it. To unlock,
OpenPOWER on IntegriCloud