xref: /OK3568_Linux_fs/kernel/fs/ocfs2/dcache.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /* -*- mode: c; c-basic-offset: 8; -*-
3*4882a593Smuzhiyun  * vim: noexpandtab sw=8 ts=8 sts=0:
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * dcache.h
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Function prototypes
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
10*4882a593Smuzhiyun  */
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #ifndef OCFS2_DCACHE_H
13*4882a593Smuzhiyun #define OCFS2_DCACHE_H
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun extern const struct dentry_operations ocfs2_dentry_ops;
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun struct ocfs2_dentry_lock {
18*4882a593Smuzhiyun 	unsigned int		dl_count;
19*4882a593Smuzhiyun 	u64			dl_parent_blkno;
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun 	/*
22*4882a593Smuzhiyun 	 * The ocfs2_dentry_lock keeps an inode reference until
23*4882a593Smuzhiyun 	 * dl_lockres has been destroyed. This is usually done in
24*4882a593Smuzhiyun 	 * ->d_iput() anyway, so there should be minimal impact.
25*4882a593Smuzhiyun 	 */
26*4882a593Smuzhiyun 	struct inode		*dl_inode;
27*4882a593Smuzhiyun 	struct ocfs2_lock_res	dl_lockres;
28*4882a593Smuzhiyun };
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun int ocfs2_dentry_attach_lock(struct dentry *dentry, struct inode *inode,
31*4882a593Smuzhiyun 			     u64 parent_blkno);
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun void ocfs2_dentry_lock_put(struct ocfs2_super *osb,
34*4882a593Smuzhiyun 			   struct ocfs2_dentry_lock *dl);
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun struct dentry *ocfs2_find_local_alias(struct inode *inode, u64 parent_blkno,
37*4882a593Smuzhiyun 				      int skip_unhashed);
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun void ocfs2_dentry_move(struct dentry *dentry, struct dentry *target,
40*4882a593Smuzhiyun 		       struct inode *old_dir, struct inode *new_dir);
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun extern spinlock_t dentry_attach_lock;
43*4882a593Smuzhiyun void ocfs2_dentry_attach_gen(struct dentry *dentry);
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun #endif /* OCFS2_DCACHE_H */
46