]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add support for O_TMPFILE
authorChunwei Chen <david.chen@osnexus.com>
Tue, 26 Jan 2016 20:29:46 +0000 (12:29 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 4 Nov 2016 17:46:40 +0000 (10:46 -0700)
commitace1eae84cca8579596f46262d99df19f6d7e963
tree22e2bf44dfc906cf6cb75567d993a86f64bf1ef8
parent987014903f9d36783547188b6ad00f01d9a076bd
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>
18 files changed:
config/kernel-tmpfile.m4 [new file with mode: 0644]
config/kernel.m4
configure.ac
include/sys/zfs_dir.h
include/sys/zfs_vnops.h
module/zfs/zfs_vnops.c
module/zfs/zfs_znode.c
module/zfs/zpl_inode.c
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/Makefile.am
tests/zfs-tests/tests/functional/tmpfile/.gitignore [new file with mode: 0644]
tests/zfs-tests/tests/functional/tmpfile/Makefile.am [new file with mode: 0644]
tests/zfs-tests/tests/functional/tmpfile/cleanup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/tmpfile/setup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/tmpfile/tmpfile_001_pos.c [new file with mode: 0644]
tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c [new file with mode: 0644]
tests/zfs-tests/tests/functional/tmpfile/tmpfile_003_pos.c [new file with mode: 0644]
tests/zfs-tests/tests/functional/tmpfile/tmpfile_test.c [new file with mode: 0644]