]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - fs/aufs/dirren.h
2 * Copyright (C) 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/>.
22 #ifndef __AUFS_DIRREN_H__
23 #define __AUFS_DIRREN_H__
27 #include <linux/dcache.h>
28 #include <linux/statfs.h>
29 #include <linux/uuid.h>
32 #define AuDirren_NHASH 100
34 #ifdef CONFIG_AUFS_DIRREN
43 enum au_brid_type type
;
45 uuid_t uuid
; /* unimplemented yet */
51 /* 20 is the max digits length of ulong 64 */
52 /* brid-type "_" uuid "_" inum */
53 #define AUFS_DIRREN_FNAME_SZ (1 + 1 + UUID_STRING_LEN + 20)
54 #define AUFS_DIRREN_ENV_VAL_SZ (AUFS_DIRREN_FNAME_SZ + 1 + 20)
57 struct hlist_bl_node dr_hnode
;
62 struct hlist_bl_head dr_h_ino
[AuDirren_NHASH
];
63 struct au_dr_brid dr_brid
;
67 /* dr_name is pointed by struct au_do_lookup_args.name */
68 struct qstr dr_name
; /* subset of dr_info */
70 struct au_drinfo
**drinfo
;
76 struct au_dr_lookup
{ };
79 /* ---------------------------------------------------------------------- */
82 struct au_do_lookup_args
;
84 #ifdef CONFIG_AUFS_DIRREN
85 int au_dr_hino_test_add(struct au_dr_br
*dr
, ino_t h_ino
,
86 struct au_dr_hino
*add_ent
);
87 void au_dr_hino_free(struct au_dr_br
*dr
);
88 int au_dr_br_init(struct super_block
*sb
, struct au_branch
*br
,
89 const struct path
*path
);
90 int au_dr_br_fin(struct super_block
*sb
, struct au_branch
*br
);
91 int au_dr_rename(struct dentry
*src
, aufs_bindex_t bindex
,
92 struct qstr
*dst_name
, void *_rev
);
93 void au_dr_rename_fin(struct dentry
*src
, aufs_bindex_t btgt
, void *rev
);
94 void au_dr_rename_rev(struct dentry
*src
, aufs_bindex_t bindex
, void *rev
);
95 int au_dr_lkup(struct au_do_lookup_args
*lkup
, struct dentry
*dentry
,
96 aufs_bindex_t bindex
);
97 int au_dr_lkup_name(struct au_do_lookup_args
*lkup
, aufs_bindex_t btgt
);
98 int au_dr_lkup_h_ino(struct au_do_lookup_args
*lkup
, aufs_bindex_t bindex
,
100 void au_dr_lkup_fin(struct au_do_lookup_args
*lkup
);
101 int au_dr_opt_set(struct super_block
*sb
);
102 int au_dr_opt_flush(struct super_block
*sb
);
103 int au_dr_opt_clr(struct super_block
*sb
, int no_flush
);
105 AuStubInt0(au_dr_hino_test_add
, struct au_dr_br
*dr
, ino_t h_ino
,
106 struct au_dr_hino
*add_ent
);
107 AuStubVoid(au_dr_hino_free
, struct au_dr_br
*dr
);
108 AuStubInt0(au_dr_br_init
, struct super_block
*sb
, struct au_branch
*br
,
109 const struct path
*path
);
110 AuStubInt0(au_dr_br_fin
, struct super_block
*sb
, struct au_branch
*br
);
111 AuStubInt0(au_dr_rename
, struct dentry
*src
, aufs_bindex_t bindex
,
112 struct qstr
*dst_name
, void *_rev
);
113 AuStubVoid(au_dr_rename_fin
, struct dentry
*src
, aufs_bindex_t btgt
, void *rev
);
114 AuStubVoid(au_dr_rename_rev
, struct dentry
*src
, aufs_bindex_t bindex
,
116 AuStubInt0(au_dr_lkup
, struct au_do_lookup_args
*lkup
, struct dentry
*dentry
,
117 aufs_bindex_t bindex
);
118 AuStubInt0(au_dr_lkup_name
, struct au_do_lookup_args
*lkup
, aufs_bindex_t btgt
);
119 AuStubInt0(au_dr_lkup_h_ino
, struct au_do_lookup_args
*lkup
,
120 aufs_bindex_t bindex
, ino_t h_ino
);
121 AuStubVoid(au_dr_lkup_fin
, struct au_do_lookup_args
*lkup
);
122 AuStubInt0(au_dr_opt_set
, struct super_block
*sb
);
123 AuStubInt0(au_dr_opt_flush
, struct super_block
*sb
);
124 AuStubInt0(au_dr_opt_clr
, struct super_block
*sb
, int no_flush
);
127 /* ---------------------------------------------------------------------- */
129 #ifdef CONFIG_AUFS_DIRREN
130 static inline int au_dr_ihash(ino_t h_ino
)
132 return h_ino
% AuDirren_NHASH
;
135 AuStubInt0(au_dr_ihash
, ino_t h_ino
);
138 #endif /* __KERNEL__ */
139 #endif /* __AUFS_DIRREN_H__ */