1/* $Id: msdosfs_fat.c,v 1.8 1995/10/29 15:31:49 phk Exp $ */ |
2/* $NetBSD: msdosfs_fat.c,v 1.12 1994/08/21 18:44:04 ws Exp $ */ 3 4/*- 5 * Copyright (C) 1994 Wolfgang Solfrank. 6 * Copyright (C) 1994 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 54 unchanged lines hidden (view full) --- 64 * msdosfs include files. 65 */ 66#include <msdosfs/bpb.h> 67#include <msdosfs/msdosfsmount.h> 68#include <msdosfs/direntry.h> 69#include <msdosfs/denode.h> 70#include <msdosfs/fat.h> 71 |
72static void fc_lookup __P((struct denode *dep, u_long findcn, u_long *frcnp, u_long *fsrcnp)); |
73/* 74 * Fat cache stats. 75 */ 76int fc_fileextends; /* # of file extends */ 77int fc_lfcempty; /* # of time last file cluster cache entry 78 * was empty */ 79int fc_bmapcalls; /* # of times pcbmap was called */ 80 --- 166 unchanged lines hidden (view full) --- 247 fc_setcache(dep, FC_LASTFC, i - 1, prevcn); 248 return E2BIG; 249} 250 251/* 252 * Find the closest entry in the fat cache to the cluster we are looking 253 * for. 254 */ |
255static void |
256fc_lookup(dep, findcn, frcnp, fsrcnp) 257 struct denode *dep; 258 u_long findcn; 259 u_long *frcnp; 260 u_long *fsrcnp; 261{ 262 int i; 263 u_long cn; --- 308 unchanged lines hidden (view full) --- 572 573/* 574 * Check the length of a free cluster chain starting at start. 575 * 576 * pmp - mount point 577 * start - start of chain 578 * count - maximum interesting length 579 */ |
580static int |
581chainlength(pmp, start, count) 582 struct msdosfsmount *pmp; 583 u_long start; 584 u_long count; 585{ 586 u_long idx, max_idx; 587 u_int map; 588 u_long len; --- 29 unchanged lines hidden (view full) --- 618 * pmp - mount point. 619 * start - start of cluster chain. 620 * count - number of clusters to allocate. 621 * fillwith - put this value into the fat entry for the 622 * last allocated cluster. 623 * retcluster - put the first allocated cluster's number here. 624 * got - how many clusters were actually allocated. 625 */ |
626static int |
627chainalloc(pmp, start, count, fillwith, retcluster, got) 628 struct msdosfsmount *pmp; 629 u_long start; 630 u_long count; 631 u_long fillwith; 632 u_long *retcluster; 633 u_long *got; 634{ --- 351 unchanged lines hidden --- |