/src/git/odb/source-loose.h
Line | Count | Source |
1 | | #ifndef ODB_SOURCE_LOOSE_H |
2 | | #define ODB_SOURCE_LOOSE_H |
3 | | |
4 | | #include "odb/source.h" |
5 | | |
6 | | struct odb_source_files; |
7 | | struct object_database; |
8 | | struct oidtree; |
9 | | |
10 | | /* |
11 | | * An object database source that stores its objects in loose format, one |
12 | | * file per object. |
13 | | */ |
14 | | struct odb_source_loose { |
15 | | struct odb_source base; |
16 | | |
17 | | /* |
18 | | * Used to store the results of readdir(3) calls when we are OK |
19 | | * sacrificing accuracy due to races for speed. That includes |
20 | | * object existence with OBJECT_INFO_QUICK, as well as |
21 | | * our search for unique abbreviated hashes. Don't use it for tasks |
22 | | * requiring greater accuracy! |
23 | | * |
24 | | * Be sure to call odb_load_loose_cache() before using. |
25 | | */ |
26 | | uint32_t subdir_seen[8]; /* 256 bits */ |
27 | | struct oidtree *cache; |
28 | | |
29 | | /* Map between object IDs for loose objects. */ |
30 | | struct loose_object_map *map; |
31 | | }; |
32 | | |
33 | | struct odb_source_loose *odb_source_loose_new(struct object_database *odb, |
34 | | const char *path, |
35 | | bool local); |
36 | | |
37 | | /* |
38 | | * Cast the given object database source to the loose backend. This will cause |
39 | | * a BUG in case the source doesn't use this backend. |
40 | | */ |
41 | | static inline struct odb_source_loose *odb_source_loose_downcast(struct odb_source *source) |
42 | 0 | { |
43 | 0 | if (source->type != ODB_SOURCE_LOOSE) |
44 | 0 | BUG("trying to downcast source of type '%s' to '%s'", |
45 | 0 | odb_source_type_to_name(source->type), |
46 | 0 | odb_source_type_to_name(ODB_SOURCE_LOOSE)); |
47 | 0 | return container_of(source, struct odb_source_loose, base); |
48 | 0 | } Unexecuted instantiation: setup.c:odb_source_loose_downcast Unexecuted instantiation: submodule.c:odb_source_loose_downcast Unexecuted instantiation: tree-walk.c:odb_source_loose_downcast Unexecuted instantiation: cache-tree.c:odb_source_loose_downcast Unexecuted instantiation: commit.c:odb_source_loose_downcast Unexecuted instantiation: convert.c:odb_source_loose_downcast Unexecuted instantiation: diff.c:odb_source_loose_downcast Unexecuted instantiation: diffcore-rename.c:odb_source_loose_downcast Unexecuted instantiation: dir.c:odb_source_loose_downcast Unexecuted instantiation: log-tree.c:odb_source_loose_downcast Unexecuted instantiation: merge-ort.c:odb_source_loose_downcast Unexecuted instantiation: notes-cache.c:odb_source_loose_downcast Unexecuted instantiation: notes.c:odb_source_loose_downcast Unexecuted instantiation: object-file.c:odb_source_loose_downcast Unexecuted instantiation: object.c:odb_source_loose_downcast Unexecuted instantiation: odb.c:odb_source_loose_downcast Unexecuted instantiation: source.c:odb_source_loose_downcast Unexecuted instantiation: source-files.c:odb_source_loose_downcast Unexecuted instantiation: source-inmemory.c:odb_source_loose_downcast Unexecuted instantiation: source-loose.c:odb_source_loose_downcast Unexecuted instantiation: pack-check.c:odb_source_loose_downcast Unexecuted instantiation: pack-write.c:odb_source_loose_downcast Unexecuted instantiation: packfile.c:odb_source_loose_downcast Unexecuted instantiation: read-cache.c:odb_source_loose_downcast Unexecuted instantiation: revision.c:odb_source_loose_downcast Unexecuted instantiation: sequencer.c:odb_source_loose_downcast Unexecuted instantiation: tmp-objdir.c:odb_source_loose_downcast Unexecuted instantiation: apply.c:odb_source_loose_downcast Unexecuted instantiation: loose.c:odb_source_loose_downcast Unexecuted instantiation: match-trees.c:odb_source_loose_downcast Unexecuted instantiation: rerere.c:odb_source_loose_downcast |
49 | | |
50 | | #endif |