utilities.c (8509e9ca) | utilities.c (bfbf29e2) |
---|---|
1/* 2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 */ 4 5/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 6/* All Rights Reserved */ 7 8/* --- 37 unchanged lines hidden (view full) --- 46#include <sys/stat.h> 47#include <sys/vfstab.h> 48#include <sys/sysmacros.h> 49#include <sys/fs/udf_volume.h> 50#include "fsck.h" 51#include <sys/lockfs.h> 52#include <locale.h> 53 | 1/* 2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 */ 4 5/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 6/* All Rights Reserved */ 7 8/* --- 37 unchanged lines hidden (view full) --- 46#include <sys/stat.h> 47#include <sys/vfstab.h> 48#include <sys/sysmacros.h> 49#include <sys/fs/udf_volume.h> 50#include "fsck.h" 51#include <sys/lockfs.h> 52#include <locale.h> 53 |
54static struct bufarea bufhead; 55 |
|
54extern int32_t verifytag(struct tag *, uint32_t, struct tag *, int); 55extern char *tagerrs[]; 56extern void maketag(struct tag *, struct tag *); 57extern char *hasvfsopt(struct vfstab *, char *); 58static struct bufarea *getdatablk(daddr_t, long); 59static struct bufarea *getblk(struct bufarea *, daddr_t, long); 60 61void flush(int32_t, struct bufarea *); --- 211 unchanged lines hidden (view full) --- 273 bp->b_un.b_buf = bufp; 274 bp->b_prev = &bufhead; 275 bp->b_next = bufhead.b_next; 276 bufhead.b_next->b_prev = bp; 277 bufhead.b_next = bp; 278 initbarea(bp); 279 } 280 bufhead.b_size = i; /* save number of buffers */ | 56extern int32_t verifytag(struct tag *, uint32_t, struct tag *, int); 57extern char *tagerrs[]; 58extern void maketag(struct tag *, struct tag *); 59extern char *hasvfsopt(struct vfstab *, char *); 60static struct bufarea *getdatablk(daddr_t, long); 61static struct bufarea *getblk(struct bufarea *, daddr_t, long); 62 63void flush(int32_t, struct bufarea *); --- 211 unchanged lines hidden (view full) --- 275 bp->b_un.b_buf = bufp; 276 bp->b_prev = &bufhead; 277 bp->b_next = bufhead.b_next; 278 bufhead.b_next->b_prev = bp; 279 bufhead.b_next = bp; 280 initbarea(bp); 281 } 282 bufhead.b_size = i; /* save number of buffers */ |
281 pbp = pdirbp = NULL; | |
282} 283 284/* 285 * Manage a cache of directory blocks. 286 */ 287static struct bufarea * 288getdatablk(daddr_t blkno, long size) 289{ --- 69 unchanged lines hidden (view full) --- 359 360 for (bp = bufhead.b_prev; bp && bp != &bufhead; bp = nbp) { 361 cnt++; 362 flush(fswritefd, bp); 363 nbp = bp->b_prev; 364 free(bp->b_un.b_buf); 365 free((char *)bp); 366 } | 283} 284 285/* 286 * Manage a cache of directory blocks. 287 */ 288static struct bufarea * 289getdatablk(daddr_t blkno, long size) 290{ --- 69 unchanged lines hidden (view full) --- 360 361 for (bp = bufhead.b_prev; bp && bp != &bufhead; bp = nbp) { 362 cnt++; 363 flush(fswritefd, bp); 364 nbp = bp->b_prev; 365 free(bp->b_un.b_buf); 366 free((char *)bp); 367 } |
367 pbp = pdirbp = NULL; | |
368 if (bufhead.b_size != cnt) 369 errexit(gettext("Panic: lost %d buffers\n"), 370 bufhead.b_size - cnt); 371 if (debug) 372 (void) printf("cache missed %ld of %ld (%ld%%)\n", 373 diskreads, totalreads, 374 totalreads ? diskreads * 100 / totalreads : 0); 375 (void) close(fsreadfd); --- 227 unchanged lines hidden --- | 368 if (bufhead.b_size != cnt) 369 errexit(gettext("Panic: lost %d buffers\n"), 370 bufhead.b_size - cnt); 371 if (debug) 372 (void) printf("cache missed %ld of %ld (%ld%%)\n", 373 diskreads, totalreads, 374 totalreads ? diskreads * 100 / totalreads : 0); 375 (void) close(fsreadfd); --- 227 unchanged lines hidden --- |