요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
.. c:namespace:: MC
.. _media_request_ioc_reinit:
******************************
ioctl MEDIA_REQUEST_IOC_REINIT
******************************
Name
====
MEDIA_REQUEST_IOC_REINIT - Re-initialize a request
Synopsis
========
.. c:macro:: MEDIA_REQUEST_IOC_REINIT
``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
Arguments
=========
``request_fd``
File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
Description
===========
If the media device supports :ref:`requests <media-request-api>`, then
this request ioctl can be used to re-initialize a previously allocated
request.
Re-initializing a request will clear any existing data from the request.
This avoids having to :c:func:`close()` a completed
request and allocate a new request. Instead the completed request can just
be re-initialized and it is ready to be used again.
A request can only be re-initialized if it either has not been queued
yet, or if it was queued and completed. Otherwise it will set ``errno``
to ``EBUSY``. No other error codes can be returned.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately.
EBUSY
The request is queued but not yet completed.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름, 호출 형식과 인자
1-27`MEDIA_REQUEST_IOC_REINIT`은 기존 media request의 내용을 지우고 다시 사용할 수 있는 초기 상태로 되돌리는 request fd ioctl입니다.
int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT);
할당 때 받은 request fd를 직접 사용합니다.
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
.. c:namespace:: MC
.. _media_request_ioc_reinit:
******************************
ioctl MEDIA_REQUEST_IOC_REINIT
******************************
Name
====
MEDIA_REQUEST_IOC_REINIT - Re-initialize a request
Synopsis
========
.. c:macro:: MEDIA_REQUEST_IOC_REINIT
``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
Arguments
=========
``request_fd``
File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
내용 제거와 재사용 조건
28-43Media device가 request API를 지원할 때 이전에 할당한 request를 이 ioctl로 재초기화할 수 있습니다.
재초기화는 request 안의 기존 data를 모두 지웁니다. 완료된 request를 `close()`하고 새로 할당하는 대신 같은 request fd를 깨끗한 상태로 재사용할 수 있습니다.
아직 queue하지 않은 request 또는 queue 후 완료된 request만 재초기화할 수 있습니다. Queue되었지만 아직 완료되지 않은 request에는 `EBUSY`를 반환하며 다른 전용 오류 코드는 없습니다.
완료 여부를 확인한 뒤 기존 request object를 비워 다시 구성합니다.
Description
===========
If the media device supports :ref:`requests <media-request-api>`, then
this request ioctl can be used to re-initialize a previously allocated
request.
Re-initializing a request will clear any existing data from the request.
This avoids having to :c:func:`close()` a completed
request and allocate a new request. Instead the completed request can just
be re-initialized and it is ready to be used again.
A request can only be re-initialized if it either has not been queued
yet, or if it was queued and completed. Otherwise it will set ``errno``
to ``EBUSY``. No other error codes can be returned.
반환값과 EBUSY
44-51성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 설정합니다.
`EBUSY`는 request가 queue되었지만 아직 완료되지 않았다는 뜻입니다. 완료를 기다린 후 재초기화를 다시 시도해야 합니다.
실행 중인 request를 보호합니다.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately.
EBUSY
The request is queued but not yet completed.
요약·해설
media-request-ioc-reinit.rst:1-51재초기화는 완료된 request를 닫고 다시 할당하는 비용을 피합니다. Queue되어 아직 실행 중인 request에는 사용할 수 없으며 이 경우 `EBUSY`를 반환합니다.