netatalk  4.6.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
subtests_lock.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2026 Andy Lemin (andylemin)
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13*/
14
15#ifndef SUBTESTS_LOCK_H
16#define SUBTESTS_LOCK_H
17
18#include <atalk/volume.h>
19
20extern int utest_faultinject_selftest(const struct vol *vol);
21extern int utest_openfork_no_fd_leak(const struct vol *vol);
22extern int utest_shared_adouble_refcount_balance(const struct vol *vol);
23extern int utest_adclose_underflow_aborts(const struct vol *vol);
24extern int utest_ro_retry_strips_destructive_flags(const struct vol *vol);
25extern int utest_ad2openflags_accmode(const struct vol *vol);
26
27extern int utest_testlock_range_clamp(const struct vol *vol);
28extern int utest_testlock_whole(const struct vol *vol);
29extern int utest_testlock_range_no_self_report(const struct vol *vol);
30extern int utest_testlock_range_wrlck_sees_rdlck(const struct vol *vol);
31extern int utest_of_get_locks_contract(const struct vol *vol);
32extern int utest_of_get_locks_fastpath(const struct vol *vol);
33extern int utest_of_get_locks_failclosed(const struct vol *vol);
34extern int utest_deletefile_quirk_hazard(const struct vol *vol);
35extern int utest_deletefile_quirk(struct vol *vol);
36extern int utest_deletefile_nodelete(const struct vol *vol);
37
38extern int utest_shared_rlock(const struct vol *vol);
39extern int utest_overlap_strand(const struct vol *vol);
40extern int utest_freelock_unlck_fail_logs(const struct vol *vol);
41extern int utest_fork_setmode_fdeny(const struct vol *vol);
42extern int utest_of_alloc_fifo(struct vol *vol);
43
44#endif /* SUBTESTS_LOCK_H */
Definition include/atalk/volume.h:33
int utest_of_get_locks_contract(const struct vol *vol)
of_get_locks(): positional band bitmap, independent df/rf, tri-valued.
Definition subtests_lock.c:800
int utest_overlap_strand(const struct vol *vol)
Overlapping read locks from two fork owners coalesce in the kernel; the union unlock must release the...
Definition subtests_lock.c:1338
int utest_testlock_range_clamp(const struct vol *vol)
ad_testlock_range() clamps a data-zone probe; never sweeps the band.
Definition subtests_lock.c:538
int utest_deletefile_quirk_hazard(const struct vol *vol)
Negative control: demonstrate the POSIX close-drops-locks hazard is real.
Definition subtests_lock.c:1122
int utest_testlock_range_no_self_report(const struct vol *vol)
ad_testlock_range() does not report this process's own band entry.
Definition subtests_lock.c:690
int utest_of_get_locks_fastpath(const struct vol *vol)
of_get_locks(): >=2-dimension whole-fd fast path, per-bit on a hit.
Definition subtests_lock.c:851
int utest_of_get_locks_failclosed(const struct vol *vol)
of_get_locks(): indeterminate -> OF_LOCKS_ERROR; missing -> NOENT.
Definition subtests_lock.c:920
int utest_shared_rlock(const struct vol *vol)
Two same-range read locks from two fork owners share one refcount; the kernel lock survives the first...
Definition subtests_lock.c:1291
int utest_ad2openflags_accmode(const struct vol *vol)
ad2openflags(): RDONLY+SETSHRMD on the data fork is promoted to O_RDWR (share-mode locks need a writa...
Definition subtests_lock.c:425
int utest_testlock_whole(const struct vol *vol)
ad_testlock_whole() issues one unclamped F_GETLK over the whole fd.
Definition subtests_lock.c:619
int utest_freelock_unlck_fail_logs(const struct vol *vol)
A failed refcount-0 F_UNLCK in adf_freelock() is logged and the entry still dropped (log-drop-continu...
Definition subtests_lock.c:1383
int utest_faultinject_selftest(const struct vol *vol)
Framework capability probe: does fault injection reach into libatalk?
Definition subtests_lock.c:75
int utest_deletefile_quirk(struct vol *vol)
deletefile()'s conflict GET through a held fd preserves the held lock.
Definition subtests_lock.c:1023
int utest_ro_retry_strips_destructive_flags(const struct vol *vol)
Read-only downgrade retry re-opens without destructive flags.
Definition subtests_lock.c:353
int utest_of_alloc_fifo(struct vol *vol)
of_alloc()/of_dealloc() free-slot FIFO contract.
Definition subtests_lock.c:1505
int utest_testlock_range_wrlck_sees_rdlck(const struct vol *vol)
ad_testlock_range()'s F_WRLCK probe sees a peer's F_RDLCK band entry.
Definition subtests_lock.c:746
int utest_shared_adouble_refcount_balance(const struct vol *vol)
Shared-adouble open/close refcount + fileno ledger stays balanced.
Definition subtests_lock.c:193
int utest_fork_setmode_fdeny(const struct vol *vol)
fork_setmode_deny() maps each access mode to the right F_SHARE deny bits. The pre-fix expression mis-...
Definition subtests_lock.c:1473
int utest_openfork_no_fd_leak(const struct vol *vol)
afp_openfork() error cleanup closes an open fork's fd (no leak).
Definition subtests_lock.c:134
int utest_deletefile_nodelete(const struct vol *vol)
deletefile() honours the NODELETE attribute (per backend).
Definition subtests_lock.c:1199
int utest_adclose_underflow_aborts(const struct vol *vol)
ad_close() hard-fails on an adf_refcount underflow.
Definition subtests_lock.c:278