ufs.c revision 2603474ff9be2418900581da1af5cccc9f13cae1
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "libvolume_id.h"
#include "libvolume_id-private.h"
#include "util.h"
struct ufs_super_block {
struct ufs_csum {
} PACKED fs_cstotal;
union {
struct {
struct {
struct ufs2_csum_total {
} PACKED fs_cstotal;
struct ufs_timeval {
} fs_u11;
union {
struct {
struct {
struct {
} fs_u2;
} PACKED;
#define UFS_MAGIC 0x00011954
#define UFS2_MAGIC 0x19540119
#define UFS_MAGIC_FEA 0x00195612
#define UFS_MAGIC_LFN 0x00095014
{
int i;
struct ufs_super_block *ufs;
for (i = 0; offsets[i] >= 0; i++) {
return -1;
(magic == UFS2_MAGIC) ||
(magic == UFS_MAGIC_FEA) ||
(magic == UFS_MAGIC_LFN)) {
goto found;
}
(magic == UFS2_MAGIC) ||
(magic == UFS_MAGIC_FEA) ||
(magic == UFS_MAGIC_LFN)) {
goto found;
}
}
return -1;
switch (magic) {
case UFS_MAGIC:
break;
case UFS2_MAGIC:
break;
default:
break;
}
return 0;
}