]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - fs/aufs/whout.h
2 * Copyright (C) 2005-2017 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 * whiteout for logical deletion and opaque directory
22 #ifndef __AUFS_WHOUT_H__
23 #define __AUFS_WHOUT_H__
30 int au_wh_name_alloc(struct qstr
*wh
, const struct qstr
*name
);
31 int au_wh_test(struct dentry
*h_parent
, struct qstr
*wh_name
, int try_sio
);
32 int au_diropq_test(struct dentry
*h_dentry
);
34 struct dentry
*au_whtmp_lkup(struct dentry
*h_parent
, struct au_branch
*br
,
36 int au_whtmp_ren(struct dentry
*h_dentry
, struct au_branch
*br
);
37 int au_wh_unlink_dentry(struct inode
*h_dir
, struct path
*h_path
,
38 struct dentry
*dentry
);
39 int au_wh_init(struct au_branch
*br
, struct super_block
*sb
);
42 #define AuDiropq_CREATE 1
43 #define au_ftest_diropq(flags, name) ((flags) & AuDiropq_##name)
44 #define au_fset_diropq(flags, name) \
45 do { (flags) |= AuDiropq_##name; } while (0)
46 #define au_fclr_diropq(flags, name) \
47 do { (flags) &= ~AuDiropq_##name; } while (0)
49 struct dentry
*au_diropq_sio(struct dentry
*dentry
, aufs_bindex_t bindex
,
51 struct dentry
*au_wh_lkup(struct dentry
*h_parent
, struct qstr
*base_name
,
52 struct au_branch
*br
);
53 struct dentry
*au_wh_create(struct dentry
*dentry
, aufs_bindex_t bindex
,
54 struct dentry
*h_parent
);
56 /* real rmdir for the whiteout-ed dir */
57 struct au_whtmp_rmdir
{
60 struct dentry
*wh_dentry
;
61 struct au_nhash whlist
;
64 struct au_whtmp_rmdir
*au_whtmp_rmdir_alloc(struct super_block
*sb
, gfp_t gfp
);
65 void au_whtmp_rmdir_free(struct au_whtmp_rmdir
*whtmp
);
66 int au_whtmp_rmdir(struct inode
*dir
, aufs_bindex_t bindex
,
67 struct dentry
*wh_dentry
, struct au_nhash
*whlist
);
68 void au_whtmp_kick_rmdir(struct inode
*dir
, aufs_bindex_t bindex
,
69 struct dentry
*wh_dentry
, struct au_whtmp_rmdir
*args
);
71 /* ---------------------------------------------------------------------- */
73 static inline struct dentry
*au_diropq_create(struct dentry
*dentry
,
76 return au_diropq_sio(dentry
, bindex
, AuDiropq_CREATE
);
79 static inline int au_diropq_remove(struct dentry
*dentry
, aufs_bindex_t bindex
)
81 return PTR_ERR(au_diropq_sio(dentry
, bindex
, !AuDiropq_CREATE
));
84 #endif /* __KERNEL__ */
85 #endif /* __AUFS_WHOUT_H__ */