+2004-07-08 Miklos Szeredi <miklos@szeredi.hu>
+
+ * When performing create or remove operation, refresh the parent's
+ attributes on next revalidate, as i_nlink (and maybe size/time)
+ could be inacurate.
+
2004-07-06 Miklos Szeredi <miklos@szeredi.hu>
* Make RELEASE method synchronous. This fixes an abort in libfuse
return 0;
}
+static void uncache_dir(struct inode *dir)
+{
+ struct dentry *entry = d_find_alias(dir);
+ if (!entry)
+ dir->i_nlink = 0;
+ else {
+ entry->d_time = jiffies - FUSE_REVALIDATE_TIME - 1;
+ dput(entry);
+ }
+}
+
/* create needs to return a positive entry, so this is actually an
mknod+lookup */
static int _fuse_mknod(struct inode *dir, struct dentry *entry, int mode,
}
d_instantiate(entry, inode);
+ uncache_dir(dir);
return 0;
}
return err ? err : -ENOENT;
}
d_instantiate(entry, inode);
+ uncache_dir(dir);
return 0;
}
err = fuse_do_getattr(entry->d_inode);
if(err == -ENOENT)
entry->d_inode->i_nlink = 0;
+
+ uncache_dir(dir);
return 0;
}
return err;
static int fuse_rmdir(struct inode *dir, struct dentry *entry)
{
int err = fuse_remove(dir, entry, FUSE_RMDIR);
- if(!err)
+ if(!err) {
entry->d_inode->i_nlink = 0;
+ uncache_dir(dir);
+ }
return err;
}
in.args[2].value = newent->d_name.name;
request_send(fc, &in, &out);
+ if (!out.h.error) {
+ uncache_dir(olddir);
+ if (olddir != newdir)
+ uncache_dir(newdir);
+ }
+
return out.h.error;
}