gfs.c revision 2603474ff9be2418900581da1af5cccc9f13cae1
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2006 Red Hat, Inc. <redhat.com>
*
* 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"
#define GFS_MAGIC 0x01161970
#define GFS_DEFAULT_BSIZE 4096
#define GFS_METATYPE_SB 1
#define GFS_FORMAT_SB 100
#define GFS_LOCKNAME_LEN 64
/* gfs1 constants: */
#define GFS_FORMAT_FS 1309
#define GFS_FORMAT_MULTI 1401
/* gfs2 constants: */
#define GFS2_FORMAT_FS 1801
#define GFS2_FORMAT_MULTI 1900
struct gfs2_meta_header {
};
struct gfs2_inum {
};
struct gfs2_sb {
struct gfs2_meta_header sb_header;
struct gfs2_inum sb_root_dir;
char sb_lockproto[GFS_LOCKNAME_LEN];
char sb_locktable[GFS_LOCKNAME_LEN];
/* In gfs1, quota and license dinodes followed */
} PACKED;
{
return -1;
if (vers == 1) {
return -1; /* not gfs1 */
}
else if (vers == 2) {
return -1; /* not gfs2 */
}
else
return -1;
}
return 0;
}
return -1;
}
{
}
{
}