From 493c987f7a352ca64fdb4dc03a21e24cbaf46f55 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 9 Jul 2000 02:54:55 +0000 Subject: Merge with Linux 2.4.0-pre3-test6. --- include/linux/dcache.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'include/linux/dcache.h') diff --git a/include/linux/dcache.h b/include/linux/dcache.h index bae5641fd..7c0acf4bb 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -198,8 +198,8 @@ extern void d_rehash(struct dentry *); static __inline__ void d_add(struct dentry * entry, struct inode * inode) { - d_rehash(entry); d_instantiate(entry, inode); + d_rehash(entry); } /* used for rename() and baskets */ @@ -227,6 +227,8 @@ extern char * __d_path(struct dentry *, struct vfsmount *, struct dentry *, static __inline__ struct dentry * dget(struct dentry *dentry) { + if (!atomic_read(&dentry->d_count)) + BUG(); if (dentry) atomic_inc(&dentry->d_count); return dentry; @@ -244,12 +246,7 @@ static __inline__ int d_unhashed(struct dentry *dentry) return list_empty(&dentry->d_hash); } -extern void __dput(struct dentry *); -static __inline__ void dput(struct dentry *dentry) -{ - if (dentry && atomic_dec_and_test(&dentry->d_count)) - __dput(dentry); -} +extern void dput(struct dentry *); static __inline__ int d_mountpoint(struct dentry *dentry) { -- cgit v1.2.3