2019-01-25 19:07:25 -03:00
|
|
|
/*
|
2019-03-11 00:45:19 -03:00
|
|
|
* Copyright (C) 2019 Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
|
2019-01-25 19:07:25 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _OBJECT_H
|
|
|
|
|
#define _OBJECT_H
|
|
|
|
|
|
2019-05-23 17:50:48 -03:00
|
|
|
#include <apfs/types.h>
|
2019-09-11 19:27:08 -03:00
|
|
|
#include "htable.h"
|
2019-01-25 19:07:25 -03:00
|
|
|
|
2019-05-23 17:50:48 -03:00
|
|
|
struct apfs_obj_phys;
|
2019-01-25 19:07:25 -03:00
|
|
|
struct super_block;
|
2019-02-09 20:52:11 -03:00
|
|
|
struct node;
|
2019-01-25 19:07:25 -03:00
|
|
|
|
2019-01-27 14:42:08 -03:00
|
|
|
/*
|
|
|
|
|
* In-memory representation of an APFS object
|
|
|
|
|
*/
|
|
|
|
|
struct object {
|
|
|
|
|
u64 block_nr;
|
|
|
|
|
u64 oid; /* Often the same as the block number */
|
2019-02-13 22:32:40 -03:00
|
|
|
u64 xid;
|
2019-02-11 18:56:37 -03:00
|
|
|
u32 type;
|
2019-02-11 23:22:16 -03:00
|
|
|
u32 subtype;
|
2019-02-11 19:51:51 -03:00
|
|
|
u32 flags;
|
2023-11-27 19:30:13 -03:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Size of the object in bytes. It's usually a single block, the only
|
|
|
|
|
* exception I've found so far are the spacemans of containers that are
|
|
|
|
|
* too big to have all cib addresses in one block, but too small to fill
|
|
|
|
|
* a whole cab with cib addresses.
|
|
|
|
|
*/
|
|
|
|
|
u32 size;
|
2019-01-27 14:42:08 -03:00
|
|
|
};
|
|
|
|
|
|
2019-02-01 14:53:35 -03:00
|
|
|
extern int obj_verify_csum(struct apfs_obj_phys *obj);
|
2023-11-27 19:30:13 -03:00
|
|
|
extern void *read_object_nocheck(u64 bno, u32 size, struct object *obj);
|
2022-08-23 22:26:56 -03:00
|
|
|
extern u32 parse_object_flags(u32 flags, bool encrypted);
|
2022-10-24 20:30:47 -03:00
|
|
|
extern void *read_object(u64 oid, struct htable_entry **omap_table, struct object *obj);
|
|
|
|
|
extern void *read_object_noheader(u64 oid, struct htable_entry **omap_table, struct object *obj);
|
2019-09-11 19:27:08 -03:00
|
|
|
extern void free_cpoint_map_table(struct htable_entry **table);
|
2019-04-27 00:59:46 -03:00
|
|
|
extern struct cpoint_map *get_cpoint_map(u64 oid);
|
|
|
|
|
extern void *read_ephemeral_object(u64 oid, struct object *obj);
|
2019-01-25 19:07:25 -03:00
|
|
|
|
|
|
|
|
#endif /* _OBJECT_H */
|