diff options
author | Chunwei Chen <[email protected]> | 2016-01-26 12:29:46 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-11-04 10:46:40 -0700 |
commit | ace1eae84cca8579596f46262d99df19f6d7e963 (patch) | |
tree | 22e2bf44dfc906cf6cb75567d993a86f64bf1ef8 /include/sys/zfs_dir.h | |
parent | 987014903f9d36783547188b6ad00f01d9a076bd (diff) |
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 <[email protected]>
Diffstat (limited to 'include/sys/zfs_dir.h')
-rw-r--r-- | include/sys/zfs_dir.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/zfs_dir.h b/include/sys/zfs_dir.h index 8610fbe08..efda1236a 100644 --- a/include/sys/zfs_dir.h +++ b/include/sys/zfs_dir.h @@ -47,6 +47,7 @@ extern "C" { /* mknode flags */ #define IS_ROOT_NODE 0x01 /* create a root node */ #define IS_XATTR 0x02 /* create an extended attribute node */ +#define IS_TMPFILE 0x04 /* create a tmpfile */ extern int zfs_dirent_lock(zfs_dirlock_t **, znode_t *, char *, znode_t **, int, int *, pathname_t *); |