summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-02-27 18:32:23 +0000
committerjhb <jhb@FreeBSD.org>2002-02-27 18:32:23 +0000
commit3706cd350927f08fa8742cce9448c9ba8e4d6b2c (patch)
treede74317436bc6bf8211535e1dbda3f6762d05582 /sys/ufs
parentec01b5bdbc40025303ba133be03a747c8dc62a2c (diff)
downloadFreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.zip
FreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.tar.gz
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c2
-rw-r--r--sys/ufs/ffs/ffs_softdep.c18
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c12
-rw-r--r--sys/ufs/ufs/ufs_extattr.c18
-rw-r--r--sys/ufs/ufs/ufs_lookup.c4
-rw-r--r--sys/ufs/ufs/ufs_quota.c6
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c4
7 files changed, 32 insertions, 32 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index e88cc15..f740c9f 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -207,7 +207,7 @@ restart:
*/
for (blkno = NDADDR; blkno < numblks; blkno += NINDIR(fs)) {
error = UFS_BALLOC(vp, lblktosize(fs, (off_t)blkno),
- fs->fs_bsize, td->td_proc->p_ucred, B_METAONLY, &ibp);
+ fs->fs_bsize, td->td_ucred, B_METAONLY, &ibp);
if (error)
goto out;
bdwrite(ibp);
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 05da93e..9aaf4bd 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -812,7 +812,7 @@ softdep_flushworklist(oldmnt, countp, td)
while ((count = softdep_process_worklist(oldmnt)) > 0) {
*countp += count;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
- error = VOP_FSYNC(devvp, td->td_proc->p_ucred, MNT_WAIT, td);
+ error = VOP_FSYNC(devvp, td->td_ucred, MNT_WAIT, td);
VOP_UNLOCK(devvp, 0, td);
if (error)
break;
@@ -3078,7 +3078,7 @@ handle_workitem_remove(dirrem)
}
inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
FREE_LOCK(&lk);
- if ((error = UFS_TRUNCATE(vp, (off_t)0, 0, td->td_proc->p_ucred, td)) != 0)
+ if ((error = UFS_TRUNCATE(vp, (off_t)0, 0, td->td_ucred, td)) != 0)
softdep_error("handle_workitem_remove: truncate", error);
/*
* Rename a directory to a new parent. Since, we are both deleting
@@ -4245,7 +4245,7 @@ softdep_fsync(vp)
return (error);
}
if ((pagedep->pd_state & NEWBLOCK) &&
- (error = VOP_FSYNC(pvp, td->td_proc->p_ucred, MNT_WAIT, td))) {
+ (error = VOP_FSYNC(pvp, td->td_ucred, MNT_WAIT, td))) {
vput(pvp);
return (error);
}
@@ -4253,7 +4253,7 @@ softdep_fsync(vp)
/*
* Flush directory page containing the inode's name.
*/
- error = bread(pvp, lbn, blksize(fs, VTOI(pvp), lbn), td->td_proc->p_ucred,
+ error = bread(pvp, lbn, blksize(fs, VTOI(pvp), lbn), td->td_ucred,
&bp);
if (error == 0)
error = BUF_WRITE(bp);
@@ -4730,8 +4730,8 @@ flush_pagedep_deps(pvp, mp, diraddhdp)
FREE_LOCK(&lk);
if ((error = VFS_VGET(mp, inum, &vp)) != 0)
break;
- if ((error=VOP_FSYNC(vp, td->td_proc->p_ucred, MNT_NOWAIT, td)) ||
- (error=VOP_FSYNC(vp, td->td_proc->p_ucred, MNT_NOWAIT, td))) {
+ if ((error=VOP_FSYNC(vp, td->td_ucred, MNT_NOWAIT, td)) ||
+ (error=VOP_FSYNC(vp, td->td_ucred, MNT_NOWAIT, td))) {
vput(vp);
break;
}
@@ -4997,7 +4997,7 @@ clear_remove(td)
vn_finished_write(mp);
return;
}
- if ((error = VOP_FSYNC(vp, td->td_proc->p_ucred, MNT_NOWAIT, td)))
+ if ((error = VOP_FSYNC(vp, td->td_ucred, MNT_NOWAIT, td)))
softdep_error("clear_remove: fsync", error);
drain_output(vp, 0);
vput(vp);
@@ -5071,10 +5071,10 @@ clear_inodedeps(td)
return;
}
if (ino == lastino) {
- if ((error = VOP_FSYNC(vp, td->td_proc->p_ucred, MNT_WAIT, td)))
+ if ((error = VOP_FSYNC(vp, td->td_ucred, MNT_WAIT, td)))
softdep_error("clear_inodedeps: fsync1", error);
} else {
- if ((error = VOP_FSYNC(vp, td->td_proc->p_ucred, MNT_NOWAIT, td)))
+ if ((error = VOP_FSYNC(vp, td->td_ucred, MNT_NOWAIT, td)))
softdep_error("clear_inodedeps: fsync2", error);
drain_output(vp, 0);
}
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 9025767..091fd64 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -230,7 +230,7 @@ ffs_mount(mp, path, data, ndp, td)
if (suser_td(td)) {
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
if ((error = VOP_ACCESS(devvp, VREAD | VWRITE,
- td->td_proc->p_ucred, td)) != 0) {
+ td->td_ucred, td)) != 0) {
VOP_UNLOCK(devvp, 0, td);
return (error);
}
@@ -261,7 +261,7 @@ ffs_mount(mp, path, data, ndp, td)
}
/* check to see if we need to start softdep */
if ((fs->fs_flags & FS_DOSOFTDEP) &&
- (error = softdep_mount(devvp, mp, fs, td->td_proc->p_ucred))){
+ (error = softdep_mount(devvp, mp, fs, td->td_ucred))){
vn_finished_write(mp);
return (error);
}
@@ -313,7 +313,7 @@ ffs_mount(mp, path, data, ndp, td)
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
- if ((error = VOP_ACCESS(devvp, accessmode, td->td_proc->p_ucred, td))!= 0){
+ if ((error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td))!= 0){
vput(devvp);
return (error);
}
@@ -409,7 +409,7 @@ ffs_reload(mp, cred, td)
*/
if (vn_isdisk(devvp, NULL)) {
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
- vfs_object_create(devvp, td, td->td_proc->p_ucred);
+ vfs_object_create(devvp, td, td->td_ucred);
mtx_lock(&devvp->v_interlock);
VOP_UNLOCK(devvp, LK_INTERLOCK, td);
}
@@ -556,7 +556,7 @@ ffs_mountfs(devvp, mp, td, malloctype)
int ncount;
dev = devvp->v_rdev;
- cred = td ? td->td_proc->p_ucred : NOCRED;
+ cred = td ? td->td_ucred : NOCRED;
/*
* Disallow multiple mounts of the same device.
* Disallow mounting of a device that is currently in use
@@ -942,7 +942,7 @@ ffs_flushfiles(mp, flags, td)
* Flush filesystem metadata.
*/
vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td);
- error = VOP_FSYNC(ump->um_devvp, td->td_proc->p_ucred, MNT_WAIT, td);
+ error = VOP_FSYNC(ump->um_devvp, td->td_ucred, MNT_WAIT, td);
VOP_UNLOCK(ump->um_devvp, 0, td);
return (error);
}
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index 09645a1..2ab61fb 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -224,7 +224,7 @@ ufs_extattr_start(struct mount *mp, struct thread *td)
ump->um_extattr.uepm_flags |= UFS_EXTATTR_UEPM_STARTED;
- ump->um_extattr.uepm_ucred = crhold(td->td_proc->p_ucred);
+ ump->um_extattr.uepm_ucred = crhold(td->td_ucred);
unlock:
ufs_extattr_uepm_unlock(ump, td);
@@ -258,7 +258,7 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname,
if (lockparent == UE_GETDIR_LOCKPARENT)
cnp.cn_flags |= LOCKPARENT;
cnp.cn_thread = td;
- cnp.cn_cred = td->td_proc->p_ucred;
+ cnp.cn_cred = td->td_ucred;
cnp.cn_pnbuf = zalloc(namei_zone);
cnp.cn_nameptr = cnp.cn_pnbuf;
error = copystr(dirname, cnp.cn_pnbuf, MAXPATHLEN,
@@ -330,7 +330,7 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
{
int error;
- error = VOP_OPEN(vp, FREAD|FWRITE, td->td_proc->p_ucred, td);
+ error = VOP_OPEN(vp, FREAD|FWRITE, td->td_ucred, td);
if (error) {
printf("ufs_extattr_enable_with_open.VOP_OPEN(): failed "
"with %d\n", error);
@@ -344,7 +344,7 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
*/
if (vn_canvmio(vp) == TRUE)
if ((error = vfs_object_create(vp, td,
- td->td_proc->p_ucred)) != 0) {
+ td->td_ucred)) != 0) {
/*
* XXX: bug replicated from vn_open(): should
* VOP_CLOSE() here.
@@ -361,7 +361,7 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, td);
if (error != 0)
- vn_close(vp, FREAD|FWRITE, td->td_proc->p_ucred, td);
+ vn_close(vp, FREAD|FWRITE, td->td_ucred, td);
return (error);
}
@@ -400,7 +400,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp,
vargs.a_desc = NULL;
vargs.a_vp = dvp;
vargs.a_uio = &auio;
- vargs.a_cred = td->td_proc->p_ucred;
+ vargs.a_cred = td->td_ucred;
vargs.a_eofflag = &eofflag;
vargs.a_ncookies = NULL;
vargs.a_cookies = NULL;
@@ -631,7 +631,7 @@ ufs_extattr_enable(struct ufsmount *ump, int attrnamespace,
auio.uio_rw = UIO_READ;
auio.uio_td = td;
- VOP_LEASE(backing_vnode, td, td->td_proc->p_ucred, LEASE_WRITE);
+ VOP_LEASE(backing_vnode, td, td->td_ucred, LEASE_WRITE);
vn_lock(backing_vnode, LK_SHARED | LK_NOPAUSE | LK_RETRY, td);
error = VOP_READ(backing_vnode, &auio, IO_NODELOCKED,
ump->um_extattr.uepm_ucred);
@@ -692,7 +692,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
uele->uele_backing_vnode->v_flag &= ~VSYSTEM;
error = vn_close(uele->uele_backing_vnode, FREAD|FWRITE,
- td->td_proc->p_ucred, td);
+ td->td_ucred, td);
FREE(uele, M_UFS_EXTATTR);
@@ -715,7 +715,7 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
* Processes with privilege, but in jail, are not allowed to
* configure extended attributes.
*/
- if ((error = suser_xxx(td->td_proc->p_ucred, td->td_proc, 0))) {
+ if ((error = suser_xxx(td->td_ucred, td->td_proc, 0))) {
if (filename_vp != NULL)
VOP_UNLOCK(filename_vp, 0, td);
return (error);
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index ee7df3d..bbb07af 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -749,7 +749,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
char *dirbuf;
td = curthread; /* XXX */
- cr = td->td_proc->p_ucred;
+ cr = td->td_ucred;
dp = VTOI(dvp);
newentrysize = DIRSIZ(OFSFMT(dvp), dirp);
@@ -819,7 +819,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
return (error);
if (tvp != NULL)
VOP_UNLOCK(tvp, 0, td);
- error = VOP_FSYNC(dvp, td->td_proc->p_ucred, MNT_WAIT, td);
+ error = VOP_FSYNC(dvp, td->td_ucred, MNT_WAIT, td);
if (tvp != NULL)
vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 7abf70c..7c31bb0 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -409,7 +409,7 @@ quotaon(td, mp, type, fname)
vp = nd.ni_vp;
VOP_UNLOCK(vp, 0, td);
if (vp->v_type != VREG) {
- (void) vn_close(vp, FREAD|FWRITE, td->td_proc->p_ucred, td);
+ (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td);
return (EACCES);
}
if (*vpp != vp)
@@ -422,7 +422,7 @@ quotaon(td, mp, type, fname)
* Save the credential of the process that turned on quotas.
* Set up the time limits for this quota.
*/
- ump->um_cred[type] = crhold(td->td_proc->p_ucred);
+ ump->um_cred[type] = crhold(td->td_ucred);
ump->um_btime[type] = MAX_DQ_TIME;
ump->um_itime[type] = MAX_IQ_TIME;
if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
@@ -523,7 +523,7 @@ again:
mtx_unlock(&mntvnode_mtx);
dqflush(qvp);
qvp->v_flag &= ~VSYSTEM;
- error = vn_close(qvp, FREAD|FWRITE, td->td_proc->p_ucred, td);
+ error = vn_close(qvp, FREAD|FWRITE, td->td_ucred, td);
ump->um_quotas[type] = NULLVP;
crfree(ump->um_cred[type]);
ump->um_cred[type] = NOCRED;
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 7b42452..e6cbd6c 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -108,14 +108,14 @@ ufs_quotactl(mp, cmds, uid, arg, td)
int cmd, type, error;
if (uid == -1)
- uid = td->td_proc->p_ucred->cr_ruid;
+ uid = td->td_ucred->cr_ruid;
cmd = cmds >> SUBCMDSHIFT;
switch (cmd) {
case Q_SYNC:
break;
case Q_GETQUOTA:
- if (uid == td->td_proc->p_ucred->cr_ruid)
+ if (uid == td->td_ucred->cr_ruid)
break;
/* fall through */
default:
OpenPOWER on IntegriCloud