Junio C Hamano | 568508e | 2011-10-28 14:48:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011, Google Inc. |
| 3 | */ |
| 4 | #ifndef BULK_CHECKIN_H |
| 5 | #define BULK_CHECKIN_H |
| 6 | |
Elijah Newren | ef3ca95 | 2018-08-15 10:54:05 -0700 | [diff] [blame] | 7 | #include "cache.h" |
| 8 | |
Neeraj Singh | c0f4752 | 2022-04-04 22:20:09 -0700 | [diff] [blame] | 9 | void prepare_loose_object_bulk_checkin(void); |
| 10 | void fsync_loose_object_bulk_checkin(int fd, const char *filename); |
| 11 | |
Denton Liu | 5545442 | 2019-04-29 04:28:14 -0400 | [diff] [blame] | 12 | int index_bulk_checkin(struct object_id *oid, |
Denton Liu | ad6dad0 | 2019-04-29 04:28:23 -0400 | [diff] [blame] | 13 | int fd, size_t size, enum object_type type, |
| 14 | const char *path, unsigned flags); |
Junio C Hamano | 568508e | 2011-10-28 14:48:40 -0700 | [diff] [blame] | 15 | |
Neeraj Singh | 2c23d1b | 2022-04-04 22:20:08 -0700 | [diff] [blame] | 16 | /* |
| 17 | * Tell the object database to optimize for adding |
| 18 | * multiple objects. end_odb_transaction must be called |
| 19 | * to make new objects visible. Transactions can be nested, |
| 20 | * and objects are only visible after the outermost transaction |
| 21 | * is complete or the transaction is flushed. |
| 22 | */ |
| 23 | void begin_odb_transaction(void); |
| 24 | |
| 25 | /* |
| 26 | * Make any objects that are currently part of a pending object |
| 27 | * database transaction visible. It is valid to call this function |
| 28 | * even if no transaction is active. |
| 29 | */ |
| 30 | void flush_odb_transaction(void); |
| 31 | |
| 32 | /* |
| 33 | * Tell the object database to make any objects from the |
| 34 | * current transaction visible if this is the final nested |
| 35 | * transaction. |
| 36 | */ |
| 37 | void end_odb_transaction(void); |
Junio C Hamano | 568508e | 2011-10-28 14:48:40 -0700 | [diff] [blame] | 38 | |
| 39 | #endif |