diff -urN 2.4.15pre8/fs/dcache.c vfs/fs/dcache.c --- 2.4.15pre8/fs/dcache.c Sun Sep 23 21:11:39 2001 +++ vfs/fs/dcache.c Thu Nov 22 05:41:17 2001 @@ -62,6 +62,10 @@ dentry->d_op->d_release(dentry); if (dname_external(dentry)) kfree(dentry->d_name.name); + if (dentry->d_extra_attributes) { + kfree(dentry->d_extra_attributes); + dentry->d_extra_attributes = NULL; + } kmem_cache_free(dentry_cache, dentry); dentry_stat.nr_dentry--; } @@ -616,6 +620,7 @@ dentry->d_name.hash = name->hash; dentry->d_op = NULL; dentry->d_fsdata = NULL; + dentry->d_extra_attributes = NULL; dentry->d_mounted = 0; INIT_LIST_HEAD(&dentry->d_hash); INIT_LIST_HEAD(&dentry->d_lru); @@ -911,6 +916,16 @@ /* Unhash the target: dput() will then get rid of it */ list_del_init(&target->d_hash); + /* flush any possible attribute */ + if (dentry->d_extra_attributes) { + kfree(dentry->d_extra_attributes); + dentry->d_extra_attributes = NULL; + } + if (target->d_extra_attributes) { + kfree(target->d_extra_attributes); + target->d_extra_attributes = NULL; + } + list_del(&dentry->d_child); list_del(&target->d_child); @@ -1162,6 +1177,26 @@ } out: return ino; +} + +void flush_dentry_attributes (void) +{ + struct list_head *chain, *tmp; + struct dentry *dentry; + int i; + + spin_lock(&dcache_lock); + for (i = 0; i <= d_hash_mask; i++) { + chain = dentry_hashtable + i; + tmp = chain->next; + while (tmp != chain) { + dentry = list_entry(tmp, struct dentry, d_hash); + kfree(dentry->d_extra_attributes); + dentry->d_extra_attributes = NULL; + tmp = tmp->next; + } + } + spin_unlock(&dcache_lock); } static void __init dcache_init(unsigned long mempages) diff -urN 2.4.15pre8/include/linux/dcache.h vfs/include/linux/dcache.h --- 2.4.15pre8/include/linux/dcache.h Mon Nov 19 18:18:59 2001 +++ vfs/include/linux/dcache.h Thu Nov 22 05:38:08 2001 @@ -80,6 +80,7 @@ struct super_block * d_sb; /* The root of the dentry tree */ unsigned long d_vfs_flags; void * d_fsdata; /* fs-specific data */ + void * d_extra_attributes; /* TUX-specific data */ unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ }; @@ -167,6 +168,7 @@ extern void shrink_dcache_sb(struct super_block *); extern void shrink_dcache_parent(struct dentry *); extern int d_invalidate(struct dentry *); +extern void flush_dentry_attributes(void); #define shrink_dcache() prune_dcache(0) struct zone_struct; diff -urN 2.4.15pre8/kernel/ksyms.c vfs/kernel/ksyms.c --- 2.4.15pre8/kernel/ksyms.c Tue Nov 6 02:04:54 2001 +++ vfs/kernel/ksyms.c Thu Nov 22 05:38:08 2001 @@ -232,6 +232,7 @@ EXPORT_SYMBOL(prune_dcache); EXPORT_SYMBOL(shrink_dcache_sb); EXPORT_SYMBOL(shrink_dcache_parent); +EXPORT_SYMBOL(flush_dentry_attributes); EXPORT_SYMBOL(find_inode_number); EXPORT_SYMBOL(is_subdir); EXPORT_SYMBOL(get_unused_fd);