=========================================================
ϡ
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
  deletereadpagewritepageupdate_inodetruncate Ǥʲ
  ȤϽ񤫤줿˼¹Ԥ٤ǤΤǡž뤳Ȥɻߤ
  ɬפޤ
#	- 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 
		  ڡ֤褦٤Ǥ˽񤭹ߤ
		  ݤξ (Ĥޤꡢcreatewritepagereadpage
		  νǼ¹ԤƤ)ڡϥåǤ
		  顢ºݤν 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 
ɲǽǤ

