commit 5686a5737972da2ab57296e4581e015c0d9690bf
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Wed May 23 18:12:11 2007 -0400
moved call of odf_release_sr from drop_inode to clear_inode
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 1ed3329..82f6483 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -322,7 +322,7 @@ int odf_reclaim(struct dentry *dentry, int sr)
int err = 0;
odf_dentry = UNIONFS_D(dentry)->odf_info->dentry;
-
+
if (sr)
odi = UNIONFS_SB(dentry->d_sb)->odf->odi_sr;
else
@@ -376,7 +376,7 @@ int odf_release_sr(struct inode *inode)
goto out;
}
sprintf(name, "%lu", inode->i_ino);
-
+
odf_lock(odi_sr);
odf_lock(odi_rc);
@@ -399,7 +399,7 @@ int odf_release_sr(struct inode *inode)
}
lock_rename(old_dentry->d_parent, new_dentry->d_parent);
- err = vfs_rename(old_dentry->d_parent->d_inode, old_dentry,
+ err = vfs_rename(old_dentry->d_parent->d_inode, old_dentry,
new_dentry->d_parent->d_inode, new_dentry);
unlock_rename(old_dentry->d_parent, new_dentry->d_parent);
@@ -1394,6 +1394,10 @@ out:
* Flags : ODF_RMV_WH - remove entry only if whiteout
* ODF_RMV_NOTWH - remove entry only if not whiteout
* ODF_RMV_ANY - remove entry regardless of state
+ *
+ * If the item to be removed has i_count > 1 it is silly renamed (moved
+ * to (/odf/sr). XXX: If there's any place where we don't want this
+ * behaviour we can use an additional flag to this function.
*/
int odf_remove(struct dentry *dentry, int flags)
{
@@ -1441,8 +1445,8 @@ int odf_remove(struct dentry *dentry, int flags)
if (atomic_read(&dentry->d_inode->i_count) <= 1)
err = vfs_unlink(odi->dentry->d_parent->d_inode,
odi->dentry);
else
- /* silly rename open files, so their ino does
- * not get recycled while still open
+ /* silly rename open files, so their ino does
+ * not get recycled while still open
*/
err = odf_reclaim(dentry, 1);
}
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 1355339..28bf8fe 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -75,11 +75,6 @@ static void unionfs_delete_inode(struct inode *inode)
clear_inode(inode);
}
-static void unionfs_drop_inode(struct inode *inode)
-{
- odf_release_sr(inode);
- return generic_drop_inode(inode);
-}
/* final actions when unmounting a file system */
static void unionfs_put_super(struct super_block *sb)
@@ -871,6 +866,11 @@ static void unionfs_clear_inode(struct inode *inode)
kfree(UNIONFS_I(inode)->lower_inodes);
UNIONFS_I(inode)->lower_inodes = NULL;
+
+ /* if this inode has been silly renamed in the odf we can now safely
+ * remove it from /odf/sr since it's not used anymore
+ */
+ odf_release_sr(inode);
}
static struct inode *unionfs_alloc_inode(struct super_block *sb)
@@ -1005,7 +1005,6 @@ out:
struct super_operations unionfs_sops = {
.read_inode = unionfs_read_inode,
.delete_inode = unionfs_delete_inode,
- .drop_inode = unionfs_drop_inode,
.put_super = unionfs_put_super,
.statfs = unionfs_statfs,
.remount_fs = unionfs_remount_fs,
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs