suj.c (228751) | suj.c (236976) |
---|---|
1/*- 2 * Copyright 2009, 2010 Jeffrey W. Roberson <jeff@FreeBSD.org> 3 * 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright 2009, 2010 Jeffrey W. Roberson <jeff@FreeBSD.org> 3 * 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sbin/fsck_ffs/suj.c 228751 2011-12-20 20:39:00Z kib $"); | 28__FBSDID("$FreeBSD: head/sbin/fsck_ffs/suj.c 236976 2012-06-12 21:37:27Z kib $"); |
29 30#include <sys/param.h> 31#include <sys/disk.h> 32#include <sys/disklabel.h> 33#include <sys/mount.h> 34#include <sys/stat.h> 35 36#include <ufs/ufs/ufsmount.h> --- 1747 unchanged lines hidden (view full) --- 1784 sino->si_trunc = NULL; 1785 } 1786 if (sino->si_blkadj) 1787 ino_adjblks(sino); 1788 } 1789 } 1790} 1791 | 29 30#include <sys/param.h> 31#include <sys/disk.h> 32#include <sys/disklabel.h> 33#include <sys/mount.h> 34#include <sys/stat.h> 35 36#include <ufs/ufs/ufsmount.h> --- 1747 unchanged lines hidden (view full) --- 1784 sino->si_trunc = NULL; 1785 } 1786 if (sino->si_blkadj) 1787 ino_adjblks(sino); 1788 } 1789 } 1790} 1791 |
1792static void 1793cg_adj_blk(struct suj_cg *sc) 1794{ 1795 struct suj_ino *sino; 1796 int i; 1797 1798 for (i = 0; i < SUJ_HASHSIZE; i++) { 1799 LIST_FOREACH(sino, &sc->sc_inohash[i], si_next) { 1800 if (sino->si_blkadj) 1801 ino_adjblks(sino); 1802 } 1803 } 1804} 1805 |
|
1792/* 1793 * Free any partially allocated blocks and then resolve inode block 1794 * counts. 1795 */ 1796static void 1797cg_check_blk(struct suj_cg *sc) 1798{ 1799 struct suj_blk *sblk; --- 915 unchanged lines hidden (view full) --- 2715 suj_prune(); 2716 suj_build(); 2717 cg_apply(cg_build); 2718 printf("** Resolving unreferenced inode list.\n"); 2719 ino_unlinked(); 2720 printf("** Processing journal entries.\n"); 2721 cg_apply(cg_trunc); 2722 cg_apply(cg_check_blk); | 1806/* 1807 * Free any partially allocated blocks and then resolve inode block 1808 * counts. 1809 */ 1810static void 1811cg_check_blk(struct suj_cg *sc) 1812{ 1813 struct suj_blk *sblk; --- 915 unchanged lines hidden (view full) --- 2729 suj_prune(); 2730 suj_build(); 2731 cg_apply(cg_build); 2732 printf("** Resolving unreferenced inode list.\n"); 2733 ino_unlinked(); 2734 printf("** Processing journal entries.\n"); 2735 cg_apply(cg_trunc); 2736 cg_apply(cg_check_blk); |
2737 cg_apply(cg_adj_blk); |
|
2723 cg_apply(cg_check_ino); 2724 } 2725 if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0) 2726 return (0); 2727 /* 2728 * To remain idempotent with partial truncations the free bitmaps 2729 * must be written followed by indirect blocks and lastly inode 2730 * blocks. This preserves access to the modified pointers until --- 16 unchanged lines hidden --- | 2738 cg_apply(cg_check_ino); 2739 } 2740 if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0) 2741 return (0); 2742 /* 2743 * To remain idempotent with partial truncations the free bitmaps 2744 * must be written followed by indirect blocks and lastly inode 2745 * blocks. This preserves access to the modified pointers until --- 16 unchanged lines hidden --- |