summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-10-11 23:38:17 +0000
committerjhb <jhb@FreeBSD.org>2001-10-11 23:38:17 +0000
commit4806d88677d2a333254f9fc33d4e119cc56bb002 (patch)
treed3ca87a8ac917d5003235cc737cd5f76591f7c1b /sys/ufs
parent9f68054d87b5538c76f0b802ef8f7344eedd5647 (diff)
downloadFreeBSD-src-4806d88677d2a333254f9fc33d4e119cc56bb002.zip
FreeBSD-src-4806d88677d2a333254f9fc33d4e119cc56bb002.tar.gz
Change the kernel's ucred API as follows:
- crhold() returns a reference to the ucred whose refcount it bumps. - crcopy() now simply copies the credentials from one credential to another and has no return value. - a new crshared() primitive is added which returns true if a ucred's refcount is > 1 and false (0) otherwise.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_extattr.c3
-rw-r--r--sys/ufs/ufs/ufs_quota.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index 60dc574..a1d523f 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -210,8 +210,7 @@ ufs_extattr_start(struct mount *mp, struct thread *td)
ump->um_extattr.uepm_flags |= UFS_EXTATTR_UEPM_STARTED;
- crhold(td->td_proc->p_ucred);
- ump->um_extattr.uepm_ucred = td->td_proc->p_ucred;
+ ump->um_extattr.uepm_ucred = crhold(td->td_proc->p_ucred);
unlock:
ufs_extattr_uepm_unlock(ump, td);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 4c10d88..f1a5835 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -422,8 +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.
*/
- crhold(td->td_proc->p_ucred);
- ump->um_cred[type] = td->td_proc->p_ucred;
+ ump->um_cred[type] = crhold(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) {
OpenPOWER on IntegriCloud