Lines Matching refs:fs

37 #define SWAP_SPECIFIC(fs) ((SwapSpecific*) (fs->type_specific))
80 static int swap_close (PedFileSystem* fs);
85 PedFileSystem* fs;
98 fs = _swap_v0_open(geom);
102 fs = _swap_v1_open(geom);
106 fs = _swap_swsusp_open(geom);
113 if (!fs)
115 fs_info = SWAP_SPECIFIC (fs);
125 swap_close (fs);
129 swap_close (fs);
138 PedFileSystem* fs;
144 fs = _swap_v0_open(geom);
148 fs = _swap_v1_open(geom);
152 fs = _swap_swsusp_open(geom);
159 if (!fs)
166 swap_close (fs);
170 swap_close (fs);
177 swap_init (PedFileSystem* fs, int fresh)
179 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
182 fs_info->page_count = fs->geom->length / fs_info->page_sectors;
199 return ped_geometry_read (fs->geom, fs_info->header,
206 PedFileSystem* fs;
209 fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem));
210 if (!fs)
213 fs->type_specific = (SwapSpecific*) ped_malloc (sizeof (SwapSpecific));
214 if (!fs->type_specific)
217 fs_info = SWAP_SPECIFIC (fs);
222 fs_info = SWAP_SPECIFIC (fs);
228 fs->geom = ped_geometry_duplicate (geom);
229 if (!fs->geom)
231 fs->type = &_swap_v1_type;
232 return fs;
239 free (fs->type_specific);
241 free (fs);
247 swap_free (PedFileSystem* fs)
249 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
253 free (fs->type_specific);
255 ped_geometry_destroy (fs->geom);
256 free (fs);
262 PedFileSystem* fs;
266 fs = swap_alloc (geom);
267 if (!fs)
269 swap_init (fs, 0);
271 fs_info = SWAP_SPECIFIC (fs);
272 if (!ped_geometry_read (fs->geom, fs_info->header, 0,
280 = PED_MIN (fs->geom->length / fs_info->page_sectors,
292 fs->checked = 1;
293 return fs;
296 swap_free (fs);
304 PedFileSystem* fs;
308 fs = swap_alloc (geom);
309 if (!fs)
311 /* swap_init (fs, 0); */
313 /* fs_info = SWAP_SPECIFIC (fs); */
314 /* if (!ped_geometry_read (fs->geom, fs_info->header, 0, */
316 if (!swap_init(fs, 0))
319 fs_info = SWAP_SPECIFIC (fs);
335 fs->checked = 1;
336 return fs;
339 swap_free (fs);
347 PedFileSystem* fs;
351 fs = swap_alloc (geom);
352 if (!fs)
354 fs->type = &_swap_swsusp_type;
355 swap_init (fs, 0);
357 fs_info = SWAP_SPECIFIC (fs);
358 if (!ped_geometry_read (fs->geom, fs_info->header, 0,
375 fs->checked = 1;
376 return fs;
379 swap_free (fs);
385 swap_close (PedFileSystem* fs)
387 swap_free (fs);
393 swap_new_find_bad_page (PedFileSystem* fs, unsigned int page)
395 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
407 swap_new_remove_bad_page (PedFileSystem* fs, unsigned int page)
409 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
412 pos = swap_new_find_bad_page (fs, page);
425 swap_mark_page (PedFileSystem* fs, unsigned int page, int ok)
427 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
437 if (swap_new_remove_bad_page (fs, page))
440 if (swap_new_find_bad_page (fs, page))
461 swap_clear_pages (PedFileSystem* fs)
463 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
467 swap_mark_page (fs, i, 1);
472 swap_mark_page (fs, i, 0);
478 swap_check_pages (PedFileSystem* fs, PedTimer* timer)
480 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
490 swap_clear_pages (fs);
496 fs->geom,
508 if (!swap_mark_page (fs, stop_page, 0))
516 swap_write (PedFileSystem* fs)
518 SwapSpecific* fs_info = SWAP_SPECIFIC (fs);
530 return ped_geometry_write (fs->geom, fs_info->header, 0,
537 PedFileSystem* fs;
539 fs = swap_alloc (geom);
540 if (!fs)
542 swap_init (fs, 1);
543 if (!swap_write (fs))
545 return fs;
548 swap_free (fs);
554 swap_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
556 PedGeometry* old_geom = fs->geom;
558 fs->geom = ped_geometry_duplicate (geom);
559 swap_init (fs, old_geom->start != geom->start);
560 if (!swap_write (fs))
566 ped_geometry_destroy (fs->geom);
567 fs->geom = old_geom;
572 swap_copy (const PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
578 swap_check (PedFileSystem* fs, PedTimer* timer)
580 return swap_check_pages (fs, timer)
581 && swap_write (fs);
598 swap_get_resize_constraint (const PedFileSystem* fs)
600 return swap_get_create_constraint (fs->geom->dev);
604 swap_get_copy_constraint (const PedFileSystem* fs, const PedDevice* dev)