summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-12-27 10:23:03 +0000
committerphk <phk@FreeBSD.org>2002-12-27 10:23:03 +0000
commit3d9be4e20ac4a1afd73a5c5797077df442c6be44 (patch)
tree676a4942fff2fa15c21c9057ffb55eb09f2c43b7 /sys/ufs
parent357cc16da89629ae10de734ddf1a73fc627152a2 (diff)
downloadFreeBSD-src-3d9be4e20ac4a1afd73a5c5797077df442c6be44.zip
FreeBSD-src-3d9be4e20ac4a1afd73a5c5797077df442c6be44.tar.gz
Move the allocation of the inode contents into ffs_vfsops.c rather than
passing malloc types around.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_extern.h3
-rw-r--r--sys/ufs/ffs/ffs_subr.c9
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c10
3 files changed, 10 insertions, 12 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 89c460e..3c9c885 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -70,8 +70,7 @@ int ffs_flushfiles(struct mount *, int, struct thread *);
void ffs_fragacct(struct fs *, int, int32_t [], int);
int ffs_freefile(struct fs *, struct vnode *, ino_t, int );
int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
-void ffs_load_inode(struct buf *, struct inode *, struct malloc_type *,
- struct fs *, ino_t);
+void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t);
int ffs_mountroot(void);
vfs_mount_t ffs_mount;
int ffs_reallocblks(struct vop_reallocblks_args *);
diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c
index 4b17173..f0c8277 100644
--- a/sys/ufs/ffs/ffs_subr.c
+++ b/sys/ufs/ffs/ffs_subr.c
@@ -105,18 +105,14 @@ ffs_blkatoff(vp, offset, res, bpp)
* to the incore copy.
*/
void
-ffs_load_inode(bp, ip, mtype, fs, ino)
+ffs_load_inode(bp, ip, fs, ino)
struct buf *bp;
struct inode *ip;
- struct malloc_type *mtype;
struct fs *fs;
ino_t ino;
{
if (ip->i_ump->um_fstype == UFS1) {
- if (mtype != NULL)
- MALLOC(ip->i_din1, struct ufs1_dinode *,
- sizeof(struct ufs1_dinode), mtype, M_WAITOK);
*ip->i_din1 =
*((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ino));
ip->i_mode = ip->i_din1->di_mode;
@@ -127,9 +123,6 @@ ffs_load_inode(bp, ip, mtype, fs, ino)
ip->i_uid = ip->i_din1->di_uid;
ip->i_gid = ip->i_din1->di_gid;
} else {
- if (mtype != NULL)
- MALLOC(ip->i_din2, struct ufs2_dinode *,
- sizeof(struct ufs2_dinode), mtype, M_WAITOK);
*ip->i_din2 =
*((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ino));
ip->i_mode = ip->i_din2->di_mode;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index fa155f8..f6b7e08 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -522,7 +522,7 @@ loop:
vput(vp);
return (error);
}
- ffs_load_inode(bp, ip, NULL, fs, ip->i_number);
+ ffs_load_inode(bp, ip, fs, ip->i_number);
ip->i_effnlink = ip->i_nlink;
brelse(bp);
vput(vp);
@@ -1303,7 +1303,13 @@ ffs_vget(mp, ino, flags, vpp)
*vpp = NULL;
return (error);
}
- ffs_load_inode(bp, ip, M_FFSNODE, fs, ino);
+ if (ip->i_ump->um_fstype == UFS1)
+ MALLOC(ip->i_din1, struct ufs1_dinode *,
+ sizeof(struct ufs1_dinode), M_FFSNODE, M_WAITOK);
+ else
+ MALLOC(ip->i_din2, struct ufs2_dinode *,
+ sizeof(struct ufs2_dinode), M_FFSNODE, M_WAITOK);
+ ffs_load_inode(bp, ip, fs, ino);
if (DOINGSOFTDEP(vp))
softdep_load_inodeblock(ip);
else
OpenPOWER on IntegriCloud