← Documents Documentation/userspace-api/media/mediactl/media-request-ioc-reinit.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / Media Controller

MEDIA_REQUEST_IOC_REINIT

미제출 또는 완료된 media request의 data를 지워 재사용합니다.

Source pathDocumentation/userspace-api/media/mediactl/media-request-ioc-reinit.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

media-request-ioc-reinit.rst:1-51

재초기화는 완료된 request를 닫고 다시 할당하는 비용을 피합니다. Queue되어 아직 실행 중인 request에는 사용할 수 없으며 이 경우 `EBUSY`를 반환합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: MC
3
4 .. _media_request_ioc_reinit:
5
6 ******************************
7 ioctl MEDIA_REQUEST_IOC_REINIT
8 ******************************
9
10 Name
11 ====
12
13 MEDIA_REQUEST_IOC_REINIT - Re-initialize a request
14
15 Synopsis
16 ========
17
18 .. c:macro:: MEDIA_REQUEST_IOC_REINIT
19
20 ``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
21
22 Arguments
23 =========
24
25 ``request_fd``
26 File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
27
28 Description
29 ===========
30
31 If the media device supports :ref:`requests <media-request-api>`, then
32 this request ioctl can be used to re-initialize a previously allocated
33 request.
34
35 Re-initializing a request will clear any existing data from the request.
36 This avoids having to :c:func:`close()` a completed
37 request and allocate a new request. Instead the completed request can just
38 be re-initialized and it is ready to be used again.
39
40 A request can only be re-initialized if it either has not been queued
41 yet, or if it was queued and completed. Otherwise it will set ``errno``
42 to ``EBUSY``. No other error codes can be returned.
43
44 Return Value
45 ============
46
47 On success 0 is returned, on error -1 and the ``errno`` variable is set
48 appropriately.
49
50 EBUSY
51 The request is queued but not yet completed.
52

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이름, 호출 형식과 인자

1-27

`MEDIA_REQUEST_IOC_REINIT`은 기존 media request의 내용을 지우고 다시 사용할 수 있는 초기 상태로 되돌리는 request fd ioctl입니다.

int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT);
MEDIA_REQUEST_IOC_REINIT 인자
인자설명
request_fd`MEDIA_IOC_REQUEST_ALLOC`이 반환한 request file descriptor

할당 때 받은 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-43

Media device가 request API를 지원할 때 이전에 할당한 request를 이 ioctl로 재초기화할 수 있습니다.

재초기화는 request 안의 기존 data를 모두 지웁니다. 완료된 request를 `close()`하고 새로 할당하는 대신 같은 request fd를 깨끗한 상태로 재사용할 수 있습니다.

아직 queue하지 않은 request 또는 queue 후 완료된 request만 재초기화할 수 있습니다. Queue되었지만 아직 완료되지 않은 request에는 `EBUSY`를 반환하며 다른 전용 오류 코드는 없습니다.

Request 재사용
Request가 미제출 상태이거나 완료되었는지 확인MEDIA_REQUEST_IOC_REINIT 호출기존 buffer와 control data 제거새 buffer와 control로 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되었지만 아직 완료되지 않았다는 뜻입니다. 완료를 기다린 후 재초기화를 다시 시도해야 합니다.

MEDIA_REQUEST_IOC_REINIT 전용 오류
errno조건
EBUSYRequest가 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.