2 * Copyright 1999 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
11 * All rights reserved.
13 * Redistribution and use in source and binary forms are permitted
14 * provided that: (1) source distributions retain this entire copyright
15 * notice and comment, and (2) distributions including binaries display
16 * the following acknowledgement: ``This product includes software
17 * developed by the University of California, Berkeley and its contributors''
18 * in the documentation or other materials provided with the distribution
19 * and in all advertising materials mentioning features or use of this
20 * software. Neither the name of the University nor the names of its
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28 #pragma ident "%Z%%M% %I% %E% SMI"
35 #include <sys/param.h>
36 #include <sys/types.h>
37 #include <sys/sysmacros.h>
38 #include <sys/mntent.h>
39 #include <sys/vnode.h>
42 #include <sys/fs/udf_volume.h>
45 extern void errexit(char *, ...);
47 extern unsigned int largefile_count
;
50 * Enter inodes into the cache.
53 cachefile(feblock
, len
)
57 register struct fileinfo
*inp
;
58 struct fileinfo
**inpp
;
60 inpp
= &inphash
[feblock
% listmax
];
61 for (inp
= *inpp
; inp
; inp
= inp
->fe_nexthash
) {
62 if (inp
->fe_block
== feblock
)
66 if (inpnext
>= inplast
) {
67 inpnext
= (struct fileinfo
*)calloc(FEGROW
+ 1,
68 sizeof (struct fileinfo
));
70 errexit(gettext("Cannot grow inphead list\n"));
71 /* Link at extra entry so that we can find them */
72 inplast
->fe_nexthash
= inpnext
;
73 inplast
->fe_block
= (uint32_t)-1;
74 inplast
= &inpnext
[FEGROW
];
77 inp
->fe_block
= feblock
;
78 inp
->fe_len
= (uint16_t)len
;
80 inp
->fe_nexthash
= *inpp
;
83 (void) printf("cacheing %x\n", feblock
);
88 (void) printf("cache hit %x lcount %d lseen %d\n", feblock
,
89 inp
->fe_lcount
, inp
->fe_lseen
);