요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Scope-based Cleanup Helpers
1-6이 문서는 `GPL-2.0` SPDX license를 사용하며, C scope를 벗어날 때 resource 정리를 수행하는 scope-based cleanup helper를 설명합니다.
.. SPDX-License-Identifier: GPL-2.0
Scope-based cleanup helper API
7-8`include/linux/cleanup.h`에서 `scope-based cleanup helpers`라는 kernel-doc 문서를 가져와 helper의 정식 API와 사용 계약을 수록합니다.
.. kernel-doc:: include/linux/cleanup.h
:doc: scope-based cleanup helpers
요약과 해설
cleanup.rst:1-8Scope-based cleanup helper는 함수의 여러 return 경로에서 lock 해제나 resource 반환을 빠뜨리지 않도록 cleanup 동작을 lexical scope의 종료에 결합합니다.
구체적인 macro와 type 규칙은 `include/linux/cleanup.h`의 kernel-doc가 기준이며, 이 페이지는 해당 source 문서를 그대로 API 참조에 포함합니다.