X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=util-linux%2Fvolume_id%2Fsysv.c;h=cd4cd906b13424219bb604fd9166336a6bf90f11;hb=5b2cc0aaee6985431d9bab1b49ceea7e1fa1d7af;hp=71c0fd496bedfdfc35640f7c3a800c73c4994f77;hpb=de7684a309ad20c1b889d048d741cb1dd52245f7;p=oweals%2Fbusybox.git diff --git a/util-linux/volume_id/sysv.c b/util-linux/volume_id/sysv.c index 71c0fd496..cd4cd906b 100644 --- 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 */ +//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 -struct sysv_super -{ +struct sysv_super { 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; -} __attribute__((__packed__)); +} PACKED; #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; -} __attribute__((__packed__)); +} PACKED; #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 -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; @@ -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)) { - 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); - id->type = "sysv"; + IF_FEATURE_BLKID_TYPE(id->type = "sysv"); 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)) { - 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); - id->type = "xenix"; + IF_FEATURE_BLKID_TYPE(id->type = "xenix";) goto found; } } @@ -120,6 +127,6 @@ int volume_id_probe_sysv(struct volume_id *id, uint64_t off) return -1; found: - volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); +// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); return 0; }