projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hush: do not assign to readonly VAR in "VAR=VAL CMD" syntax too
[oweals/busybox.git]
/
util-linux
/
volume_id
/
sysv.c
diff --git
a/util-linux/volume_id/sysv.c
b/util-linux/volume_id/sysv.c
index 71c0fd496bedfdfc35640f7c3a800c73c4994f77..cd4cd906b13424219bb604fd9166336a6bf90f11 100644
(file)
--- a/
util-linux/volume_id/sysv.c
+++ b/
util-linux/volume_id/sysv.c
@@
-18,13
+18,19
@@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+//kbuild:lib-$(CONFIG_FEATURE_VOLUMEID_SYSV) += sysv.o
+
+//config:config FEATURE_VOLUMEID_SYSV
+//config: bool "sysv filesystem"
+//config: default y
+//config: depends on VOLUMEID
+
#include "volume_id_internal.h"
#define SYSV_NICINOD 100
#define SYSV_NICFREE 50
#include "volume_id_internal.h"
#define SYSV_NICINOD 100
#define SYSV_NICFREE 50
-struct sysv_super
-{
+struct sysv_super {
uint16_t s_isize;
uint16_t s_pad0;
uint32_t s_fsize;
uint16_t s_isize;
uint16_t s_pad0;
uint32_t s_fsize;
@@
-49,7
+55,7
@@
struct sysv_super
uint32_t s_state;
uint32_t s_magic;
uint32_t s_type;
uint32_t s_state;
uint32_t s_magic;
uint32_t s_type;
-}
__attribute__((__packed__))
;
+}
PACKED
;
#define XENIX_NICINOD 100
#define XENIX_NICFREE 100
#define XENIX_NICINOD 100
#define XENIX_NICFREE 100
@@
-75,7
+81,7
@@
struct xenix_super {
uint8_t s_fill[371];
uint32_t s_magic;
uint32_t s_type;
uint8_t s_fill[371];
uint32_t s_magic;
uint32_t s_type;
-}
__attribute__((__packed__))
;
+}
PACKED
;
#define SYSV_SUPERBLOCK_BLOCK 0x01
#define SYSV_MAGIC 0xfd187e20
#define SYSV_SUPERBLOCK_BLOCK 0x01
#define SYSV_MAGIC 0xfd187e20
@@
-83,8
+89,9
@@
struct xenix_super {
#define XENIX_MAGIC 0x2b5544
#define SYSV_MAX_BLOCKSIZE 0x800
#define XENIX_MAGIC 0x2b5544
#define SYSV_MAX_BLOCKSIZE 0x800
-int
volume_id_probe_sysv(struct volume_id *id, uint64_t off
)
+int
FAST_FUNC volume_id_probe_sysv(struct volume_id *id /*,uint64_t off*/
)
{
{
+#define off ((uint64_t)0)
struct sysv_super *vs;
struct xenix_super *xs;
unsigned boff;
struct sysv_super *vs;
struct xenix_super *xs;
unsigned boff;
@@
-97,9
+104,9
@@
int volume_id_probe_sysv(struct volume_id *id, uint64_t off)
return -1;
if (vs->s_magic == cpu_to_le32(SYSV_MAGIC) || vs->s_magic == cpu_to_be32(SYSV_MAGIC)) {
return -1;
if (vs->s_magic == cpu_to_le32(SYSV_MAGIC) || vs->s_magic == cpu_to_be32(SYSV_MAGIC)) {
-
volume_id_set_label_raw(id, vs->s_fname, 6);
+
//
volume_id_set_label_raw(id, vs->s_fname, 6);
volume_id_set_label_string(id, vs->s_fname, 6);
volume_id_set_label_string(id, vs->s_fname, 6);
-
id->type = "sysv"
;
+
IF_FEATURE_BLKID_TYPE(id->type = "sysv")
;
goto found;
}
}
goto found;
}
}
@@
-110,9
+117,9
@@
int volume_id_probe_sysv(struct volume_id *id, uint64_t off)
return -1;
if (xs->s_magic == cpu_to_le32(XENIX_MAGIC) || xs->s_magic == cpu_to_be32(XENIX_MAGIC)) {
return -1;
if (xs->s_magic == cpu_to_le32(XENIX_MAGIC) || xs->s_magic == cpu_to_be32(XENIX_MAGIC)) {
-
volume_id_set_label_raw(id, xs->s_fname, 6);
+
//
volume_id_set_label_raw(id, xs->s_fname, 6);
volume_id_set_label_string(id, xs->s_fname, 6);
volume_id_set_label_string(id, xs->s_fname, 6);
- id->type = "xenix";
+ IF_FEATURE_BLKID_TYPE(id->type = "xenix";)
goto found;
}
}
goto found;
}
}
@@
-120,6
+127,6
@@
int volume_id_probe_sysv(struct volume_id *id, uint64_t off)
return -1;
found:
return -1;
found:
-
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
+
//
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
return 0;
}
return 0;
}