요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Remote block-device mapping
sysfs-class-rnbd-client:18-119Session name, one or more RTRS paths, server-side device path, access mode와 poll queue를 지정해 remote block device를 mapping합니다.
Mapped device discovery
sysfs-class-rnbd-client:121-133Mapped device마다 device_id@session_name symlink를 만들고 device_path의 slash는 exclamation mark로 변환합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/class/rnbd-client
Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
Description: Provide information about RNBD-client.
All sysfs files that are not read-only provide the usage information on read:
Example::
# cat /sys/class/rnbd-client/ctl/map_device
> Usage: echo "sessname=<name of the rtrs session> path=<[srcaddr,]dstaddr>
> [path=<[srcaddr,]dstaddr>] device_path=<full path on remote side>
> [access_mode=<ro|rw|migration>] > map_device
>
> addr ::= [ ip:<ipv4> | ip:<ipv6> | gid:<gid> ]
What: /sys/class/rnbd-client/ctl/map_device
Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
Description: Expected format is the following::
sessname=<name of the rtrs session>
path=<[srcaddr,]dstaddr> [path=<[srcaddr,]dstaddr> ...]
device_path=<full path on remote side>
[access_mode=<ro|rw|migration>]
Where:
sessname:
accepts a string not bigger than 256 chars, which identifies
a given session on the client and on the server.
I.e. "clt_hostname-srv_hostname" could be a natural choice.
path:
describes a connection between the client and the server by
specifying destination and, when required, the source address.
The addresses are to be provided in the following format::
ip:<IPv6>
ip:<IPv4>
gid:<GID>
for example::
path=ip:10.0.0.66
The single addr is treated as the destination.
The connection will be established to this server from any client IP address.
::
path=ip:10.0.0.66,ip:10.0.1.66
First addr is the source address and the second is the destination.
If multiple "path=" options are specified multiple connection
will be established and data will be sent according to
the selected multipath policy (see RTRS mp_policy sysfs entry description).
device_path:
Path to the block device on the server side. Path is specified
relative to the directory on server side configured in the
'dev_search_path' module parameter of the rnbd_server.
The rnbd_server prepends the <device_path> received from client
with <dev_search_path> and tries to open the
<dev_search_path>/<device_path> block device. On success,
a /dev/rnbd<N> device file, a /sys/block/rnbd<N>/
directory and an entry in /sys/class/rnbd-client/ctl/devices
will be created.
If 'dev_search_path' contains '%SESSNAME%', then each session can
have different devices namespace, e.g. server was configured with
the following parameter "dev_search_path=/run/rnbd-devs/%SESSNAME%",
client has this string "sessname=blya device_path=sda", then server
will try to open: /run/rnbd-devs/blya/sda.
access_mode:
the access_mode parameter specifies if the device is to be
mapped as "ro" read-only or "rw" read-write. The server allows
a device to be exported in rw mode only once. The "migration"
access mode has to be specified if a second mapping in read-write
mode is desired.
By default "rw" is used.
nr_poll_queues
specifies the number of poll-mode queues. If the IO has HIPRI flag,
the block-layer will send the IO via the poll-mode queue.
For fast network and device the polling is faster than interrupt-base
IO handling because it saves time for context switching, switching to
another process, handling the interrupt and switching back to the
issuing process.
Set -1 if you want to set it as the number of CPUs
By default rnbd client creates only irq-mode queues.
NOTICE: MUST make a unique session for a device using the poll-mode queues.
Exit Codes:
If the device is already mapped it will fail with EEXIST. If the input
has an invalid format it will return EINVAL. If the device path cannot
be found on the server, it will fail with ENOENT.
Finding device file after mapping
---------------------------------
After mapping, the device file can be found by:
o The symlink /sys/class/rnbd-client/ctl/devices/<device_id>@<session_name>
points to /sys/block/<dev-name>. The last part of the symlink destination
is the same as the device name. By extracting the last part of the
path the path to the device /dev/<dev-name> can be build.
* /dev/block/$(cat /sys/class/rnbd-client/ctl/devices/<device_id>@<session_name>/dev)
How to find the <device_id> of the device is described on the next
section.
What: /sys/class/rnbd-client/ctl/devices/
Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com>
Description: For each device mapped on the client a new symbolic link is created as
/sys/class/rnbd-client/ctl/devices/<device_id>@<session_name>, which points
to the block device created by rnbd (/sys/block/rnbd<N>/).
The <device_id> of each device is created as follows:
- If the 'device_path' provided during mapping contains slashes ("/"),
they are replaced by exclamation mark ("!") and used as as the
<device_id>. Otherwise, the <device_id> will be the same as the
"device_path" provided.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
RNBD client class and usage information
1-17| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/class/rnbd-client |
| Date | 2020년 2월 |
| KernelVersion | 5.7 |
| Contact | Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com> |
| Description | RNBD client에 관한 정보를 제공합니다. Read-only가 아닌 모든 sysfs file은 읽을 때 사용법 정보를 제공합니다. |
# cat /sys/class/rnbd-client/ctl/map_device
> Usage: echo "sessname=<name of the rtrs session> path=<[srcaddr,]dstaddr>
> [path=<[srcaddr,]dstaddr>] device_path=<full path on remote side>
> [access_mode=<ro|rw|migration>] > map_device
>
> addr ::= [ ip:<ipv4> | ip:<ipv6> | gid:<gid> ]
Map a remote block device
18-119| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/class/rnbd-client/ctl/map_device |
| Date | 2020년 2월 |
| KernelVersion | 5.7 |
| Contact | Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com> |
| Description | Mapping input은 sessname, 하나 이상의 path, device_path, optional access_mode로 구성합니다. sessname은 최대 256자인 문자열로 client와 server 양쪽에서 session을 식별하며 clt_hostname-srv_hostname 같은 이름을 사용할 수 있습니다. path는 destination과 필요할 때 source address를 지정해 client-server connection을 설명합니다. Address 형식은 ip:<IPv6>, ip:<IPv4>, gid:<GID>입니다. Address 하나만 주면 destination으로 취급해 client의 임의 IP에서 server로 연결합니다. 두 address를 comma로 구분하면 첫 번째가 source, 두 번째가 destination입니다. path option을 여러 번 주면 여러 connection을 만들고 선택한 RTRS mp_policy에 따라 data를 전송합니다. device_path는 rnbd_server의 dev_search_path module parameter가 지정한 directory에 상대적인 server-side block-device path입니다. Server는 받은 device_path 앞에 dev_search_path를 붙여 block device를 엽니다. 성공하면 /dev/rnbd<N>, /sys/block/rnbd<N>/와 client ctl/devices entry를 만듭니다. dev_search_path에 %SESSNAME%이 있으면 session별 device namespace로 치환합니다. access_mode는 ro, rw, migration 중 하나이며 server는 rw export를 한 번만 허용하므로 두 번째 read-write mapping에는 migration을 사용해야 합니다. Default는 rw입니다. nr_poll_queues는 poll-mode queue 수를 정합니다. HIPRI IO는 poll-mode queue로 보내며 빠른 network/device에서는 context switch와 interrupt overhead를 줄일 수 있습니다. -1은 CPU 수만큼 설정하고 default client는 irq-mode queue만 만듭니다. Poll-mode queue를 쓰는 device에는 unique session이 반드시 필요합니다. 이미 mapped된 device는 EEXIST, invalid input format은 EINVAL, server에서 device path를 찾지 못하면 ENOENT로 실패합니다. Mapping 뒤 devices/<device_id>@<session_name> symlink의 destination 마지막 component로 device name을 얻거나 해당 entry의 dev 값을 /dev/block/ 아래에서 사용할 수 있습니다. |
sessname=<name of the rtrs session>
path=<[srcaddr,]dstaddr> [path=<[srcaddr,]dstaddr> ...]
device_path=<full path on remote side>
[access_mode=<ro|rw|migration>]
ip:<IPv6>
ip:<IPv4>
gid:<GID>
path=ip:10.0.0.66
path=ip:10.0.0.66,ip:10.0.1.66
dev_search_path=/run/rnbd-devs/%SESSNAME%
sessname=blya device_path=sda
/run/rnbd-devs/blya/sda
/dev/block/$(cat /sys/class/rnbd-client/ctl/devices/<device_id>@<session_name>/dev)
Required mapping fields와 주요 constraint입니다.
Client input이 server path resolution과 local block-device 생성으로 이어집니다.
Server-side export 동시성에 따른 access mode입니다.
Mapping 성공 뒤 생성되는 local device와 discovery entry입니다.
Mapped device symbolic links
121-133| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/class/rnbd-client/ctl/devices/ |
| Date | 2020년 2월 |
| KernelVersion | 5.7 |
| Contact | Jack Wang <jinpu.wang@cloud.ionos.com> Danil Kipnis <danil.kipnis@cloud.ionos.com> |
| Description | Client에 mapped된 각 device마다 /sys/class/rnbd-client/ctl/devices/<device_id>@<session_name> symbolic link를 만들며 RNBD가 생성한 /sys/block/rnbd<N>/ block device를 가리킵니다. Mapping 때 제공한 device_path에 slash가 있으면 slash를 exclamation mark로 바꾼 값을 device_id로 사용하고, slash가 없으면 device_path 자체를 device_id로 사용합니다. |
device_path의 slash 유무에 따른 device_id 변환입니다.
Client class and usage output
sysfs-class-rnbd-client:1-17RNBD client의 writable sysfs file은 읽을 때 지원하는 mapping command usage와 address grammar를 반환합니다.