Lines Matching full:super

61 static int btt_info_write(struct arena_info *arena, struct btt_sb *super)  in btt_info_write()  argument
75 ret = arena_write_bytes(arena, arena->info2off, super, in btt_info_write()
80 return arena_write_bytes(arena, arena->infooff, super, in btt_info_write()
84 static int btt_info_read(struct arena_info *arena, struct btt_sb *super) in btt_info_read() argument
86 return arena_read_bytes(arena, arena->infooff, super, in btt_info_read()
776 /* Two pages are reserved for the super block and its copy */ in alloc_arena()
822 static void parse_arena_meta(struct arena_info *arena, struct btt_sb *super, in parse_arena_meta() argument
825 arena->internal_nlba = le32_to_cpu(super->internal_nlba); in parse_arena_meta()
826 arena->internal_lbasize = le32_to_cpu(super->internal_lbasize); in parse_arena_meta()
827 arena->external_nlba = le32_to_cpu(super->external_nlba); in parse_arena_meta()
828 arena->external_lbasize = le32_to_cpu(super->external_lbasize); in parse_arena_meta()
829 arena->nfree = le32_to_cpu(super->nfree); in parse_arena_meta()
830 arena->version_major = le16_to_cpu(super->version_major); in parse_arena_meta()
831 arena->version_minor = le16_to_cpu(super->version_minor); in parse_arena_meta()
833 arena->nextoff = (super->nextoff == 0) ? 0 : (arena_off + in parse_arena_meta()
834 le64_to_cpu(super->nextoff)); in parse_arena_meta()
836 arena->dataoff = arena_off + le64_to_cpu(super->dataoff); in parse_arena_meta()
837 arena->mapoff = arena_off + le64_to_cpu(super->mapoff); in parse_arena_meta()
838 arena->logoff = arena_off + le64_to_cpu(super->logoff); in parse_arena_meta()
839 arena->info2off = arena_off + le64_to_cpu(super->info2off); in parse_arena_meta()
841 arena->size = (le64_to_cpu(super->nextoff) > 0) in parse_arena_meta()
842 ? (le64_to_cpu(super->nextoff)) in parse_arena_meta()
845 arena->flags = le32_to_cpu(super->flags); in parse_arena_meta()
857 struct btt_sb *super __free(kfree) = kzalloc(sizeof(*super), GFP_KERNEL); in discover_arenas()
858 if (!super) in discover_arenas()
868 ret = btt_info_read(arena, super); in discover_arenas()
872 if (!nd_btt_arena_is_valid(btt->nd_btt, super)) { in discover_arenas()
886 parse_arena_meta(arena, super, cur_off); in discover_arenas()
969 struct btt_sb *super; in btt_arena_write_layout() local
981 super = kzalloc(sizeof(*super), GFP_NOIO); in btt_arena_write_layout()
982 if (!super) in btt_arena_write_layout()
985 strscpy(super->signature, BTT_SIG, sizeof(super->signature)); in btt_arena_write_layout()
986 export_uuid(super->uuid, nd_btt->uuid); in btt_arena_write_layout()
987 export_uuid(super->parent_uuid, parent_uuid); in btt_arena_write_layout()
988 super->flags = cpu_to_le32(arena->flags); in btt_arena_write_layout()
989 super->version_major = cpu_to_le16(arena->version_major); in btt_arena_write_layout()
990 super->version_minor = cpu_to_le16(arena->version_minor); in btt_arena_write_layout()
991 super->external_lbasize = cpu_to_le32(arena->external_lbasize); in btt_arena_write_layout()
992 super->external_nlba = cpu_to_le32(arena->external_nlba); in btt_arena_write_layout()
993 super->internal_lbasize = cpu_to_le32(arena->internal_lbasize); in btt_arena_write_layout()
994 super->internal_nlba = cpu_to_le32(arena->internal_nlba); in btt_arena_write_layout()
995 super->nfree = cpu_to_le32(arena->nfree); in btt_arena_write_layout()
996 super->infosize = cpu_to_le32(sizeof(struct btt_sb)); in btt_arena_write_layout()
997 super->nextoff = cpu_to_le64(arena->nextoff); in btt_arena_write_layout()
1002 super->dataoff = cpu_to_le64(arena->dataoff - arena->infooff); in btt_arena_write_layout()
1003 super->mapoff = cpu_to_le64(arena->mapoff - arena->infooff); in btt_arena_write_layout()
1004 super->logoff = cpu_to_le64(arena->logoff - arena->infooff); in btt_arena_write_layout()
1005 super->info2off = cpu_to_le64(arena->info2off - arena->infooff); in btt_arena_write_layout()
1007 super->flags = 0; in btt_arena_write_layout()
1008 sum = nd_sb_checksum((struct nd_gen_sb *) super); in btt_arena_write_layout()
1009 super->checksum = cpu_to_le64(sum); in btt_arena_write_layout()
1011 ret = btt_info_write(arena, super); in btt_arena_write_layout()
1013 kfree(super); in btt_arena_write_layout()