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;
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);
{
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;
[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,