The diff improves deferred directory rename support by linking the
directory to its parent when the parent directory is flushed. The
two missing pieces to finish deferred directory support are:
* Detect empty directory for unlink
* Deferred mkdir support
And that will complete all the deferred link, unlink and move
operations, I think. To make it actually usable, some locking issues
should be cleaned up and waiting on directory flush added in a few
strategic places, the latter being something of a challenge in Ext2.
So I do not think this patch will ever actually be used in Ext2, but
it is close to being able to run well enough to measure the effect on
buffer namespace operation latency.
Regards,
Daniel
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 05fbdca..9dd7658 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -300,12 +300,23 @@ int ext2_flush_dir(struct dentry *dir)
dentry->d_flags |= DCACHE_BACKED;
spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_lock);
+
if (stale)
real_unlink(dir->d_inode, dentry);
+
if (ext2_add_link(dentry, dentry->d_inode)) { // report err!!!
inode_dec_link_count(dentry->d_inode);
iput(dentry->d_inode);
}
+
+ if (S_ISDIR(dentry->d_inode->i_mode)) {
+ struct page *page;
+ struct ext2_dir_entry_2 *dirent = ext2_dotdot(dentry->d_inode, &page);
+ show_dentry("link directory", dentry);
+ if (dirent)
+ ext2_set_link(dentry->d_inode, dirent, page, dir->d_inode);
+ }
+
dput(dentry);
spin_lock(&dcache_lock);
continue;
_______________________________________________
Tux3 mailing list
[email protected]
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3