]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - fs/aufs/cpup.h
2 * Copyright (C) 2005-2016 Junjiro R. Okajima
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.
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.
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/>.
19 * copy-up/down functions
22 #ifndef __AUFS_CPUP_H__
23 #define __AUFS_CPUP_H__
27 #include <linux/path.h>
33 void au_cpup_attr_flags(struct inode
*dst
, unsigned int iflags
);
34 void au_cpup_attr_timesizes(struct inode
*inode
);
35 void au_cpup_attr_nlink(struct inode
*inode
, int force
);
36 void au_cpup_attr_changeable(struct inode
*inode
);
37 void au_cpup_igen(struct inode
*inode
, struct inode
*h_inode
);
38 void au_cpup_attr_all(struct inode
*inode
, int force
);
40 /* ---------------------------------------------------------------------- */
42 struct au_cp_generic
{
43 struct dentry
*dentry
;
44 aufs_bindex_t bdst
, bsrc
;
51 #define AuCpup_DTIME 1 /* do dtime_store/revert */
52 #define AuCpup_KEEPLINO (1 << 1) /* do not clear the lower xino,
54 #define AuCpup_RENAME (1 << 2) /* rename after cpup */
55 #define AuCpup_HOPEN (1 << 3) /* call h_open_pre/post() in
57 #define AuCpup_OVERWRITE (1 << 4) /* allow overwriting the
59 #define AuCpup_RWDST (1 << 5) /* force write target even if
60 the branch is marked as RO */
62 #define au_ftest_cpup(flags, name) ((flags) & AuCpup_##name)
63 #define au_fset_cpup(flags, name) \
64 do { (flags) |= AuCpup_##name; } while (0)
65 #define au_fclr_cpup(flags, name) \
66 do { (flags) &= ~AuCpup_##name; } while (0)
68 int au_copy_file(struct file
*dst
, struct file
*src
, loff_t len
);
69 int au_sio_cpup_simple(struct au_cp_generic
*cpg
);
70 int au_sio_cpdown_simple(struct au_cp_generic
*cpg
);
71 int au_sio_cpup_wh(struct au_cp_generic
*cpg
, struct file
*file
);
73 int au_cp_dirs(struct dentry
*dentry
, aufs_bindex_t bdst
,
74 int (*cp
)(struct dentry
*dentry
, aufs_bindex_t bdst
,
76 struct dentry
*h_parent
, void *arg
),
78 int au_cpup_dirs(struct dentry
*dentry
, aufs_bindex_t bdst
);
79 int au_test_and_cpup_dirs(struct dentry
*dentry
, aufs_bindex_t bdst
);
81 /* ---------------------------------------------------------------------- */
83 /* keep timestamps when copyup */
85 struct dentry
*dt_dentry
;
86 struct path dt_h_path
;
87 struct timespec dt_atime
, dt_mtime
;
89 void au_dtime_store(struct au_dtime
*dt
, struct dentry
*dentry
,
91 void au_dtime_revert(struct au_dtime
*dt
);
93 #endif /* __KERNEL__ */
94 #endif /* __AUFS_CPUP_H__ */