Deleted Added
full compact
ffs_vfsops.c (108316) ffs_vfsops.c (109623)
1/*
2 * Copyright (c) 1989, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
1/*
2 * Copyright (c) 1989, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
34 * $FreeBSD: head/sys/ufs/ffs/ffs_vfsops.c 108316 2002-12-27 11:05:05Z phk $
34 * $FreeBSD: head/sys/ufs/ffs/ffs_vfsops.c 109623 2003-01-21 08:56:16Z alfred $
35 */
36
37#include "opt_mac.h"
38#include "opt_quota.h"
39#include "opt_ufs.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>

--- 638 unchanged lines hidden (view full) ---

681 }
682 if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) {
683 printf("%s: mount pending error: blocks %jd files %d\n",
684 fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks,
685 fs->fs_pendinginodes);
686 fs->fs_pendingblocks = 0;
687 fs->fs_pendinginodes = 0;
688 }
35 */
36
37#include "opt_mac.h"
38#include "opt_quota.h"
39#include "opt_ufs.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>

--- 638 unchanged lines hidden (view full) ---

681 }
682 if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) {
683 printf("%s: mount pending error: blocks %jd files %d\n",
684 fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks,
685 fs->fs_pendinginodes);
686 fs->fs_pendingblocks = 0;
687 fs->fs_pendinginodes = 0;
688 }
689 ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK | M_ZERO);
689 ump = malloc(sizeof *ump, M_UFSMNT, M_ZERO);
690 ump->um_fs = malloc((u_long)fs->fs_sbsize, M_UFSMNT,
690 ump->um_fs = malloc((u_long)fs->fs_sbsize, M_UFSMNT,
691 M_WAITOK);
691 0);
692 if (fs->fs_magic == FS_UFS1_MAGIC) {
693 ump->um_fstype = UFS1;
694 ump->um_balloc = ffs_balloc_ufs1;
695 } else {
696 ump->um_fstype = UFS2;
697 ump->um_balloc = ffs_balloc_ufs2;
698 }
699 ump->um_blkatoff = ffs_blkatoff;

--- 10 unchanged lines hidden (view full) ---

710 fs = ump->um_fs;
711 ffs_oldfscompat_read(fs, ump, sblockloc);
712 fs->fs_ronly = ronly;
713 size = fs->fs_cssize;
714 blks = howmany(size, fs->fs_fsize);
715 if (fs->fs_contigsumsize > 0)
716 size += fs->fs_ncg * sizeof(int32_t);
717 size += fs->fs_ncg * sizeof(u_int8_t);
692 if (fs->fs_magic == FS_UFS1_MAGIC) {
693 ump->um_fstype = UFS1;
694 ump->um_balloc = ffs_balloc_ufs1;
695 } else {
696 ump->um_fstype = UFS2;
697 ump->um_balloc = ffs_balloc_ufs2;
698 }
699 ump->um_blkatoff = ffs_blkatoff;

--- 10 unchanged lines hidden (view full) ---

710 fs = ump->um_fs;
711 ffs_oldfscompat_read(fs, ump, sblockloc);
712 fs->fs_ronly = ronly;
713 size = fs->fs_cssize;
714 blks = howmany(size, fs->fs_fsize);
715 if (fs->fs_contigsumsize > 0)
716 size += fs->fs_ncg * sizeof(int32_t);
717 size += fs->fs_ncg * sizeof(u_int8_t);
718 space = malloc((u_long)size, M_UFSMNT, M_WAITOK);
718 space = malloc((u_long)size, M_UFSMNT, 0);
719 fs->fs_csp = space;
720 for (i = 0; i < blks; i += fs->fs_frag) {
721 size = fs->fs_bsize;
722 if (i + fs->fs_frag > blks)
723 size = (blks - i) * fs->fs_fsize;
724 if ((error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size,
725 cred, &bp)) != 0) {
726 free(fs->fs_csp, M_UFSMNT);

--- 516 unchanged lines hidden (view full) ---

1243
1244 /*
1245 * If this MALLOC() is performed after the getnewvnode()
1246 * it might block, leaving a vnode with a NULL v_data to be
1247 * found by ffs_sync() if a sync happens to fire right then,
1248 * which will cause a panic because ffs_sync() blindly
1249 * dereferences vp->v_data (as well it should).
1250 */
719 fs->fs_csp = space;
720 for (i = 0; i < blks; i += fs->fs_frag) {
721 size = fs->fs_bsize;
722 if (i + fs->fs_frag > blks)
723 size = (blks - i) * fs->fs_fsize;
724 if ((error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size,
725 cred, &bp)) != 0) {
726 free(fs->fs_csp, M_UFSMNT);

--- 516 unchanged lines hidden (view full) ---

1243
1244 /*
1245 * If this MALLOC() is performed after the getnewvnode()
1246 * it might block, leaving a vnode with a NULL v_data to be
1247 * found by ffs_sync() if a sync happens to fire right then,
1248 * which will cause a panic because ffs_sync() blindly
1249 * dereferences vp->v_data (as well it should).
1250 */
1251 ip = uma_zalloc(uma_inode, M_WAITOK);
1251 ip = uma_zalloc(uma_inode, 0);
1252
1253 /* Allocate a new vnode/inode. */
1254 error = getnewvnode("ufs", mp, ffs_vnodeop_p, &vp);
1255 if (error) {
1256 *vpp = NULL;
1257 uma_zfree(uma_inode, ip);
1258 return (error);
1259 }

--- 50 unchanged lines hidden (view full) ---

1310 * list by vput().
1311 */
1312 brelse(bp);
1313 vput(vp);
1314 *vpp = NULL;
1315 return (error);
1316 }
1317 if (ip->i_ump->um_fstype == UFS1)
1252
1253 /* Allocate a new vnode/inode. */
1254 error = getnewvnode("ufs", mp, ffs_vnodeop_p, &vp);
1255 if (error) {
1256 *vpp = NULL;
1257 uma_zfree(uma_inode, ip);
1258 return (error);
1259 }

--- 50 unchanged lines hidden (view full) ---

1310 * list by vput().
1311 */
1312 brelse(bp);
1313 vput(vp);
1314 *vpp = NULL;
1315 return (error);
1316 }
1317 if (ip->i_ump->um_fstype == UFS1)
1318 ip->i_din1 = uma_zalloc(uma_ufs1, M_WAITOK);
1318 ip->i_din1 = uma_zalloc(uma_ufs1, 0);
1319 else
1319 else
1320 ip->i_din2 = uma_zalloc(uma_ufs2, M_WAITOK);
1320 ip->i_din2 = uma_zalloc(uma_ufs2, 0);
1321 ffs_load_inode(bp, ip, fs, ino);
1322 if (DOINGSOFTDEP(vp))
1323 softdep_load_inodeblock(ip);
1324 else
1325 ip->i_effnlink = ip->i_nlink;
1326 bqrelse(bp);
1327
1328 /*

--- 217 unchanged lines hidden ---
1321 ffs_load_inode(bp, ip, fs, ino);
1322 if (DOINGSOFTDEP(vp))
1323 softdep_load_inodeblock(ip);
1324 else
1325 ip->i_effnlink = ip->i_nlink;
1326 bqrelse(bp);
1327
1328 /*

--- 217 unchanged lines hidden ---