]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - fs/aufs/cpup.h
x86/mm: Use WRITE_ONCE() when setting PTEs
[mirror_ubuntu-bionic-kernel.git] / fs / aufs / cpup.h
CommitLineData
c088e31d
SF
1/*
2 * Copyright (C) 2005-2017 Junjiro R. Okajima
3 *
4 * This program, aufs is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * copy-up/down functions
20 */
21
22#ifndef __AUFS_CPUP_H__
23#define __AUFS_CPUP_H__
24
25#ifdef __KERNEL__
26
27#include <linux/path.h>
28
29struct inode;
30struct file;
31struct au_pin;
32
33void au_cpup_attr_flags(struct inode *dst, unsigned int iflags);
34void au_cpup_attr_timesizes(struct inode *inode);
35void au_cpup_attr_nlink(struct inode *inode, int force);
36void au_cpup_attr_changeable(struct inode *inode);
37void au_cpup_igen(struct inode *inode, struct inode *h_inode);
38void au_cpup_attr_all(struct inode *inode, int force);
39
40/* ---------------------------------------------------------------------- */
41
42struct au_cp_generic {
43 struct dentry *dentry;
44 aufs_bindex_t bdst, bsrc;
45 loff_t len;
46 struct au_pin *pin;
47 unsigned int flags;
48};
49
50/* cpup flags */
51#define AuCpup_DTIME 1 /* do dtime_store/revert */
52#define AuCpup_KEEPLINO (1 << 1) /* do not clear the lower xino,
53 for link(2) */
54#define AuCpup_RENAME (1 << 2) /* rename after cpup */
55#define AuCpup_HOPEN (1 << 3) /* call h_open_pre/post() in
56 cpup */
57#define AuCpup_OVERWRITE (1 << 4) /* allow overwriting the
58 existing entry */
59#define AuCpup_RWDST (1 << 5) /* force write target even if
60 the branch is marked as RO */
61
62#ifndef CONFIG_AUFS_BR_HFSPLUS
63#undef AuCpup_HOPEN
64#define AuCpup_HOPEN 0
65#endif
66
67#define au_ftest_cpup(flags, name) ((flags) & AuCpup_##name)
68#define au_fset_cpup(flags, name) \
69 do { (flags) |= AuCpup_##name; } while (0)
70#define au_fclr_cpup(flags, name) \
71 do { (flags) &= ~AuCpup_##name; } while (0)
72
73int au_copy_file(struct file *dst, struct file *src, loff_t len);
74int au_sio_cpup_simple(struct au_cp_generic *cpg);
75int au_sio_cpdown_simple(struct au_cp_generic *cpg);
76int au_sio_cpup_wh(struct au_cp_generic *cpg, struct file *file);
77
78int au_cp_dirs(struct dentry *dentry, aufs_bindex_t bdst,
79 int (*cp)(struct dentry *dentry, aufs_bindex_t bdst,
80 struct au_pin *pin,
81 struct dentry *h_parent, void *arg),
82 void *arg);
83int au_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst);
84int au_test_and_cpup_dirs(struct dentry *dentry, aufs_bindex_t bdst);
85
86/* ---------------------------------------------------------------------- */
87
88/* keep timestamps when copyup */
89struct au_dtime {
90 struct dentry *dt_dentry;
91 struct path dt_h_path;
92 struct timespec dt_atime, dt_mtime;
93};
94void au_dtime_store(struct au_dtime *dt, struct dentry *dentry,
95 struct path *h_path);
96void au_dtime_revert(struct au_dtime *dt);
97
98#endif /* __KERNEL__ */
99#endif /* __AUFS_CPUP_H__ */