Lines Matching full:super
59 static int btt_info_write(struct arena_info *arena, struct btt_sb *super) in btt_info_write() argument
73 ret = arena_write_bytes(arena, arena->info2off, super, in btt_info_write()
78 return arena_write_bytes(arena, arena->infooff, super, in btt_info_write()
82 static int btt_info_read(struct arena_info *arena, struct btt_sb *super) in btt_info_read() argument
84 return arena_read_bytes(arena, arena->infooff, super, in btt_info_read()
774 /* Two pages are reserved for the super block and its copy */ in alloc_arena()
820 static void parse_arena_meta(struct arena_info *arena, struct btt_sb *super, in parse_arena_meta() argument
823 arena->internal_nlba = le32_to_cpu(super->internal_nlba); in parse_arena_meta()
824 arena->internal_lbasize = le32_to_cpu(super->internal_lbasize); in parse_arena_meta()
825 arena->external_nlba = le32_to_cpu(super->external_nlba); in parse_arena_meta()
826 arena->external_lbasize = le32_to_cpu(super->external_lbasize); in parse_arena_meta()
827 arena->nfree = le32_to_cpu(super->nfree); in parse_arena_meta()
828 arena->version_major = le16_to_cpu(super->version_major); in parse_arena_meta()
829 arena->version_minor = le16_to_cpu(super->version_minor); in parse_arena_meta()
831 arena->nextoff = (super->nextoff == 0) ? 0 : (arena_off + in parse_arena_meta()
832 le64_to_cpu(super->nextoff)); in parse_arena_meta()
834 arena->dataoff = arena_off + le64_to_cpu(super->dataoff); in parse_arena_meta()
835 arena->mapoff = arena_off + le64_to_cpu(super->mapoff); in parse_arena_meta()
836 arena->logoff = arena_off + le64_to_cpu(super->logoff); in parse_arena_meta()
837 arena->info2off = arena_off + le64_to_cpu(super->info2off); in parse_arena_meta()
839 arena->size = (le64_to_cpu(super->nextoff) > 0) in parse_arena_meta()
840 ? (le64_to_cpu(super->nextoff)) in parse_arena_meta()
843 arena->flags = le32_to_cpu(super->flags); in parse_arena_meta()
850 struct btt_sb *super; in discover_arenas() local
856 super = kzalloc(sizeof(*super), GFP_KERNEL); in discover_arenas()
857 if (!super) in discover_arenas()
869 ret = btt_info_read(arena, super); in discover_arenas()
873 if (!nd_btt_arena_is_valid(btt->nd_btt, super)) { in discover_arenas()
887 parse_arena_meta(arena, super, cur_off); in discover_arenas()
922 kfree(super); in discover_arenas()
929 kfree(super); in discover_arenas()
973 struct btt_sb *super; in btt_arena_write_layout() local
985 super = kzalloc(sizeof(struct btt_sb), GFP_NOIO); in btt_arena_write_layout()
986 if (!super) in btt_arena_write_layout()
989 strncpy(super->signature, BTT_SIG, BTT_SIG_LEN); in btt_arena_write_layout()
990 export_uuid(super->uuid, nd_btt->uuid); in btt_arena_write_layout()
991 export_uuid(super->parent_uuid, parent_uuid); in btt_arena_write_layout()
992 super->flags = cpu_to_le32(arena->flags); in btt_arena_write_layout()
993 super->version_major = cpu_to_le16(arena->version_major); in btt_arena_write_layout()
994 super->version_minor = cpu_to_le16(arena->version_minor); in btt_arena_write_layout()
995 super->external_lbasize = cpu_to_le32(arena->external_lbasize); in btt_arena_write_layout()
996 super->external_nlba = cpu_to_le32(arena->external_nlba); in btt_arena_write_layout()
997 super->internal_lbasize = cpu_to_le32(arena->internal_lbasize); in btt_arena_write_layout()
998 super->internal_nlba = cpu_to_le32(arena->internal_nlba); in btt_arena_write_layout()
999 super->nfree = cpu_to_le32(arena->nfree); in btt_arena_write_layout()
1000 super->infosize = cpu_to_le32(sizeof(struct btt_sb)); in btt_arena_write_layout()
1001 super->nextoff = cpu_to_le64(arena->nextoff); in btt_arena_write_layout()
1006 super->dataoff = cpu_to_le64(arena->dataoff - arena->infooff); in btt_arena_write_layout()
1007 super->mapoff = cpu_to_le64(arena->mapoff - arena->infooff); in btt_arena_write_layout()
1008 super->logoff = cpu_to_le64(arena->logoff - arena->infooff); in btt_arena_write_layout()
1009 super->info2off = cpu_to_le64(arena->info2off - arena->infooff); in btt_arena_write_layout()
1011 super->flags = 0; in btt_arena_write_layout()
1012 sum = nd_sb_checksum((struct nd_gen_sb *) super); in btt_arena_write_layout()
1013 super->checksum = cpu_to_le64(sum); in btt_arena_write_layout()
1015 ret = btt_info_write(arena, super); in btt_arena_write_layout()
1017 kfree(super); in btt_arena_write_layout()