[JF:20113] [Release] linux-3.4.1 exofs.txt

Seiji Kaneko skaneko @ a2.mbn.or.jp
2012年 9月 5日 (水) 23:53:08 JST


かねこです。本件はリリースします。
---------- >8 ---------- >8
TITL: exofs
CONT: exofs ファイルシステムの解説
NAME: filesystems/exofs.txt
JDAT: 2012/09/03
BVER: 3.4.1
AUTH: unknown
TRNS: Seiji Kaneko < skaneko at a2 dot mbn dot or dot jp >
---------- >8 ---------- >8
=========================================================
これは、
Linux-3.4.1/Documentation/filesystems/exofs.txt の和訳です。
翻訳団体: JF プロジェクト < http://linuxjf.sourceforge.jp/ >
更新日 : 2012/09/03
翻訳者 : Seiji Kaneko < skaneko at a2 dot mbn dot or dot jp >
査読者 : Masanori Kobayasi < zap03216 at nifty dot ne dot jp >
=========================================================
===============================================================================
#WHAT IS EXOFS?
EXOFS とは何か
===============================================================================

#exofs is a file system that uses an OSD and exports the API of a normal Linux
#file system. Users access exofs like any other local file system, and exofs
#will in turn issue commands to the local OSD initiator.
exofs とは OSD を用い、通常の Linux ファイルシステムの API を公開したフ
ァイルシステムです。exofs に対するユーザアクセスは他のローカルファイルシ
ステムへのアクセスと同じように行い、exofs はそのアクセスをローカルの OSD
イニシエータへのコマンドとして実行します。

#OSD is a new T10 command set that views storage devices not as a large/flat
#array of sectors but as a container of objects, each having a length, quota,
#time attributes and more. Each object is addressed by a 64bit ID, and is
#contained in a 64bit ID partition. Each object has associated attributes
#attached to it, which are integral part of the object and provide metadata about
#the object. The standard defines some common obligatory attributes, but user
#attributes can be added as needed.
OSD とは、新しい T10 コマンドセットで、ストレージデバイスを巨大でフラッ
トなセクタの配列としてではなく、サイズやクオータや時間関係の属性などを持
ったオブジェクトの格納先として扱うものです。各オブジェクトは 64 ビットの
識別子でアドレスされ、64 bit 識別子をもつパーティションに含まれます。
各オブジェクトには関連付けられた付属属性が付加され、この属性はオブジェク
トに統合されたオブジェクトの一部として、そのメタデータを格納します。
標準には幾つかの共通の必須属性が定義されていますが、必要に応じてユーザ定
義属性を加えることも可能です。

===============================================================================
#ENVIRONMENT
動作環境
===============================================================================

#To use this file system, you need to have an object store to run it on.  You
#may download a target from:
このファイルシステムを使うには、このファイルシステムで用いるためのオブジ
ェクトストアが必要です。ターゲットを以下からダウンロードして使うことも可
能です。

http://open-osd.org

#See Documentation/scsi/osd.txt for how to setup a working osd environment.
osd 環境を設定して動かすための手順については、Documentation/scsi/osd.txt
を参照ください。

===============================================================================
#USAGE
利用方法
===============================================================================

#1. Download and compile exofs and open-osd initiator:
#  You need an external Kernel source tree or kernel headers from your
#  distribution. (anything based on 2.6.26 or later).
1. exofs と open-osd イニシエータをダウンロードしてコンパイルする:
  使っているディストリビューションで配布されているカーネルソースツリー
  またはカーネルヘッダ (2.6.26 またはそれ以降ならどのバージョンでも可)
  が別途必要です。

#  a. download open-osd including exofs source using:
  a. exofs ソースを含む open-osd を以下のようにしてダウンロードする。
     [parent-directory]$ git clone git://git.open-osd.org/open-osd.git

#  b. Build the library module like this:
  b. ライブラリモジュールを以下のコマンドで作成する。
     [parent-directory]$ make -C KSRC=$(KER_DIR) open-osd

#     This will build both the open-osd initiator as well as the exofs kernel
#     module. Use whatever parameters you compiled your Kernel with and
#     $(KER_DIR) above pointing to the Kernel you compile against. See the file
#     open-osd/top-level-Makefile for an example.
     これにより、open-osd イニシエータと exofs カーネルモジュールの両
     方がビルドされます。カーネルコンパイル時に与えているパラメータに
     加え、コンパイル対象とするカーネルを指す $(KER_DIR) を設定してく
     ださい。例は open-osd/top-level-Makefile を参照ください。

#2. Get the OSD initiator and target set up properly, and login to the target.
#  See Documentation/scsi/osd.txt for farther instructions. Also see ./do-osd
#  for example script that does all these steps.
2. OSD イニシエータとターゲットを適切に設定し、ターゲットにログインし
ます。設定手順の詳細は Documentation/scsi/osd.txt を参照ください。ま
た、この手順の全てを実行するスクリプトの例である ./do-osd をご覧ください。

#3. Insmod the exofs.ko module:
#   [exofs]$ insmod exofs.ko
3. exofs.ko モジュールを insmod する。
   [exofs]$ insmod exofs.ko

#4. Make sure the directory where you want to mount exists. If not, create it.
#   (For example, mkdir /mnt/exofs)
4. マウント先のディレクトリが存在することを確認します。ない場合は作成
します (例えば、mkdir /mnt/exofs)。

#5. At first run you will need to invoke the mkfs.exofs application
5. 初回の実行では、mkfs.exofs アプリケーションの実行が必要になるでし
ょう。
#   As an example, this will create the file system on:
   例えば、次のコマンドはファイルシステムを /dev/osd0 の パーティショ
   ン ID 65536 上に作成します。

   mkfs.exofs --pid=65536 --format /dev/osd0

#   The --format is optional. If not specified no OSD_FORMAT will be
#   performed and a clean file system will be created in the specified pid,
#   in the available space of the target. (Use --format=size_in_meg to limit
#   the total LUN space available)
   --format はオプションで、指定しない場合には OSD_FORMAT が実行され
   ず、指定された pid でクリーンなファイルシステムが、ターゲットの提供
   する領域 (全体) を使って作成されます (使用する LUN 領域全体のサイズ
   を制限したい場合には、--format=size_in_meg を使ってください)。

#   If pid already exists, it will be deleted and a new one will be created in
#   its place. Be careful.
   pid が既に存在する場合には削除され、新しい pid が作成されて上書き
   されます。注意してください。

#   An exofs lives inside a single OSD partition. You can create multiple exofs
#   filesystems on the same device using multiple pids.
   exofs は単一の OSD パーティション内に置かれます。複数の pid を用
   いれば、同じデバイスに複数の exofs ファイルシステムを作成可能です。

#   (run mkfs.exofs without any parameters for usage help message)
   (mkfs.exofs をパラメータなしで実行した場合、利用方法のヘルプメッ
   セージが表示されます)。

#6. Mount the file system.
6. ファイルシステムをマウントします。

#   For example, to mount /dev/osd0, partition ID 0x10000 on /mnt/exofs:
   例えば、/dev/osd0 のパーティション ID 0x10000 を /mnt/exofs にマ
   ウントするには、以下のようにします。

	mount -t exofs -o pid=65536 /dev/osd0 /mnt/exofs/

#7. For reference (See do-exofs example script):
#	do-exofs start - an example of how to perform the above steps.
#	do-exofs stop -  an example of how to unmount the file system.
#	do-exofs format - an example of how to format and mkfs a new exofs.
7. 参考例 (do-exofs スクリプト例を参照ください)
       do-exofs start - 上記の手順を実行する方法の例
       do-exofs stop  - ファイルシステムのアンマウントを実行する方
       			法の例
       do-exofs format - 新しい exofs のフォーマットと mkfs を実行
       			する方法の例

#8. Extra compilation flags (uncomment in fs/exofs/Kbuild):
#	CONFIG_EXOFS_DEBUG - for debug messages and extra checks.
8. 追加のコンパイレーションフラグ (fs/exofs/Kbuild 内でアンコメント)
	CONFIG_EXOFS_DEBUG - デバッグメッセージと特別のチェックの追加

===============================================================================
#exofs mount options
exofs マウントオプション
===============================================================================
#Similar to any mount command:
他のマウントコマンドと同様です:
	mount -t exofs -o exofs_options /dev/osdX mount_exofs_directory

#Where:
ここでのオプションの説明:
#    -t exofs: specifies the exofs file system
    -t exofs: exofs ファイルシステムを指定します。

#    /dev/osdX: X is a decimal number. /dev/osdX was created after a successful
#               login into an OSD target.
    /dev/osdX: X は十進数です。/dev/osdX は OSD ターゲットにログイン
    が成功した後に作成されます。

#    mount_exofs_directory: The directory to mount the file system on
    mount_exofs_directory: ファイルシステムをマウントするディレクトリ

#    exofs specific options: Options are separated by commas (,)
    exofs 固有のオプション: オプションはカンマ (,) で区切られます。
#		pid=<integer> - The partition number to mount/create as
#                                container of the filesystem.
#                                This option is mandatory. integer can be
#                                Hex by pre-pending an 0x to the number.
#		osdname=<id>  - Mount by a device's osdname.
#                                osdname is usually a 36 character uuid of the
#                                form "d2683732-c906-4ee1-9dbd-c10c27bb40df".
#                                It is one of the device's uuid specified in the
#                                mkfs.exofs format command.
#                                If this option is specified then the /dev/osdX
#                                above can be empty and is ignored.
#                to=<integer>  - Timeout in ticks for a single command.
#                                default is (60 * HZ) [for debugging only]
		pid=<整数>    - ファイルシステムのコンテナをマウント/
				作成するパーティション番号。
				このオプションは必須です。整数値として、先頭
				に 0x をつけることにより 16進数を指定するこ
				とが可能です。
		osdname=<id>  - デバイスの osdname.を使いマウントする。
				osdname は、通常
				"d2683732-c906-4ee1-9dbd-c10c27bb40df".
				のような形式の 36 文字の文字列です。
				これは mkfs.exofs フォーマットコマンドで指定
				したデバイスの uuid のうちの一つです。
				このオプションを /dev/osdX に指定した場合、
				uuid は空でよく、指定しても無視されます。
		to=<整数>     -	一つのコマンドがタイムアウトするまで
				のティック数。
				既定値は (60 * HZ) です [デバック専用]

===============================================================================
#DESIGN
設計
===============================================================================

#* The file system control block (AKA on-disk superblock) resides in an object
#  with a special ID (defined in common.h).
#  Information included in the file system control block is used to fill the
#  in-memory superblock structure at mount time. This object is created before
#  the file system is used by mkexofs.c. It contains information such as:
#	- The file system's magic number
#	- The next inode number to be allocated
* ファイルシステム制御ブロック (ディスク上のスーパーブロック) は、特別な
   ID (common.h に定義があります) を持つオブジェクトに格納されています。
   ファイルシステム制御ブロックに格納されている情報は、マウント時にメモリ
   上のスーパーブロック構造体に書き込む際に用いられます。このオブジ
   ェクトは、ファイルシステムが mkexofs.c で用いられる前に作成されます。
   このオブジェクトには以下の情報が含まれています。
   	- ファイルシステムのマジック番号
	- 次に割り当てる inode 番号

#* Each file resides in its own object and contains the data (and it will be
#  possible to extend the file over multiple objects, though this has not been
#  implemented yet).
* 各ファイルは対応するオブジェクトに格納され、データを含みます (そして
  将来は複数のオブジェクトに分割してファイルを格納できるようになる予定
  ですが、現在は未実装です)。

#* A directory is treated as a file, and essentially contains a list of <file
#  name, inode #> pairs for files that are found in that directory. The object
#  IDs correspond to the files' inode numbers and will be allocated according to
#  a bitmap (stored in a separate object). Now they are allocated using a
#  counter.
* ディレクトリはファイルとして扱われ、本質的にはディレクトリ内にあるフ
  ァイルの <ファイル名, inode 番号> 組のリストを格納しています。オブジ
  ェクト ID はファイルの inode 番号に対応し、将来は別のオブジェクトに
  格納されたビットマップに従って割り当てられるようになります。但し現在
  はカウンタを使って割り当てられています。

#* Each file's control block (AKA on-disk inode) is stored in its object's
#  attributes. This applies to both regular files and other types (directories,
#  device files, symlinks, etc.).
* 各ファイルの制御ブロック (ディスク上の inode) はオブジェクトアトリビ
  ュートに格納されます。これは通常ファイルとその他のタイプ (ディレクト
  リ、デバイスファイル、シンボリックリンクなど) の両方に適用されます。

#* Credentials are generated per object (inode and superblock) when they are
#  created in memory (read from disk or created). The credential works for all
#  operations and is used as long as the object remains in memory.
* クレデンシャルはオブジェクト (inode とスーパーブロック) 毎に、メモ
  リ内での生成時 (ディスクからの読み込みまたは作成時) に作成されます。
  クレデンシャルは全ての操作で働き、オブジェクトがメモリ内にある間
  はずっと使われます。

#* Async OSD operations are used whenever possible, but the target may execute
#  them out of order. The operations that concern us are create, delete,
#  readpage, writepage, update_inode, and truncate. The following pairs of
#  operations should execute in the order written, and we need to prevent them
#  from executing in reverse order:
* 可能な限り非同期 OSD 操作が使われますが、ターゲットではこれを順序を
  守らず実行するかもしれません。ここで対象となる操作とは、create、
  delete、readpage、writepage、update_inode、truncate です。以下の操作
  の組は書かれた順序に実行するべきですので、順序が逆転することを防止す
  る必要があります。
#	- The following are handled with the OBJ_CREATED and OBJ_2BCREATED
#	  flags. OBJ_CREATED is set when we know the object exists on the OSD -
#	  in create's callback function, and when we successfully do a read_inode.
#	  OBJ_2BCREATED is set in the beginning of the create function, so we
#	  know that we should wait.
	- 以下の処理は OBJ_CREATED と OBJ_2BCREATED フラグで制御され
	  ます。
	  対象となるオブジェクトが OSD に存在する場合には、create の
	  コールバック関数で OBJ_CREATED をセットします。また
	  read_inode の実行が成功した場合には OBJ_2BCREATED を create
          関数の最初でセットするため、待つ必要があることが分かります。
#		- create/delete: delete should wait until the object is created
#		  on the OSD.
		- create/delete: delete はオブジェクトが OSD で作成
		  されるまで待つべきです。
#		- create/readpage: readpage should be able to return a page
#		  full of zeroes in this case. If there was a write already
#		  en-route (i.e. create, writepage, readpage) then the page
#		  would be locked, and so it would really be the same as
#		  create/writepage.
		- create/readpage: readpage は、この場合 0 で埋められ
		  たページを返せるよう実装すべきです。既に書き込みが仕
		  掛かり中の場合 (つまり、create、writepage、readpage
		  の順で実行している場合)、ページはロックされるでしょ
		  うから、実際の処理は create/writepage と同じになりま
		  す。
#		- create/writepage: if writepage is called for a sync write, it
#		  should wait until the object is created on the OSD.
#		  Otherwise, it should just return.
		- create/writepage: writepage が同期書き込みとして実行
		  された場合は、オブジェクトが OSD で作成されるまで待つべきです。
		  それ以外の場合は、単に戻るべきです。
#		- create/truncate: truncate should wait until the object is
#		  created on the OSD.
		- create/truncate: truncate はオブジェクトが OSD で作
		  成されるまでは待つべきです。
#		- create/update_inode: update_inode should wait until the
#		  object is created on the OSD.
		- create/update_inode: update_inode はオブジェクトが
		  OSD で作成されるまでは待つべきです。
#	- Handled by VFS locks:
	- VFS ロックで扱われます
#		- readpage/delete: shouldn't happen because of page lock.
#		- writepage/delete: shouldn't happen because of page lock.
#		- readpage/writepage: shouldn't happen because of page lock.
		- readpage/delete: ページロックのため、起こらないはず
				   です。
		- writepage/delete: ページロックのため、起こらないはず
				   です。
		- readpage/writepage: ページロックのため、起こらないは
				   ずです。

===============================================================================
#LICENSE/COPYRIGHT
ライセンス/著作権
===============================================================================
#The exofs file system is based on ext2 v0.5b (distributed with the Linux kernel
#version 2.6.10).  All files include the original copyrights, and the license
#is GPL version 2 (only version 2, as is true for the Linux kernel).  The
#Linux kernel can be downloaded from www.kernel.org.
exofs ファイルシステムは ext2 v0.5b (Linux カーネルバージョン 2.6.10
で配布されていたもの) をベースにしています。全てのファイルは元々の著
作権表記を保っており、ライセンスは GPL バージョン 2 (Linux カーネルで
は、バージョン 2 のみです) です。Linux カーネルは www.kernel.org から
ダウンロード可能です。

---------- >8 ---------- >8
--
Seiji Kaneko


JF メーリングリストの案内