func readBlock(file file.BlockDevice, key int64) (blk *block, err error) { bytes, err := file.ReadBlock(key) if err != nil { return nil, err } return load_block(key, bytes), err }
func load_list_block(file file.BlockDevice, key int64) (self *list_block, err error) { bytes, err := file.ReadBlock(key) if err != nil { return nil, err } data := bytes[LIST_HEADER_LEN:] header := load_list_header(bytes) self = &list_block{ file: file, key: key, bytes: bytes, data: data, header: header, } return self, nil }