git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drm/radeon: don't actually enable the IRQ regs until irq is enabled
[safe/jmp/linux-2.6]
/
fs
/
dcache.c
diff --git
a/fs/dcache.c
b/fs/dcache.c
index
6402400
..
a1d86c7
100644
(file)
--- a/
fs/dcache.c
+++ b/
fs/dcache.c
@@
-69,6
+69,7
@@
struct dentry_stat_t dentry_stat = {
static void __d_free(struct dentry *dentry)
{
static void __d_free(struct dentry *dentry)
{
+ WARN_ON(!list_empty(&dentry->d_alias));
if (dname_external(dentry))
kfree(dentry->d_name.name);
kmem_cache_free(dentry_cache, dentry);
if (dname_external(dentry))
kfree(dentry->d_name.name);
kmem_cache_free(dentry_cache, dentry);
@@
-981,6
+982,15
@@
struct dentry *d_alloc_name(struct dentry *parent, const char *name)
return d_alloc(parent, &q);
}
return d_alloc(parent, &q);
}
+/* the caller must hold dcache_lock */
+static void __d_instantiate(struct dentry *dentry, struct inode *inode)
+{
+ if (inode)
+ list_add(&dentry->d_alias, &inode->i_dentry);
+ dentry->d_inode = inode;
+ fsnotify_d_instantiate(dentry, inode);
+}
+
/**
* d_instantiate - fill in inode information for a dentry
* @entry: dentry to complete
/**
* d_instantiate - fill in inode information for a dentry
* @entry: dentry to complete
@@
-1000,10
+1010,7
@@
void d_instantiate(struct dentry *entry, struct inode * inode)
{
BUG_ON(!list_empty(&entry->d_alias));
spin_lock(&dcache_lock);
{
BUG_ON(!list_empty(&entry->d_alias));
spin_lock(&dcache_lock);
- if (inode)
- list_add(&entry->d_alias, &inode->i_dentry);
- entry->d_inode = inode;
- fsnotify_d_instantiate(entry, inode);
+ __d_instantiate(entry, inode);
spin_unlock(&dcache_lock);
security_d_instantiate(entry, inode);
}
spin_unlock(&dcache_lock);
security_d_instantiate(entry, inode);
}
@@
-1033,7
+1040,7
@@
static struct dentry *__d_instantiate_unique(struct dentry *entry,
unsigned int hash = entry->d_name.hash;
if (!inode) {
unsigned int hash = entry->d_name.hash;
if (!inode) {
-
entry->d_inode = NULL
;
+
__d_instantiate(entry, NULL)
;
return NULL;
}
return NULL;
}
@@
-1052,9
+1059,7
@@
static struct dentry *__d_instantiate_unique(struct dentry *entry,
return alias;
}
return alias;
}
- list_add(&entry->d_alias, &inode->i_dentry);
- entry->d_inode = inode;
- fsnotify_d_instantiate(entry, inode);
+ __d_instantiate(entry, inode);
return NULL;
}
return NULL;
}
@@
-1206,17
+1211,14
@@
struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
new = __d_find_alias(inode, 1);
if (new) {
BUG_ON(!(new->d_flags & DCACHE_DISCONNECTED));
new = __d_find_alias(inode, 1);
if (new) {
BUG_ON(!(new->d_flags & DCACHE_DISCONNECTED));
- fsnotify_d_instantiate(new, inode);
spin_unlock(&dcache_lock);
security_d_instantiate(new, inode);
d_rehash(dentry);
d_move(new, dentry);
iput(inode);
} else {
spin_unlock(&dcache_lock);
security_d_instantiate(new, inode);
d_rehash(dentry);
d_move(new, dentry);
iput(inode);
} else {
- /* d_instantiate takes dcache_lock, so we do it by hand */
- list_add(&dentry->d_alias, &inode->i_dentry);
- dentry->d_inode = inode;
- fsnotify_d_instantiate(dentry, inode);
+ /* already taking dcache_lock, so d_add() by hand */
+ __d_instantiate(dentry, inode);
spin_unlock(&dcache_lock);
security_d_instantiate(dentry, inode);
d_rehash(dentry);
spin_unlock(&dcache_lock);
security_d_instantiate(dentry, inode);
d_rehash(dentry);
@@
-1299,8
+1301,7
@@
struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
* d_instantiate() by hand because it takes dcache_lock which
* we already hold.
*/
* d_instantiate() by hand because it takes dcache_lock which
* we already hold.
*/
- list_add(&found->d_alias, &inode->i_dentry);
- found->d_inode = inode;
+ __d_instantiate(found, inode);
spin_unlock(&dcache_lock);
security_d_instantiate(found, inode);
return found;
spin_unlock(&dcache_lock);
security_d_instantiate(found, inode);
return found;
@@
-1462,8
+1463,6
@@
out:
* d_validate - verify dentry provided from insecure source
* @dentry: The dentry alleged to be valid child of @dparent
* @dparent: The parent dentry (known to be valid)
* d_validate - verify dentry provided from insecure source
* @dentry: The dentry alleged to be valid child of @dparent
* @dparent: The parent dentry (known to be valid)
- * @hash: Hash of the dentry
- * @len: Length of the name
*
* An insecure source has sent us a dentry, here we verify it and dget() it.
* This is used by ncpfs in its readdir implementation.
*
* An insecure source has sent us a dentry, here we verify it and dget() it.
* This is used by ncpfs in its readdir implementation.
@@
-1833,7
+1832,7
@@
struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
if (!inode) {
actual = dentry;
if (!inode) {
actual = dentry;
-
dentry->d_inode = NULL
;
+
__d_instantiate(dentry, NULL)
;
goto found_lock;
}
goto found_lock;
}