]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - fs/aufs/dynop.h
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / fs / aufs / dynop.h
1 /*
2 * Copyright (C) 2010-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 * dynamically customizable operations (for regular files only)
20 */
21
22 #ifndef __AUFS_DYNOP_H__
23 #define __AUFS_DYNOP_H__
24
25 #ifdef __KERNEL__
26
27 #include <linux/fs.h>
28 #include <linux/kref.h>
29
30 enum {AuDy_AOP, AuDyLast};
31
32 struct au_dynop {
33 int dy_type;
34 union {
35 const void *dy_hop;
36 const struct address_space_operations *dy_haop;
37 };
38 };
39
40 struct au_dykey {
41 union {
42 struct hlist_node dk_hnode;
43 struct rcu_head dk_rcu;
44 };
45 struct au_dynop dk_op;
46
47 /*
48 * during I am in the branch local array, kref is gotten. when the
49 * branch is removed, kref is put.
50 */
51 struct kref dk_kref;
52 };
53
54 /* stop unioning since their sizes are very different from each other */
55 struct au_dyaop {
56 struct au_dykey da_key;
57 struct address_space_operations da_op; /* not const */
58 };
59
60 /* ---------------------------------------------------------------------- */
61
62 /* dynop.c */
63 struct au_branch;
64 void au_dy_put(struct au_dykey *key);
65 int au_dy_iaop(struct inode *inode, aufs_bindex_t bindex,
66 struct inode *h_inode);
67 int au_dy_irefresh(struct inode *inode);
68 void au_dy_arefresh(int do_dio);
69
70 void __init au_dy_init(void);
71 void au_dy_fin(void);
72
73 #endif /* __KERNEL__ */
74 #endif /* __AUFS_DYNOP_H__ */