1ccd979bdSMark Fasheh /* -*- mode: c; c-basic-offset: 8; -*- 2ccd979bdSMark Fasheh * vim: noexpandtab sw=8 ts=8 sts=0: 3ccd979bdSMark Fasheh * 4ccd979bdSMark Fasheh * dcache.h 5ccd979bdSMark Fasheh * 6ccd979bdSMark Fasheh * Function prototypes 7ccd979bdSMark Fasheh * 8ccd979bdSMark Fasheh * Copyright (C) 2002, 2004 Oracle. All rights reserved. 9ccd979bdSMark Fasheh * 10ccd979bdSMark Fasheh * This program is free software; you can redistribute it and/or 11ccd979bdSMark Fasheh * modify it under the terms of the GNU General Public 12ccd979bdSMark Fasheh * License as published by the Free Software Foundation; either 13ccd979bdSMark Fasheh * version 2 of the License, or (at your option) any later version. 14ccd979bdSMark Fasheh * 15ccd979bdSMark Fasheh * This program is distributed in the hope that it will be useful, 16ccd979bdSMark Fasheh * but WITHOUT ANY WARRANTY; without even the implied warranty of 17ccd979bdSMark Fasheh * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18ccd979bdSMark Fasheh * General Public License for more details. 19ccd979bdSMark Fasheh * 20ccd979bdSMark Fasheh * You should have received a copy of the GNU General Public 21ccd979bdSMark Fasheh * License along with this program; if not, write to the 22ccd979bdSMark Fasheh * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23ccd979bdSMark Fasheh * Boston, MA 021110-1307, USA. 24ccd979bdSMark Fasheh */ 25ccd979bdSMark Fasheh 26ccd979bdSMark Fasheh #ifndef OCFS2_DCACHE_H 27ccd979bdSMark Fasheh #define OCFS2_DCACHE_H 28ccd979bdSMark Fasheh 29d8fba0ffSAl Viro extern const struct dentry_operations ocfs2_dentry_ops; 30ccd979bdSMark Fasheh 31d680efe9SMark Fasheh struct ocfs2_dentry_lock { 32ea455f8aSJan Kara /* Use count of dentry lock */ 33d680efe9SMark Fasheh unsigned int dl_count; 34ea455f8aSJan Kara union { 35ea455f8aSJan Kara /* Linked list of dentry locks to release */ 36ea455f8aSJan Kara struct ocfs2_dentry_lock *dl_next; 37d680efe9SMark Fasheh u64 dl_parent_blkno; 38ea455f8aSJan Kara }; 39d680efe9SMark Fasheh 40d680efe9SMark Fasheh /* 41d680efe9SMark Fasheh * The ocfs2_dentry_lock keeps an inode reference until 42d680efe9SMark Fasheh * dl_lockres has been destroyed. This is usually done in 43d680efe9SMark Fasheh * ->d_iput() anyway, so there should be minimal impact. 44d680efe9SMark Fasheh */ 45d680efe9SMark Fasheh struct inode *dl_inode; 46d680efe9SMark Fasheh struct ocfs2_lock_res dl_lockres; 47d680efe9SMark Fasheh }; 48d680efe9SMark Fasheh 4980c05846SMark Fasheh int ocfs2_dentry_attach_lock(struct dentry *dentry, struct inode *inode, 500027dd5bSMark Fasheh u64 parent_blkno); 51d680efe9SMark Fasheh 52f7b1aa69SJan Kara extern spinlock_t dentry_list_lock; 53f7b1aa69SJan Kara 5480c05846SMark Fasheh void ocfs2_dentry_lock_put(struct ocfs2_super *osb, 5580c05846SMark Fasheh struct ocfs2_dentry_lock *dl); 5680c05846SMark Fasheh 57ea455f8aSJan Kara void ocfs2_drop_dl_inodes(struct work_struct *work); 58f7b1aa69SJan Kara void ocfs2_drop_all_dl_inodes(struct ocfs2_super *osb); 59ea455f8aSJan Kara 6080c05846SMark Fasheh struct dentry *ocfs2_find_local_alias(struct inode *inode, u64 parent_blkno, 6180c05846SMark Fasheh int skip_unhashed); 6280c05846SMark Fasheh 6380c05846SMark Fasheh void ocfs2_dentry_move(struct dentry *dentry, struct dentry *target, 6480c05846SMark Fasheh struct inode *old_dir, struct inode *new_dir); 65d680efe9SMark Fasheh 66d680efe9SMark Fasheh extern spinlock_t dentry_attach_lock; 675e98d492SGoldwyn Rodrigues void ocfs2_dentry_attach_gen(struct dentry *dentry); 68d680efe9SMark Fasheh 69ccd979bdSMark Fasheh #endif /* OCFS2_DCACHE_H */ 70