HomeFreeBSD

Add support for O_TMPFILE

Description

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>

Details

Provenance
Chunwei Chen <david.chen@osnexus.com>Authored on Jan 26 2016, 8:29 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Nov 4 2016, 5:46 PM
Parents
rG987014903f9d: Fix unlinked file cannot do xattr operations
Branches
Unknown
Tags
Unknown