~ubuntu-branches/ubuntu/utopic/parted/utopic-proposed

« back to all changes in this revision

Viewing changes to libparted/fs/ufs/ufs.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-07-21 10:23:16 UTC
  • mfrom: (7.2.32 sid)
  • Revision ID: package-import@ubuntu.com-20140721102316-jsyv3yzmbo8vlde5
Tags: 3.1-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    libparted - a library for manipulating disk partitions
3
 
    Copyright (C) 2001, 2007, 2009-2010 Free Software Foundation, Inc.
 
3
    Copyright (C) 2001, 2007, 2009-2012 Free Software Foundation, Inc.
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License as published by
319
319
        return NULL;
320
320
}
321
321
 
322
 
#ifndef DISCOVER_ONLY
323
 
static int
324
 
ufs_clobber (PedGeometry* geom)
325
 
{
326
 
        char    buf[1536];
327
 
 
328
 
        if (!ped_geometry_read (geom, buf, 16, 3))
329
 
                return 0;
330
 
 
331
 
        memset (buf, 0, sizeof(struct ufs_super_block));
332
 
 
333
 
        return ped_geometry_write (geom, buf, 16, 3);
334
 
}
335
 
#endif /* !DISCOVER_ONLY */
336
 
 
337
322
static PedFileSystemOps ufs_ops_sun = {
338
323
        probe:          ufs_probe_sun,
339
 
#ifndef DISCOVER_ONLY
340
 
        clobber:        ufs_clobber,
341
 
#else
342
 
        clobber:        NULL,
343
 
#endif
344
 
        open:           NULL,
345
 
        create:         NULL,
346
 
        close:          NULL,
347
 
        check:          NULL,
348
 
        copy:           NULL,
349
 
        resize:         NULL,
350
 
        get_create_constraint:  NULL,
351
 
        get_resize_constraint:  NULL,
352
 
        get_copy_constraint:    NULL
353
324
};
354
325
 
355
326
static PedFileSystemOps ufs_ops_hp = {
356
327
        probe:          ufs_probe_hp,
357
 
#ifndef DISCOVER_ONLY
358
 
        clobber:        ufs_clobber,
359
 
#else
360
 
        clobber:        NULL,
361
 
#endif
362
 
        open:           NULL,
363
 
        create:         NULL,
364
 
        close:          NULL,
365
 
        check:          NULL,
366
 
        copy:           NULL,
367
 
        resize:         NULL,
368
 
        get_create_constraint:  NULL,
369
 
        get_resize_constraint:  NULL,
370
 
        get_copy_constraint:    NULL
371
328
};
372
329
 
373
330
static PedFileSystemOps ufs_ops_freebsd = {
374
331
        probe:          ufs_probe_freebsd,
375
 
#ifndef DISCOVER_ONLY
376
 
        clobber:        ufs_clobber,
377
 
#else
378
 
        clobber:        NULL,
379
 
#endif
380
 
        open:           NULL,
381
 
        create:         NULL,
382
 
        close:          NULL,
383
 
        check:          NULL,
384
 
        copy:           NULL,
385
 
        resize:         NULL,
386
 
        get_create_constraint:  NULL,
387
 
        get_resize_constraint:  NULL,
388
 
        get_copy_constraint:    NULL
389
332
};
390
333
 
391
334
static PedFileSystemType ufs_type_sun = {
411
354
void
412
355
ped_file_system_ufs_init ()
413
356
{
414
 
        PED_ASSERT (sizeof (struct ufs_super_block) == 1380, return);
 
357
        PED_ASSERT (sizeof (struct ufs_super_block) == 1380);
415
358
 
416
359
        ped_file_system_type_register (&ufs_type_sun);
417
360
        ped_file_system_type_register (&ufs_type_hp);