aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_inode.c4
-rw-r--r--sys/ufs/ffs/ffs_softdep.c2
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
-rw-r--r--sys/ufs/ufs/ufs_lookup.c4
-rw-r--r--sys/ufs/ufs/ufs_quota.c38
-rw-r--r--sys/ufs/ufs/ufs_vnops.c8
6 files changed, 31 insertions, 27 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 970536a13aa5..f47cfd08f75a 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -653,8 +653,8 @@ done:
for (i = 0; i < UFS_NDADDR; i++)
if (newblks[i] != DIP(ip, i_db[i]))
panic("ffs_truncate2: blkno %d newblks %jd != i_db %jd",
- i, (intmax_t)newblks[UFS_NDADDR + level],
- (intmax_t)DIP(ip, i_ib[level]));
+ i, (intmax_t)newblks[i],
+ (intmax_t)DIP(ip, i_db[i]));
BO_LOCK(bo);
if (length == 0 &&
(fs->fs_magic != FS_UFS2_MAGIC || ip->i_din2->di_extsize == 0) &&
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index b5212ce5875f..297c8257bd22 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -2148,7 +2148,7 @@ retry_flush:
#ifdef QUOTA
UFS_LOCK(ump);
for (i = 0; i < MAXQUOTAS; i++) {
- if (ump->um_quotas[i] != NULLVP)
+ if (ump->um_quotas[i] != NULL)
morework = 1;
}
UFS_UNLOCK(ump);
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 75f5fe716c31..de6b32795698 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1112,7 +1112,7 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td)
ump->um_bptrtodb = fs->fs_fsbtodb;
ump->um_seqinc = fs->fs_frag;
for (i = 0; i < MAXQUOTAS; i++)
- ump->um_quotas[i] = NULLVP;
+ ump->um_quotas[i] = NULL;
#ifdef UFS_EXTATTR
ufs_extattr_uepm_init(&ump->um_extattr);
#endif
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 9221aa63184d..419ec3de8572 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -597,7 +597,7 @@ found:
return (error);
}
if (dp->i_number == ino) {
- VREF(vdp);
+ vref(vdp);
*vpp = vdp;
vput(tdp);
return (0);
@@ -707,7 +707,7 @@ found:
*vpp = tdp;
} else if (dp->i_number == ino) {
- VREF(vdp); /* we want ourself, ie "." */
+ vref(vdp); /* we want ourself, ie "." */
/*
* When we lookup "." we still can be asked to lock it
* differently.
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index ac125902b74b..55c4bf98e502 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -467,7 +467,7 @@ chkdquot(struct inode *ip)
UFS_LOCK(ump);
for (i = 0; i < MAXQUOTAS; i++) {
- if (ump->um_quotas[i] == NULLVP ||
+ if (ump->um_quotas[i] == NULL ||
(ump->um_qflags[i] & (QTF_OPENING|QTF_CLOSING)))
continue;
if (ip->i_dquot[i] == NODQUOT) {
@@ -594,12 +594,12 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname,
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) {
+ if (dqget(NULL, 0, ump, type, &dq) == 0) {
if (dq->dq_btime > 0)
ump->um_btime[type] = dq->dq_btime;
if (dq->dq_itime > 0)
ump->um_itime[type] = dq->dq_itime;
- dqrele(NULLVP, dq);
+ dqrele(NULL, dq);
}
/*
* Search vnodes associated with this mount point,
@@ -655,7 +655,7 @@ quotaoff1(struct thread *td, struct mount *mp, int type)
UFS_LOCK(ump);
KASSERT((ump->um_qflags[type] & QTF_CLOSING) != 0,
("quotaoff1: flags are invalid"));
- if ((qvp = ump->um_quotas[type]) == NULLVP) {
+ if ((qvp = ump->um_quotas[type]) == NULL) {
UFS_UNLOCK(ump);
return (0);
}
@@ -692,7 +692,7 @@ again:
* access to the closed vnode from dqget/dqsync
*/
UFS_LOCK(ump);
- ump->um_quotas[type] = NULLVP;
+ ump->um_quotas[type] = NULL;
ump->um_cred[type] = NOCRED;
UFS_UNLOCK(ump);
@@ -750,7 +750,7 @@ quotaoff_inchange(struct thread *td, struct mount *mp, int type)
UFS_LOCK(ump);
ump->um_qflags[type] &= ~QTF_CLOSING;
for (i = 0; i < MAXQUOTAS; i++)
- if (ump->um_quotas[i] != NULLVP)
+ if (ump->um_quotas[i] != NULL)
break;
if (i == MAXQUOTAS) {
MNT_ILOCK(mp);
@@ -820,11 +820,11 @@ _getquota(struct thread *td, struct mount *mp, uint64_t id, int type,
}
dq = NODQUOT;
- error = dqget(NULLVP, id, VFSTOUFS(mp), type, &dq);
+ error = dqget(NULL, id, VFSTOUFS(mp), type, &dq);
if (error)
return (error);
*dqb = dq->dq_dqb;
- dqrele(NULLVP, dq);
+ dqrele(NULL, dq);
return (error);
}
@@ -850,7 +850,7 @@ _setquota(struct thread *td, struct mount *mp, uint64_t id, int type,
ndq = NODQUOT;
ump = VFSTOUFS(mp);
- error = dqget(NULLVP, id, ump, type, &ndq);
+ error = dqget(NULL, id, ump, type, &ndq);
if (error)
return (error);
dq = ndq;
@@ -887,7 +887,7 @@ _setquota(struct thread *td, struct mount *mp, uint64_t id, int type,
dq->dq_flags &= ~DQ_FAKE;
dq->dq_flags |= DQ_MOD;
DQI_UNLOCK(dq);
- dqrele(NULLVP, dq);
+ dqrele(NULL, dq);
return (0);
}
@@ -913,7 +913,7 @@ _setuse(struct thread *td, struct mount *mp, uint64_t id, int type,
ump = VFSTOUFS(mp);
ndq = NODQUOT;
- error = dqget(NULLVP, id, ump, type, &ndq);
+ error = dqget(NULL, id, ump, type, &ndq);
if (error)
return (error);
dq = ndq;
@@ -937,7 +937,7 @@ _setuse(struct thread *td, struct mount *mp, uint64_t id, int type,
dq->dq_flags &= ~DQ_INODS;
dq->dq_flags |= DQ_MOD;
DQI_UNLOCK(dq);
- dqrele(NULLVP, dq);
+ dqrele(NULL, dq);
return (0);
}
@@ -1038,7 +1038,7 @@ getquotasize(struct thread *td, struct mount *mp, uint64_t id, int type,
int bitsize;
UFS_LOCK(ump);
- if (ump->um_quotas[type] == NULLVP ||
+ if (ump->um_quotas[type] == NULL ||
(ump->um_qflags[type] & QTF_CLOSING)) {
UFS_UNLOCK(ump);
return (EINVAL);
@@ -1067,7 +1067,7 @@ qsync(struct mount *mp)
* If not, simply return.
*/
for (i = 0; i < MAXQUOTAS; i++)
- if (ump->um_quotas[i] != NULLVP)
+ if (ump->um_quotas[i] != NULL)
break;
if (i == MAXQUOTAS)
return (0);
@@ -1114,7 +1114,7 @@ qsyncvp(struct vnode *vp)
* If not, simply return.
*/
for (i = 0; i < MAXQUOTAS; i++)
- if (ump->um_quotas[i] != NULLVP)
+ if (ump->um_quotas[i] != NULL)
break;
if (i == MAXQUOTAS)
return (0);
@@ -1278,10 +1278,10 @@ dqget(struct vnode *vp, uint64_t id, struct ufsmount *ump, int type,
struct uio auio;
int dqvplocked, error;
- if (vp != NULLVP)
+ if (vp != NULL)
ASSERT_VOP_ELOCKED(vp, "dqget");
- if (vp != NULLVP && *dqp != NODQUOT) {
+ if (vp != NULL && *dqp != NODQUOT) {
return (0);
}
@@ -1293,7 +1293,7 @@ dqget(struct vnode *vp, uint64_t id, struct ufsmount *ump, int type,
UFS_LOCK(ump);
dqvp = ump->um_quotas[type];
- if (dqvp == NULLVP || (ump->um_qflags[type] & QTF_CLOSING)) {
+ if (dqvp == NULL || (ump->um_qflags[type] & QTF_CLOSING)) {
*dqp = NODQUOT;
UFS_UNLOCK(ump);
return (EINVAL);
@@ -1561,7 +1561,7 @@ dqsync(struct vnode *vp, struct dquot *dq)
if ((ump = dq->dq_ump) == NULL)
return (0);
UFS_LOCK(ump);
- if ((dqvp = ump->um_quotas[dq->dq_type]) == NULLVP) {
+ if ((dqvp = ump->um_quotas[dq->dq_type]) == NULL) {
if (vp == NULL) {
UFS_UNLOCK(ump);
return (0);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 0921eee92b9d..736c5a66267e 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -2592,8 +2592,12 @@ ufs_print(
printf("\tnlink=%d, effnlink=%d, size=%jd", ip->i_nlink,
ip->i_effnlink, (intmax_t)ip->i_size);
- if (I_IS_UFS2(ip))
- printf(", extsize %d", ip->i_din2->di_extsize);
+ if (I_IS_UFS2(ip)) {
+ if (ip->i_din2 == NULL)
+ printf(", dinode=NULL (fields omitted)");
+ else
+ printf(", extsize=%d", ip->i_din2->di_extsize);
+ }
printf("\n\tgeneration=%jx, uid=%d, gid=%d, flags=0x%b\n",
(uintmax_t)ip->i_gen, ip->i_uid, ip->i_gid,
(uint32_t)ip->i_flags, PRINT_INODE_FLAGS);