Whamcloud - gitweb
- fixed stupid bug with locking in MDS. It caused clients do not flush local
[fs/lustre-release.git] / lustre / smfs / cache_space.c
index 9d3bd96..674a264 100644 (file)
@@ -44,7 +44,7 @@ static struct cache_purge_queue smfs_cpq;
 static struct cache_purge_queue *cpq = &smfs_cpq;
 
 #define CACHE_HOOK "cache_hook"
-int cache_space_pre_hook(struct inode *inode, struct dentry *dentry,
+int cache_space_pre_hook(struct inode *inode, void *dentry,
                          void *data1, void *data2, int op, void *handle)
 {
         int rc = 0;
@@ -62,14 +62,16 @@ int cache_space_pre_hook(struct inode *inode, struct dentry *dentry,
         RETURN(rc); 
 }
 
-int cache_space_post_hook(struct inode *inode, struct dentry *dentry,
-                         void *data1, void *data2, int op, void *handle)
+int cache_space_post_hook(struct inode *inode, void *de, void *data1, 
+                          void *data2, int op, void *handle)
 {
         int rc = 0;
         ENTRY;
         if (smfs_cache_hook(inode)) {      
                 struct inode *new_inode = (struct inode*)data1;
-                struct dentry *new_dentry = (struct dentry*)data2;                    
+                struct dentry *new_dentry = (struct dentry*)data2;        
+                struct dentry *dentry = (struct dentry *)de;
+            
                 LASSERT(handle != NULL);                                
                 rc = cache_space_post(op, handle, inode, dentry, new_inode, 
                                       new_dentry);
@@ -114,6 +116,8 @@ static int cache_leaf_node(struct dentry *dentry, __u64 *active_entry)
 {
         struct inode *inode = dentry->d_inode;
 
+        if (!dentry->d_inode)
+                return 0;
         if (S_ISDIR(inode->i_mode)) {
                 if (inode->i_nlink != 2)
                         return 0;
@@ -684,6 +688,7 @@ static  cache_hook_op cache_space_hook_ops[HOOK_MAX + 1] = {
         [HOOK_RENAME]     cache_space_hook_rename,
         [HOOK_SETATTR]    NULL,
         [HOOK_WRITE]      NULL,
+        [HOOK_READDIR]    NULL,
 };
 
 int cache_space_post(int op, void *handle, struct inode *old_dir,