Lines Matching +defs:template +defs:c
23 * Copyright (c) 1999,2000 by Sun Microsystems, Inc.
476 * The template parameter, if non-NULL, is used to facilitate sharing
478 * The first call to allocInUse for a new file should have *template
479 * set to 0; on return, *template then points to the newly allocated
481 * in *template and that ClusterInfo ndoe is then used for all
486 * The ClusterInfo used in the template is guaranted to be in use in
491 allocInUse(int32_t clusterNum, ClusterInfo **template)
498 if (template != NULL && *template != NULL)
499 newCl = *template;
502 if (template)
503 *template = newCl;
563 clearOrphan(int32_t c)
566 if (c < FIRST_CLUSTER || c > LastCluster)
568 if (InUse[c - FIRST_CLUSTER] != NULL)
569 updateFlags(c,
570 InUse[c - FIRST_CLUSTER]->flags & ~CLINFO_ORPHAN);
574 clearInUse(int32_t c)
579 if (c < FIRST_CLUSTER || c > LastCluster)
582 clp = &InUse[c - FIRST_CLUSTER];
615 int32_t c;
620 for (c = FIRST_CLUSTER; c < LastCluster; c++) {
621 if (badInFAT(c)) {
623 } else if (isMarkedBad(c)) {
631 markBadInFAT(c);
632 } else if (isHidden(c)) {
634 } else if (isInUse(c)) {
651 int32_t c;
654 for (c = FIRST_CLUSTER; c < LastCluster; c++) {
655 if (!freeInFAT(c) && !badInFAT(c) && !reservedInFAT(c) &&
656 !isInUse(c)) {
657 (void) markInUse(fd, c, &BlankPCDIR, NULL, 0, VISIBLE,
749 orphanChain(int fd, int32_t c, struct pcdir *ndp)
754 if (c < FIRST_CLUSTER || c > LastCluster)
756 clearInUse(c);
757 markOrphan(fd, c, ndp);
758 c = nextInChain(c);
759 while (c != 0) {
760 clearInUse(c);
761 clearOrphan(c);
762 (void) markInUse(fd, c, ndp, NULL, 0, VISIBLE, &tmpl);
763 c = nextInChain(c);
1063 freeOrphan(int32_t c)
1071 if (InUse[c - FIRST_CLUSTER]->dirent != NULL)
1072 free(InUse[c - FIRST_CLUSTER]->dirent);
1077 n = nextInChain(c);
1078 markFreeInFAT(c);
1079 markFree(c);
1080 c = n;
1081 } while (c != 0);
1089 redoInUse(int fd, int32_t c, struct pcdir *ndp, int32_t stopAtCluster)
1091 while (c && c != stopAtCluster) {
1092 clearInUse(c);
1093 (void) markInUse(fd, c, ndp, NULL, 0, VISIBLE, NULL);
1094 c = nextInChain(c);
1164 int32_t c;
1166 for (c = FIRST_CLUSTER; c < LastCluster; c++) {
1167 if (isMarkedOrphan(c)) {
1168 if (OkayToRelink && askAboutRelink(c)) {
1169 linkOrphan(fd, c);
1170 } else if (askAboutFreeing(c)) {
1171 freeOrphan(c);
1173 clearOrphan(c);
1193 int32_t cc, c, n;
1198 for (c = FIRST_CLUSTER; c < LastCluster; c++) {
1199 if (freeInFAT(c) || badInFAT(c) ||
1200 reservedInFAT(c) || isInUse(c))
1203 n = c;
1212 updateDirEnt_Start(ndp, c);
1216 orphanChain(fd, c, ndp);
1284 int32_t c = startCluster;
1286 while (c != 0) {
1287 if (isMarkedBad(c)) {
1295 splitChain(fd, dp, c,
1306 c = orphanStartCluster;
1310 c = nextInChain(c);
1394 ClusterInfo **template)
1403 alreadyMarked = allocInUse(clusterNum, template);
1427 * Return cl as the template to use for other clusters in
1430 if (template)
1431 *template = cl;
1439 CachedCluster *c;
1450 if (c = findClusterCacheEntry(clusterNum)) {
1451 c->modified = 1;