Add support for O_TMPFILE

Linux 3.11 add O_TMPFILE to open(2), which allow creating an unlinked file on
supported filesystem. It's basically doing open(2) and unlink(2) atomically.

The filesystem support is added through i_op->tmpfile. We basically copy the
create operation except we get rid of the link and name related stuff and add
the new node to unlinked set.

We also add support for linkat(2) to link tmpfile. However, since all previous
file operation will skip ZIL, we force a txg_wait_synced to make sure we are
sync safe.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
This commit is contained in:
Chunwei Chen
2016-01-26 12:29:46 -08:00
committed by Brian Behlendorf
parent 987014903f
commit ace1eae84c
18 changed files with 644 additions and 8 deletions
+3
View File
@@ -586,6 +586,9 @@ tests = ['sparse_001_pos']
#[tests/functional/threadsappend]
#tests = ['threadsappend_001_pos']
[tests/functional/tmpfile]
tests = ['tmpfile_001_pos', 'tmpfile_002_pos', 'tmpfile_003_pos']
[tests/functional/truncate]
tests = ['truncate_001_pos', 'truncate_002_pos']