]>
git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - fs/aufs/dirren.h
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2017-2020 Junjiro R. Okajima
5 * This program, aufs is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef __AUFS_DIRREN_H__
24 #define __AUFS_DIRREN_H__
28 #include <linux/dcache.h>
29 #include <linux/statfs.h>
30 #include <linux/uuid.h>
33 #define AuDirren_NHASH 100
35 #ifdef CONFIG_AUFS_DIRREN
44 enum au_brid_type type
;
46 uuid_t uuid
; /* unimplemented yet */
52 /* 20 is the max digits length of ulong 64 */
53 /* brid-type "_" uuid "_" inum */
54 #define AUFS_DIRREN_FNAME_SZ (1 + 1 + UUID_STRING_LEN + 20)
55 #define AUFS_DIRREN_ENV_VAL_SZ (AUFS_DIRREN_FNAME_SZ + 1 + 20)
58 struct hlist_bl_node dr_hnode
;
63 struct hlist_bl_head dr_h_ino
[AuDirren_NHASH
];
64 struct au_dr_brid dr_brid
;
68 /* dr_name is pointed by struct au_do_lookup_args.name */
69 struct qstr dr_name
; /* subset of dr_info */
71 struct au_drinfo
**drinfo
;
77 struct au_dr_lookup
{ };
80 /* ---------------------------------------------------------------------- */
83 struct au_do_lookup_args
;
85 #ifdef CONFIG_AUFS_DIRREN
86 int au_dr_hino_test_add(struct au_dr_br
*dr
, ino_t h_ino
,
87 struct au_dr_hino
*add_ent
);
88 void au_dr_hino_free(struct au_dr_br
*dr
);
89 int au_dr_br_init(struct super_block
*sb
, struct au_branch
*br
,
90 const struct path
*path
);
91 int au_dr_br_fin(struct super_block
*sb
, struct au_branch
*br
);
92 int au_dr_rename(struct dentry
*src
, aufs_bindex_t bindex
,
93 struct qstr
*dst_name
, void *_rev
);
94 void au_dr_rename_fin(struct dentry
*src
, aufs_bindex_t btgt
, void *rev
);
95 void au_dr_rename_rev(struct dentry
*src
, aufs_bindex_t bindex
, void *rev
);
96 int au_dr_lkup(struct au_do_lookup_args
*lkup
, struct dentry
*dentry
,
97 aufs_bindex_t bindex
);
98 int au_dr_lkup_name(struct au_do_lookup_args
*lkup
, aufs_bindex_t btgt
);
99 int au_dr_lkup_h_ino(struct au_do_lookup_args
*lkup
, aufs_bindex_t bindex
,
101 void au_dr_lkup_fin(struct au_do_lookup_args
*lkup
);
102 int au_dr_opt_set(struct super_block
*sb
);
103 int au_dr_opt_flush(struct super_block
*sb
);
104 int au_dr_opt_clr(struct super_block
*sb
, int no_flush
);
106 AuStubInt0(au_dr_hino_test_add
, struct au_dr_br
*dr
, ino_t h_ino
,
107 struct au_dr_hino
*add_ent
);
108 AuStubVoid(au_dr_hino_free
, struct au_dr_br
*dr
);
109 AuStubInt0(au_dr_br_init
, struct super_block
*sb
, struct au_branch
*br
,
110 const struct path
*path
);
111 AuStubInt0(au_dr_br_fin
, struct super_block
*sb
, struct au_branch
*br
);
112 AuStubInt0(au_dr_rename
, struct dentry
*src
, aufs_bindex_t bindex
,
113 struct qstr
*dst_name
, void *_rev
);
114 AuStubVoid(au_dr_rename_fin
, struct dentry
*src
, aufs_bindex_t btgt
, void *rev
);
115 AuStubVoid(au_dr_rename_rev
, struct dentry
*src
, aufs_bindex_t bindex
,
117 AuStubInt0(au_dr_lkup
, struct au_do_lookup_args
*lkup
, struct dentry
*dentry
,
118 aufs_bindex_t bindex
);
119 AuStubInt0(au_dr_lkup_name
, struct au_do_lookup_args
*lkup
, aufs_bindex_t btgt
);
120 AuStubInt0(au_dr_lkup_h_ino
, struct au_do_lookup_args
*lkup
,
121 aufs_bindex_t bindex
, ino_t h_ino
);
122 AuStubVoid(au_dr_lkup_fin
, struct au_do_lookup_args
*lkup
);
123 AuStubInt0(au_dr_opt_set
, struct super_block
*sb
);
124 AuStubInt0(au_dr_opt_flush
, struct super_block
*sb
);
125 AuStubInt0(au_dr_opt_clr
, struct super_block
*sb
, int no_flush
);
128 /* ---------------------------------------------------------------------- */
130 #ifdef CONFIG_AUFS_DIRREN
131 static inline int au_dr_ihash(ino_t h_ino
)
133 return h_ino
% AuDirren_NHASH
;
136 AuStubInt0(au_dr_ihash
, ino_t h_ino
);
139 #endif /* __KERNEL__ */
140 #endif /* __AUFS_DIRREN_H__ */