patch-2.4.18 linux/fs/intermezzo/dcache.c
Next file: linux/fs/intermezzo/dir.c
Previous file: linux/fs/hpfs/super.c
Back to the patch index
Back to the overall index
- Lines: 113
- Date:
Mon Jan 7 14:09:06 2002
- Orig file:
linux.orig/fs/intermezzo/dcache.c
- Orig date:
Mon Feb 18 20:18:40 2002
diff -Naur -X /home/marcelo/lib/dontdiff linux.orig/fs/intermezzo/dcache.c linux/fs/intermezzo/dcache.c
@@ -15,7 +15,6 @@
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/locks.h>
-#include <linux/slab.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/string.h>
@@ -23,7 +22,7 @@
#include <linux/intermezzo_fs.h>
static int presto_dentry_revalidate(struct dentry *de, int );
-static kmem_cache_t * presto_dentry_slab;
+
/* called when a cache lookup succeeds */
static int presto_dentry_revalidate(struct dentry *de, int flag)
@@ -49,91 +48,15 @@
}
}
-static void presto_d_release(struct dentry *dentry)
+static void presto_dentry_iput(struct dentry *dentry, struct inode *inode)
{
- if (!presto_d2d(dentry)) {
- /* This should really only happen in the case of a dentry
- * with no inode. */
- return;
- }
-
- presto_d2d(dentry)->dd_count--;
-
- if (! presto_d2d(dentry)->dd_count) {
- kmem_cache_free(presto_dentry_slab, presto_d2d(dentry));
- dentry->d_fsdata = NULL;
- }
+ dentry->d_time = 0;
+ iput(inode);
}
struct dentry_operations presto_dentry_ops =
{
d_revalidate: presto_dentry_revalidate,
- d_release: presto_d_release
+ d_iput: presto_dentry_iput
};
-
-// XXX THIS DEPENDS ON THE KERNEL LOCK!
-
-void presto_set_dd(struct dentry * dentry)
-{
- ENTRY;
- if (dentry == NULL)
- BUG();
-
- if (dentry->d_fsdata) {
- printk("VERY BAD: dentry: %p\n", dentry);
- if (dentry->d_inode)
- printk(" inode: %ld\n", dentry->d_inode->i_ino);
- EXIT;
- return;
- }
-
- if (dentry->d_inode == NULL) {
- dentry->d_fsdata = kmem_cache_alloc(presto_dentry_slab,
- SLAB_KERNEL);
- memset(dentry->d_fsdata, 0, sizeof(struct presto_dentry_data));
- presto_d2d(dentry)->dd_count = 1;
- EXIT;
- return;
- }
-
- /* If there's already a dentry for this inode, share the data */
- if (dentry->d_alias.next != &dentry->d_inode->i_dentry ||
- dentry->d_alias.prev != &dentry->d_inode->i_dentry) {
- struct dentry *de;
-
- if (dentry->d_alias.next != &dentry->d_inode->i_dentry)
- de = list_entry(dentry->d_alias.next, struct dentry,
- d_alias);
- else
- de = list_entry(dentry->d_alias.prev, struct dentry,
- d_alias);
-
- dentry->d_fsdata = de->d_fsdata;
- presto_d2d(dentry)->dd_count++;
- EXIT;
- return;
- }
-
- dentry->d_fsdata = kmem_cache_alloc(presto_dentry_slab, SLAB_KERNEL);
- memset(dentry->d_fsdata, 0, sizeof(struct presto_dentry_data));
- presto_d2d(dentry)->dd_count = 1;
- EXIT;
- return;
-}
-
-void presto_init_ddata_cache(void)
-{
- ENTRY;
- presto_dentry_slab =
- kmem_cache_create("presto_cache",
- sizeof(struct presto_dentry_data), 0,
- SLAB_HWCACHE_ALIGN, NULL,
- NULL);
- EXIT;
-}
-
-void presto_cleanup_ddata_cache(void)
-{
- kmem_cache_destroy(presto_dentry_slab);
-}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)