summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-03-07 22:36:11 +0000
committerkib <kib@FreeBSD.org>2011-03-07 22:36:11 +0000
commitc0ee0d94ddc48e7f23ba167ac55c7785a943f23c (patch)
treee7049c32b6dfed7a69c157f965405f75cb22013b /sys/ufs
parenteed7bc0dc3ed43441c4c89652b5144d6b696c86a (diff)
downloadFreeBSD-src-c0ee0d94ddc48e7f23ba167ac55c7785a943f23c.zip
FreeBSD-src-c0ee0d94ddc48e7f23ba167ac55c7785a943f23c.tar.gz
Simplify uses of the web of pointers.
Reviewed by: mckusick MFC after: 1 week
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_dirhash.c4
-rw-r--r--sys/ufs/ufs/ufs_quota.c14
2 files changed, 7 insertions, 11 deletions
diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c
index 0f4e3aa..248a101 100644
--- a/sys/ufs/ufs/ufs_dirhash.c
+++ b/sys/ufs/ufs/ufs_dirhash.c
@@ -426,7 +426,7 @@ ufsdirhash_build(struct inode *ip)
}
for (i = 0; i < dirblocks; i++)
dh->dh_blkfree[i] = DIRBLKSIZ / DIRALIGN;
- bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
+ bmask = vp->v_mount->mnt_stat.f_iosize - 1;
pos = 0;
while (pos < ip->i_size) {
/* If necessary, get the next directory block. */
@@ -587,7 +587,7 @@ ufsdirhash_lookup(struct inode *ip, char *name, int namelen, doff_t *offp,
DIRHASHLIST_UNLOCK();
vp = ip->i_vnode;
- bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
+ bmask = vp->v_mount->mnt_stat.f_iosize - 1;
blkoff = -1;
bp = NULL;
seqoff = dh->dh_seqoff;
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 5a02af3..be82b8f 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -232,8 +232,7 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct ucred *cred, int flags)
/* Reset timer when crossing soft limit */
if (dq->dq_curblocks + change >= dq->dq_bsoftlimit &&
dq->dq_curblocks < dq->dq_bsoftlimit)
- dq->dq_btime = time_second +
- VFSTOUFS(ITOV(ip)->v_mount)->um_btime[i];
+ dq->dq_btime = time_second + ip->i_ump->um_btime[i];
dq->dq_curblocks += change;
dq->dq_flags |= DQ_MOD;
DQI_UNLOCK(dq);
@@ -278,8 +277,7 @@ chkdqchg(struct inode *ip, ufs2_daddr_t change, struct ucred *cred,
*/
if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) {
if (dq->dq_curblocks < dq->dq_bsoftlimit) {
- dq->dq_btime = time_second +
- VFSTOUFS(ITOV(ip)->v_mount)->um_btime[type];
+ dq->dq_btime = time_second + ip->i_ump->um_btime[type];
if (ip->i_uid == cred->cr_uid)
*warn = 1;
return (0);
@@ -378,8 +376,7 @@ chkiq(struct inode *ip, int change, struct ucred *cred, int flags)
/* Reset timer when crossing soft limit */
if (dq->dq_curinodes + change >= dq->dq_isoftlimit &&
dq->dq_curinodes < dq->dq_isoftlimit)
- dq->dq_itime = time_second +
- VFSTOUFS(ITOV(ip)->v_mount)->um_itime[i];
+ dq->dq_itime = time_second + ip->i_ump->um_itime[i];
dq->dq_curinodes += change;
dq->dq_flags |= DQ_MOD;
DQI_UNLOCK(dq);
@@ -423,8 +420,7 @@ chkiqchg(struct inode *ip, int change, struct ucred *cred, int type, int *warn)
*/
if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) {
if (dq->dq_curinodes < dq->dq_isoftlimit) {
- dq->dq_itime = time_second +
- VFSTOUFS(ITOV(ip)->v_mount)->um_itime[type];
+ dq->dq_itime = time_second + ip->i_ump->um_itime[type];
if (ip->i_uid == cred->cr_uid)
*warn = 1;
return (0);
@@ -455,7 +451,7 @@ chkiqchg(struct inode *ip, int change, struct ucred *cred, int type, int *warn)
static void
chkdquot(struct inode *ip)
{
- struct ufsmount *ump = VFSTOUFS(ITOV(ip)->v_mount);
+ struct ufsmount *ump = ip->i_ump;
struct vnode *vp = ITOV(ip);
int i;
OpenPOWER on IntegriCloud