Annotation of coherent/b/etc/fsck/cleanup.c, revision 1.1

1.1     ! root        1: /*
        !             2:  *     Cleanup functions for phases of fsck
        !             3:  */
        !             4: 
        !             5: #include "fsck.h"
        !             6: 
        !             7: cleanup()
        !             8: {
        !             9:        int retval = 0;
        !            10: 
        !            11:        if (sbpfix == TRUE) 
        !            12:                writesuper();
        !            13:        prtstats();
        !            14:        if (changeflg == TRUE)
        !            15:                retval = advise();
        !            16:        close(fsfd);
        !            17: #if SMALLMODEL
        !            18:        cleanV();
        !            19: #endif
        !            20:        return(retval);
        !            21: }
        !            22: 
        !            23: writesuper()
        !            24: {
        !            25:        register int i;
        !            26: 
        !            27:        canshort(sbp->s_isize);
        !            28:        candaddr(sbp->s_fsize);
        !            29:        canshort(sbp->s_nfree);
        !            30:        for(i=0; i<NICFREE; i++)
        !            31:                candaddr(sbp->s_free[i]);
        !            32:        canshort(sbp->s_ninode);
        !            33:        for(i=0; i<NICINOD; i++)
        !            34:                canino(sbp->s_inode[i]);
        !            35:        cantime(sbp->s_time);
        !            36:        candaddr(sbp->s_tfree);
        !            37:        canino(sbp->s_tinode);
        !            38:        canshort(sbp->s_m);
        !            39:        canshort(sbp->s_n);
        !            40:        canlong(sbp->s_unique);
        !            41: 
        !            42:        bwrite((daddr_t)SUPERI, sbp);
        !            43: }
        !            44: 
        !            45: prtstats()
        !            46: {
        !            47:        if (!fflag)
        !            48:                printf("%u files ", numfiles);
        !            49:        printf("%lu blocks ", fsize - isize - totfree);
        !            50:        printf("%lu free\n", totfree);
        !            51:        if ( lostsize ) {
        !            52:                lostsize = (lostsize + BSIZE - 1)/BSIZE;
        !            53:                printf("Expect roughly %lu missing block%s next\n", lostsize,
        !            54:                                (lostsize!=1) ? "s" : "" );
        !            55:                printf("time fsck is run as a result of inodes ");
        !            56:                printf("being cleared.\n");
        !            57:        }
        !            58: }
        !            59: 
        !            60: advise()
        !            61: {
        !            62:        int retval = 0;
        !            63: 
        !            64:        printf(" ***** File System %s was modified *****\n", fsname);
        !            65:        if ( mounted ) {
        !            66:                printf(" ***** BOOT Coherent (NO SYNC!) *****\n");
        !            67:                retval = 1;
        !            68:        }
        !            69:        return(retval);
        !            70: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.