Lines Matching defs:sf

160 	swap_file_t	*sf;
163 while ((sf = cache) != NULL) {
165 (void) rcm_unregister_interest(hdl, sf->path, 0);
166 swap_file_free(sf);
203 swap_file_t *sf;
212 if ((sf = cache_lookup(rsrcname)) == NULL) {
217 rv = swap_delete(sf, errstr);
228 swap_file_t *sf;
234 if ((sf = cache_lookup(rsrcname)) == NULL) {
239 rv = swap_add(sf, errstr);
254 swap_file_t *sf;
263 if ((sf = cache_lookup(rsrcname)) == NULL) {
269 rv = swap_delete(sf, errstr);
285 swap_file_t *sf;
291 if ((sf = cache_lookup(rsrcname)) == NULL) {
296 rv = swap_add(sf, errstr);
307 swap_file_t *sf;
312 if ((sf = cache_lookup(rsrcname)) == NULL) {
317 cache_remove(sf);
318 swap_file_free(sf);
334 swap_delete(swap_file_t *sf, char **errstr)
347 for (sa = sf->areas; sa != NULL; sa = sa->next) {
353 (void) snprintf(cmd, sizeof (cmd), SWAP_DELETE, sf->path,
381 sf->path, sa->start, sa->len);
396 sf->cache_flags |= SWAP_CACHE_OFFLINED;
407 swap_add(swap_file_t *sf, char **errstr)
415 for (sa = sf->areas; sa != NULL; sa = sa->next) {
422 SWAP_ADD, sf->path, sa->start, sa->len);
431 sf->cache_flags &= ~SWAP_CACHE_OFFLINED;
442 swap_file_t *sf, *stale_sf;
458 for (sf = cache; sf != NULL; sf = sf->next) {
459 sf->cache_flags |= SWAP_CACHE_STALE;
460 for (sa = sf->areas; sa != NULL; sa = sa->next) {
476 if ((sf = cache_lookup(swt->swt_ent[i].ste_path)) == NULL) {
477 if ((sf = swap_file_alloc(swt->swt_ent[i].ste_path)) ==
482 sf->cache_flags |= SWAP_CACHE_NEW;
483 cache_insert(sf);
485 sf->cache_flags &= ~SWAP_CACHE_STALE;
491 if ((sa = swap_area_lookup(sf, &swt->swt_ent[i])) == NULL) {
496 swap_area_add(sf, sa);
510 sf = cache;
511 while (sf != NULL) {
512 sa = sf->areas;
522 swap_area_remove(sf, stale_sa);
529 if (sf->cache_flags & SWAP_CACHE_OFFLINED) {
530 sf->cache_flags &= ~SWAP_CACHE_STALE;
531 sf = sf->next;
535 if (sf->cache_flags & SWAP_CACHE_STALE) {
536 if (rcm_unregister_interest(hdl, sf->path, 0) !=
539 "%s\n", sf->path);
541 stale_sf = sf;
542 sf = sf->next;
548 if (!(sf->cache_flags & SWAP_CACHE_NEW)) {
549 sf = sf->next;
553 if (rcm_register_interest(hdl, sf->path, 0, NULL) !=
556 sf->path);
560 sf->path);
561 sf->cache_flags &= ~SWAP_CACHE_NEW;
563 sf = sf->next;
638 swap_file_t *sf;
641 while ((sf = cache) != NULL) {
643 swap_file_free(sf);
653 swap_file_free(swap_file_t *sf)
657 assert(sf != NULL);
659 while ((sa = sf->areas) != NULL) {
660 sf->areas = sf->areas->next;
663 free(sf);
685 swap_file_t *sf;
687 for (sf = cache; sf != NULL; sf = sf->next) {
688 if (strcmp(rsrc, sf->path) == 0) {
689 return (sf);
719 swap_area_add(swap_file_t *sf, swap_area_t *sa)
721 sa->next = sf->areas;
725 sf->areas = sa;
732 swap_area_remove(swap_file_t *sf, swap_area_t *ent)
734 assert(sf != NULL && ent != NULL);
742 sf->areas = ent->next;
751 swap_file_t *sf;
753 if ((sf = calloc(1, sizeof (*sf))) == NULL) {
757 (void) strlcpy(sf->path, rsrc, sizeof (sf->path));
759 return (sf);
781 swap_area_lookup(swap_file_t *sf, swapent_t *swt_ent)
785 assert(sf != NULL && swt_ent != NULL);
786 assert(strcmp(sf->path, swt_ent->ste_path) == 0);
788 for (sa = sf->areas; sa != NULL; sa = sa->next) {