/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2017-2019 Junjiro R. Okajima */ /* * renamed dir info */ #ifndef __AUFS_DIRREN_H__ #define __AUFS_DIRREN_H__ #ifdef __KERNEL__ #include "hbl.h" #define AuDirren_NHASH 100 #ifdef CONFIG_AUFS_DIRREN struct au_dr_hino { struct hlist_bl_node dr_hnode; ino_t dr_h_ino; }; struct au_dr_br { struct hlist_bl_head dr_h_ino[AuDirren_NHASH]; }; #else struct au_dr_hino; /* empty */ struct au_dr_br { }; #endif /* ---------------------------------------------------------------------- */ struct au_branch; struct au_hinode; struct path; struct super_block; #ifdef CONFIG_AUFS_DIRREN int au_dr_hino_test_add(struct au_dr_br *dr, ino_t h_ino, struct au_dr_hino *add_ent); void au_dr_hino_free(struct au_dr_br *dr); int au_dr_br_init(struct super_block *sb, struct au_branch *br, const struct path *path); int au_dr_br_fin(struct super_block *sb, struct au_branch *br); #else AuStubInt0(au_dr_hino_test_add, struct au_dr_br *dr, ino_t h_ino, struct au_dr_hino *add_ent); AuStubVoid(au_dr_hino_free, struct au_dr_br *dr); AuStubInt0(au_dr_br_init, struct super_block *sb, struct au_branch *br, const struct path *path); AuStubInt0(au_dr_br_fin, struct super_block *sb, struct au_branch *br); #endif /* ---------------------------------------------------------------------- */ #ifdef CONFIG_AUFS_DIRREN static inline int au_dr_ihash(ino_t h_ino) { return h_ino % AuDirren_NHASH; } #else AuStubInt0(au_dr_ihash, ino_t h_ino); #endif #endif /* __KERNEL__ */ #endif /* __AUFS_DIRREN_H__ */