nx_jrnl_archive_lib_t138.nx
buildroot/runtime/nx_jrnl_archive_lib_t138.nx
about
Private archive qualification: cooperating writers must hold journal+".lock" before opening
the journal through durable close. The lock file is stable and must never be removed.
Unconverted writers remain a deployment blocker; advisory locking cannot stop them.
Collision/write/verification/durability failures preserve live data. rc7 lock; rc8 source changed;
rc9 reset occurred but durability failed (archive durable); rc4 includes exclusive-name collision.
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_sha256.nx
imported by: nx_compare_receipt_lib_t138.nxnx_jrnl_archive_gate_t138.nx
structs
| none |
consts
| 9 | const JA_DIGEST_BYTES: i64 = 32 |
| 10 | const JA_ARCH_MODE: i64 = 0x1a4 // rw-r--r-- for the archived copy |
| 11 | const JA_DIR_MODE: i64 = 0x1ed // rwxr-xr-x for the archive dir |
| 12 | const JA_STAT_BYTES: i64 = 144 // x86-64 statfs ABI |
| 13 | const JA_PATH_MAX: i64 = 4096 // PATH_MAX: the kernel bound on a path |
| 14 | const JA_FRAME_BYTES: i64 = 4 * JA_PATH_MAX + 5 * JA_DIGEST_BYTES + 4 * 16 + JA_STAT_BYTES |
functions
| 16 | func ja_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 17 | func ja_puts(s: *u8) -> i64 { sys_write(1, s, ja_slen(s)); return 0 } |
| 18 | func ja_pn(v: i64) -> i64 |
| 31 | func ja_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } d[p] = 0 as u8; return p } |
| 32 | func ja_catn(d: *u8, o: i64, v: i64) -> i64 |
| 44 | func ja_hex(d: *u8, out: *u8) -> i64 |
| 58 | func ja_basename(p: *u8) -> *u8 called by 1: ja_archive_in_frame |
| 64 | func ja_dirname(p: *u8, out: *u8) -> i64 |
| 75 | func ja_write_all(path: *u8, buf: *u8, n: i64, mode: i64) -> i64 |
| 91 | func ja_lock(journal: *u8) -> i64 |
| 105 | func ja_unlock(fd: i64) -> i64 { return sys_close(fd) } |
| 108 | func ja_transfer_fd(fd: i64, dest: i64, expected: i64, block: i64, digest: *u8) -> i64 |
| 141 | func ja_transfer(path: *u8, dest: i64, digest: *u8, count: *i64) -> i64 |
| 163 | func ja_digest_same(a: *u8, b: *u8) -> i64 |
| 168 | func ja_sync_dir(path: *u8) -> i64 |
| 176 | func ja_write_exclusive(path: *u8, buf: *u8, n: i64) -> i64 |
| 191 | func ja_announce(src: *u8, bytes: i64, hex: *u8, arch: *u8, verified: i64, reset: i64, rc: i64, why: *u8, rep: *i64) -> i64 |
| 204 | func ja_archive_in_frame(journal: *u8, archive_dir: *u8, epoch: i64, rep: *i64, frame: *u8) -> i64 |
| 262 | func ja_archive_locked(journal: *u8, archive_dir: *u8, epoch: i64, rep: *i64) -> i64 called by 2: jg_process_gateja_archive_cooperative calls 4: sys_mmap_sharedja_archive_in_framesys_munmapja_puts |
| 270 | func ja_archive_cooperative(journal: *u8, archive_dir: *u8, epoch: i64, rep: *i64) -> i64 |
| 283 | func ja_archive(journal: *u8, archive_dir: *u8, epoch: i64, rep: *i64) -> i64 |