Deleted Added
sdiff udiff text old ( 11921 ) new ( 12144 )
full compact
1/* $Id: msdosfs_fat.c,v 1.7 1995/05/30 08:07:40 rgrimes 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
72/*
73 * Fat cache stats.
74 */
75int fc_fileextends; /* # of file extends */
76int fc_lfcempty; /* # of time last file cluster cache entry
77 * was empty */
78int fc_bmapcalls; /* # of times pcbmap was called */
79

--- 166 unchanged lines hidden (view full) ---

246 fc_setcache(dep, FC_LASTFC, i - 1, prevcn);
247 return E2BIG;
248}
249
250/*
251 * Find the closest entry in the fat cache to the cluster we are looking
252 * for.
253 */
254void
255fc_lookup(dep, findcn, frcnp, fsrcnp)
256 struct denode *dep;
257 u_long findcn;
258 u_long *frcnp;
259 u_long *fsrcnp;
260{
261 int i;
262 u_long cn;

--- 308 unchanged lines hidden (view full) ---

571
572/*
573 * Check the length of a free cluster chain starting at start.
574 *
575 * pmp - mount point
576 * start - start of chain
577 * count - maximum interesting length
578 */
579int
580chainlength(pmp, start, count)
581 struct msdosfsmount *pmp;
582 u_long start;
583 u_long count;
584{
585 u_long idx, max_idx;
586 u_int map;
587 u_long len;

--- 29 unchanged lines hidden (view full) ---

617 * pmp - mount point.
618 * start - start of cluster chain.
619 * count - number of clusters to allocate.
620 * fillwith - put this value into the fat entry for the
621 * last allocated cluster.
622 * retcluster - put the first allocated cluster's number here.
623 * got - how many clusters were actually allocated.
624 */
625int
626chainalloc(pmp, start, count, fillwith, retcluster, got)
627 struct msdosfsmount *pmp;
628 u_long start;
629 u_long count;
630 u_long fillwith;
631 u_long *retcluster;
632 u_long *got;
633{

--- 351 unchanged lines hidden ---