lib/zlib_dfltcc/dfltcc_util.h
Source file repositories/reference/linux-study-clean/lib/zlib_dfltcc/dfltcc_util.h
File Facts
- System
- Linux kernel
- Corpus path
lib/zlib_dfltcc/dfltcc_util.h- Extension
.h- Size
- 3225 bytes
- Lines
- 132
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dfltcc.hlinux/kmsan-checks.hlinux/zutil.h
Detected Declarations
function dfltccfunction is_bit_setfunction turn_bit_offfunction dfltcc_are_params_ok
Annotated Snippet
switch (fn & DFLTCC_FN_MASK) {
case DFLTCC_QAF:
kmsan_unpoison_memory(param, sizeof(struct dfltcc_qaf_param));
break;
case DFLTCC_GDHT:
kmsan_unpoison_memory(param, offsetof(struct dfltcc_param_v0, csb));
break;
case DFLTCC_CMPR:
kmsan_unpoison_memory(param, sizeof(struct dfltcc_param_v0));
kmsan_unpoison_memory(
orig_t2,
t2 - orig_t2 +
(((struct dfltcc_param_v0 *)param)->sbb == 0 ? 0 : 1));
break;
case DFLTCC_XPND:
kmsan_unpoison_memory(param, sizeof(struct dfltcc_param_v0));
kmsan_unpoison_memory(orig_t2, t2 - orig_t2);
break;
}
if (op1)
*op1 = t2;
if (len1)
*len1 = t3;
if (op2)
*op2 = t4;
if (len2)
*len2 = t5;
return (cc >> 28) & 3;
}
static inline int is_bit_set(
const char *bits,
int n
)
{
return bits[n / 8] & (1 << (7 - (n % 8)));
}
static inline void turn_bit_off(
char *bits,
int n
)
{
bits[n / 8] &= ~(1 << (7 - (n % 8)));
}
static inline int dfltcc_are_params_ok(
int level,
uInt window_bits,
int strategy,
uLong level_mask
)
{
return (level_mask & (1 << level)) != 0 &&
(window_bits == HB_BITS) &&
(strategy == Z_DEFAULT_STRATEGY);
}
char *oesc_msg(char *buf, int oesc);
#endif /* DFLTCC_UTIL_H */
Annotation
- Immediate include surface: `dfltcc.h`, `linux/kmsan-checks.h`, `linux/zutil.h`.
- Detected declarations: `function dfltcc`, `function is_bit_set`, `function turn_bit_off`, `function dfltcc_are_params_ok`.
- Atlas domain: Kernel Services / lib.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.