chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udevadm: add --version --help options to man page, hide them as commands
[elogind.git]
/
extras
/
volume_id
/
lib
/
gfs.c
diff --git
a/extras/volume_id/lib/gfs.c
b/extras/volume_id/lib/gfs.c
index 40a4493b32710bd6fb55c6ff1ea57966d18fcccb..e1293ebce724f01e826d75faccd88c32ad42cf39 100644
(file)
--- a/
extras/volume_id/lib/gfs.c
+++ b/
extras/volume_id/lib/gfs.c
@@
-24,6
+24,7
@@
#include <ctype.h>
#include "libvolume_id.h"
#include <ctype.h>
#include "libvolume_id.h"
+#include "libvolume_id-private.h"
#include "util.h"
/* Common gfs/gfs2 constants: */
#include "util.h"
/* Common gfs/gfs2 constants: */
@@
-78,7
+79,7
@@
static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
{
struct gfs2_sb *sbd;
{
struct gfs2_sb *sbd;
- info("probing at offset 0x%llx", (unsigned long long) off);
+ info("probing at offset 0x%llx
\n
", (unsigned long long) off);
sbd = (struct gfs2_sb *)
volume_id_get_buffer(id, off + GFS_SUPERBLOCK_OFFSET, sizeof(struct gfs2_sb));
sbd = (struct gfs2_sb *)
volume_id_get_buffer(id, off + GFS_SUPERBLOCK_OFFSET, sizeof(struct gfs2_sb));
@@
-86,8
+87,7
@@
static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
return -1;
if (be32_to_cpu(sbd->sb_header.mh_magic) == GFS_MAGIC &&
return -1;
if (be32_to_cpu(sbd->sb_header.mh_magic) == GFS_MAGIC &&
- be32_to_cpu(sbd->sb_header.mh_type) == GFS_METATYPE_SB &&
- be32_to_cpu(sbd->sb_header.mh_format) == GFS_FORMAT_SB) {
+ be32_to_cpu(sbd->sb_header.mh_type) == GFS_METATYPE_SB) {
if (vers == 1) {
if (be32_to_cpu(sbd->sb_fs_format) != GFS_FORMAT_FS ||
be32_to_cpu(sbd->sb_multihost_format) != GFS_FORMAT_MULTI)
if (vers == 1) {
if (be32_to_cpu(sbd->sb_fs_format) != GFS_FORMAT_FS ||
be32_to_cpu(sbd->sb_multihost_format) != GFS_FORMAT_MULTI)
@@
-102,6
+102,13
@@
static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
}
else
return -1;
}
else
return -1;
+
+ if (strlen(sbd->sb_locktable)) {
+ uint8_t *label = (uint8_t *) sbd->sb_locktable;
+
+ volume_id_set_label_raw(id, label, GFS_LOCKNAME_LEN);
+ volume_id_set_label_string(id, label, GFS_LOCKNAME_LEN);
+ }
strcpy(id->type_version, "1");
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
return 0;
strcpy(id->type_version, "1");
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
return 0;
@@
-109,12
+116,12
@@
static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
return -1;
}
return -1;
}
-int volume_id_probe_gfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_gfs(struct volume_id *id, uint64_t off
, uint64_t size
)
{
return volume_id_probe_gfs_generic(id, off, 1);
}
{
return volume_id_probe_gfs_generic(id, off, 1);
}
-int volume_id_probe_gfs2(struct volume_id *id, uint64_t off)
+int volume_id_probe_gfs2(struct volume_id *id, uint64_t off
, uint64_t size
)
{
return volume_id_probe_gfs_generic(id, off, 2);
}
{
return volume_id_probe_gfs_generic(id, off, 2);
}