OSDN Git Service

(split) LDP: Update draft and release for LDP 3.65
[linuxjm/LDP_man-pages.git] / draft / man2 / fallocate.2
index 2a80a5e..f23327d 100644 (file)
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH FALLOCATE 2 2013\-02\-12 Linux "Linux Programmer's Manual"
+.\"
+.\" Japanese Version Copyright (c) 2007  Akihiro MOTOKI
+.\"         all rights reserved.
+.\" Translated 2007-10-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.66
+.\" Updated 2008-10-13, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.11
+.\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-05-07, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-07-22, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.TH FALLOCATE 2 2014\-04\-17 Linux "Linux Programmer's Manual"
 .SH 名前
 fallocate \- ファイル空間の操作
 .SH 書式
@@ -33,13 +42,12 @@ POSIX.1 で規定された方法である \fBposix_fallocate\fP(3)  を使うこ
 \fImode\fP 引き数は、指定された領域に対して実行する操作を指定する。
 サポートされている操作の詳細は以下のサブセクションで説明する。
 .SS ディスク領域の割り当て
-\fBfallocate\fP() のデフォルトの動作 (つまり \fImode\fP が 0 の場合) は、
-\fIoffset\fP と \fIlen\fP で指定された範囲のディスク領域の割り当てと初期化を行う。
-\fIoffset\fP+\fIlen\fP がファイルサイズよりも大きかった場合、
-(\fBstat\fP(2) で報告される) ファイルサイズが変更される。このデフォルトの動作は、
-ライブラリ関数 \fBposix_fallocate\fP(3) の動作と非常に似ている。これは、
-このシステムコールが \fBposix_fallocate\fP(3) を最適に実装する手段を提供する
-ことを目的としているからである。
+\fBfallocate\fP() のデフォルトの動作 (つまり \fImode\fP が 0 の場合) は、 \fIoffset\fP と \fIlen\fP
+で指定された範囲のディスク領域の割り当てを行う。 \fIoffset\fP+\fIlen\fP がファイルサイズよりも大きかった場合、 (\fBstat\fP(2)
+で報告される) ファイルサイズが変更される。 \fIoffset\fP と \fIlen\fP で指定される範囲のサブ領域で、
+呼び出し前にデータを保持していなかった場合、そのサブ領域は 0 で初期化される。 このデフォルトの動作は、 ライブラリ関数
+\fBposix_fallocate\fP(3) の動作と非常に似ている。 これは、 このシステムコールが \fBposix_fallocate\fP(3)
+を最適に実装する手段を提供することを目的としているからである。
 
 呼び出しが成功した場合、
 \fIoffset\fP と \fIlen\fP で指定された範囲へのそれ以降の書き込みでは、
@@ -54,21 +62,56 @@ POSIX.1 で規定された方法である \fBposix_fallocate\fP(3)  を使うこ
 割り当てはブロックサイズ単位で行われるため、 \fBfallocate\fP() は指定されたより
 も大きなディスク領域を割り当てることがある。
 .SS ファイル空間の割り当て解除
-Specifying the \fBFALLOC_FL_PUNCH_HOLE\fP flag (available since Linux 2.6.38)
-in \fImode\fP deallocates space (i.e., creates a hole)  in the byte range
-starting at \fIoffset\fP and continuing for \fIlen\fP bytes.  Within the specified
-range, partial file system blocks are zeroed, and whole file system blocks
-are removed from the file.  After a successful call, subsequent reads from
-this range will return zeroes.
+\fBFALLOC_FL_PUNCH_HOLE\fP フラグ (Linux 2.6.38 以降で利用可能) を \fImode\fP に指定すると、
+\fIoffset\fP で始まる \fIlen\fP バイトの領域の空間を解放する (ホールを作成する)。 指定された範囲のうち、
+部分的に使用しているファイルシステムブロックは 0 で埋められ、 全体を使用しているファイルシステムブロックはそのファイルから削除される。
+呼び出しが成功すると、 これ以降のこの範囲からの読み出しでは 0 を返す。
+
+\fBFALLOC_FL_PUNCH_HOLE\fP フラグは \fBFALLOC_FL_KEEP_SIZE\fP と論理和 (OR) をとって \fImode\fP
+に指定しなければならない。 つまり、 ファイル末尾の punch off を行った場合でも、 (\fBstat\fP(2) で報告される)
+ファイルサイズが変化しない。
+
+すべてのファイルシステムで \fBFALLOC_FL_PUNCH_HOLE\fP がサポートされているわけではない。
+ファイルシステムがこの操作をサポートしていない場合は、 エラーが返る。 この操作は少なくとも以下のファイルシステムでサポートされている。
+.IP * 3
+XFS (Linux 2.6.38 以降)
+.IP *
+.\" commit a4bb6b64e39abc0e41ca077725f2a72c868e7622
+ext4 (Linux 3.0 以降)
+.IP *
+Btrfs (Linux 3.7 以降)
+.IP *
+.\" commit 83e4fa9c16e4af7122e31be3eca5d57881d236fe
+tmpfs (Linux 3.5 以降)
+.SS "Collapsing file space"
+.\" commit 00f5e61998dd17f5375d9dfc01331f104b83f841
+Specifying the \fBFALLOC_FL_COLLAPSE_RANGE\fP flag (available since Linux 3.15)
+in \fImode\fP removes a byte range from a file, without leaving a hole.  The
+byte range to be collapsed starts at \fIoffset\fP and continues for \fIlen\fP
+bytes.  At the completion of the operation, the contents of the file
+starting at the location \fIoffset+len\fP will be appended at the location
+\fIoffset\fP, and the file will be \fIlen\fP bytes smaller.
 
-The \fBFALLOC_FL_PUNCH_HOLE\fP flag must be ORed with \fBFALLOC_FL_KEEP_SIZE\fP in
-\fImode\fP; in other words, even when punching off the end of the file, the
-file size (as reported by \fBstat\fP(2))  does not change.
+A filesystem may place limitations on the granularity of the operation, in
+order to ensure efficient implementation.  Typically, \fIoffset\fP and \fIlen\fP
+must be a multiple of the filesystem logical block size, which varies
+according to the filesystem type and configuration.  If a filesystem has
+such a requirement, \fBfallocate\fP()  will fail with the error \fBEINVAL\fP if
+this requirement is violated.
 
-Not all file systems support \fBFALLOC_FL_PUNCH_HOLE\fP; if a file system
-doesn't support the operation, an error is returned.
+If the region specified by \fIoffset\fP plus \fIlen\fP reaches or passes the end
+of file, an error is returned; instead, use \fBftruncate\fP(2)  to truncate a
+file.
+
+No other flags may be specified in \fImode\fP in conjunction with
+\fBFALLOC_FL_COLLAPSE_RANGE\fP.
+
+.\" commit 9eb79482a97152930b113b51dff530aba9e28c8e
+.\" commit e1d8fb88a64c1f8094b9f6c3b6d2d9e6719c970d
+As at Linux 3.15, \fBFALLOC_FL_COLLAPSE_RANGE\fP is supported by ext4 (only for
+extent\-based files)  and XFS.
 .SH 返り値
-\fBfallocate\fP()  は成功すると 0 を返し、エラーの場合は \-1 を返す
+成功の場合、 \fBfallocate\fP() は 0 を返す。 エラーの場合、\-1 を返し、 \fIerror\fP にエラーを示す値を設定する
 .SH エラー
 .TP 
 \fBEBADF\fP
@@ -89,6 +132,29 @@ doesn't support the operation, an error is returned.
 .\" http://thread.gmane.org/gmane.linux.file-systems/48331/focus=1193526
 \fIoffset\fP が 0 未満だったか、 \fIlen\fP が 0 以下だった。
 .TP 
+\fBEINVAL\fP
+\fImode\fP is \fBFALLOC_FL_COLLAPSE_RANGE\fP and the range specified by \fIoffset\fP
+plus \fIlen\fP reaches or passes the end of the file.
+.TP 
+\fBEINVAL\fP
+\fImode\fP is \fBFALLOC_FL_COLLAPSE_RANGE\fP, but either \fIoffset\fP or \fIlen\fP is
+not a multiple of the filesystem block size.
+.TP 
+\fBEINVAL\fP
+mode contains both \fBFALLOC_FL_COLLAPSE_RANGE\fP and other flags; no other
+flags are permitted with \fBFALLOC_FL_COLLAPSE_RANGE\fP.
+.TP  EINVAL
+\fImode\fP
+.\" There was a inconsistency in 3.15-rc1, that should be resolved so that all
+.\" filesystems use this error for this case. (Tytso says ex4 will change.)
+.\" http://thread.gmane.org/gmane.comp.file-systems.xfs.general/60485/focus=5521
+.\" From: Michael Kerrisk (man-pages <mtk.manpages@...>
+.\" Subject: Re: [PATCH v5 10/10] manpage: update FALLOC_FL_COLLAPSE_RANGE flag in fallocate
+.\" Newsgroups: gmane.linux.man, gmane.linux.file-systems
+.\" Date: 2014-04-17 13:40:05 GMT
+is \fBFALLOC_FL_COLLAPSE_RANGE\fP, but the file referred to by \fIfd\fP is not a
+regular file.
+.TP 
 \fBEIO\fP
 ファイルシステムとの読み書き中に入出力エラーが発生した。
 .TP 
@@ -107,12 +173,16 @@ doesn't support the operation, an error is returned.
 \fImode\fP をサポートしていない。
 .TP 
 \fBEPERM\fP
-The file referred to by \fIfd\fP is marked immutable (see \fBchattr\fP(1)).  Or:
-\fImode\fP specifies \fBFALLOC_FL_PUNCH_HOLE\fP and the file referred to by \fIfd\fP
-is marked append\-only (see \fBchattr\fP(1)).
+\fIfd\fP が参照するファイルに変更不可 (immutable) の属性が付いている (\fBchattr\fP(1) 参照)。 \fImode\fP に
+\fBFALLOC_FL_PUNCH_HOLE\fP か \fBFALLOC_FL_COLLAPSE_RANGE\fP が指定されたが、 \fIfd\fP
+が参照するファイルに追加のみ (append\-only) の属性が付いている (\fBchattr\fP(1) 参照)。
 .TP 
 \fBESPIPE\fP
 \fIfd\fP がパイプか FIFO を参照している。
+.TP 
+\fBETXTBSY\fP
+\fImode\fP specifies \fBFALLOC_FL_COLLAPSE_RANGE\fP, but the file referred to by
+\fIfd\fP is currently being executed.
 .SH バージョン
 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=14964
 \fBfallocate\fP()  はカーネル 2.6.23 以降の Linux で利用可能である。 glibc での対応はバージョン 3.10
@@ -122,6 +192,6 @@ is marked append\-only (see \fBchattr\fP(1)).
 .SH 関連項目
 \fBfallocate\fP(1), \fBftruncate\fP(2), \fBposix_fadvise\fP(3), \fBposix_fallocate\fP(3)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.51 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。