| 1 | |
| 2 | /* |
| 3 | * Structures pulled from dump/tape.c. We need it here so the 'archive' code can |
| 4 | * determine where we are in the tape. |
| 5 | */ |
| 6 | #ifndef _SLAVE_H |
| 7 | #define _SLAVE_H 1 |
| 8 | |
| 9 | #include "config.h" // IWYU pragma: keep |
| 10 | #include "compat/include/protocols/dumprestore.h" |
| 11 | |
| 12 | /* |
| 13 | * Concurrent dump mods (Caltech) - disk block reading and tape writing |
| 14 | * are exported to several slave processes. While one slave writes the |
| 15 | * tape, the others read disk blocks; they pass control of the tape in |
| 16 | * a ring via signals. The parent process traverses the filesystem and |
| 17 | * sends writeheader()'s and lists of daddr's to the slaves via pipes. |
| 18 | * The following structure defines the instruction packets sent to slaves. |
| 19 | */ |
| 20 | struct req { |
| 21 | ext2_loff_t dblk; |
| 22 | int count; |
| 23 | int uninit; |
| 24 | }; |
| 25 | |
| 26 | #define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */ |
| 27 | |
| 28 | struct slave { |
| 29 | long long tapea; /* header number at start of this chunk */ |
| 30 | uint32_t count; /* count to next header (used for TS_TAPE */ |
| 31 | /* after EOT) */ |
| 32 | int inode; /* inode that we are currently dealing with */ |
| 33 | int fd; /* FD for this slave */ |
| 34 | int pid; /* PID for this slave */ |
| 35 | int sent; /* 1 == we've sent this slave requests */ |
| 36 | long long firstrec; /* record number of this block */ |
| 37 | char (*tblock)[TP_BSIZE]; /* buffer for data blocks */ |
| 38 | struct req *req; /* buffer for requests */ |
| 39 | void* rawdata; /* Originally allocated buffer */ |
| 40 | }; |
| 41 | |
| 42 | extern struct slave *slp; |
| 43 | |
| 44 | #endif |