commit ebdb764814b11636ace8e123c226079b7c3165cb
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Mon Apr 30 17:29:23 2007 -0400

    readded odf_reclaim

diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index d77495e..0bef74f 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -294,6 +294,52 @@ out:
 }
 
 /*
+ * Moves the dentry to /odf/reclaim with the name of its inode no
+ */
+int odf_reclaim(struct dentry *dentry)
+{                       
+       struct inode *old_dir, *new_dir;
+       struct dentry *odf_dentry, *old_dentry, *new_dentry;
+       struct odf_dentry_info *odi;
+       char *new_name = NULL;
+       int err = 0;
+       odf_dentry = UNIONFS_D(dentry)->odf_info->dentry; 
+       odi = UNIONFS_SB(dentry->d_sb)->odf->odi_rc; 
+       new_name = kzalloc(ODF_INAME_LEN, GFP_KERNEL);
+       if (!new_name){
+               err = -ENOMEM;
+               goto out; 
+       }
+       sprintf(new_name, "%lu", odf_dentry->d_inode->i_ino);
+       /* lock new dir, the old dir should already be locked */
+       odf_lock(odi);
+
+       old_dentry = odf_dentry;
+       old_dir = odf_dentry->d_parent->d_inode;
+       new_dir = odi->dentry->d_inode;
+       new_dentry = lookup_one_len(new_name, odi->dentry, strlen(new_name));
+       if (IS_ERR(new_dentry)) {
+               err = PTR_ERR(new_dentry);
+               goto out_unlock;
+       }
+
+       /* this should never happen */
+       BUG_ON(new_dentry->d_inode);
+
+       lock_rename(old_dentry->d_parent, new_dentry->d_parent);
+       err = vfs_rename(old_dir, old_dentry, new_dir, new_dentry);
+       unlock_rename(old_dentry->d_parent, new_dentry->d_parent);
+       dput(new_dentry);
+
+out_unlock:
+       odf_unlock(odi); /* unlock new dir */
+
+out:
+       kfree(new_name);
+       return err;
+}
+
+/*
  * Rename in odf, expects UnionFS dentries.
  * If the new_dentry exists (either as a file or wh)
  * it is removed using odf_remove (ie dirs are reclaimed)
@@ -1345,15 +1391,6 @@ int __odf_set_opaque(struct dentry *d, int branch)
 }
 
 /*
- * Checks if a dentry is opaque
- * The dentry version takes a UnionFS dentry, the inode one an ODF inode
- */
-int odf_is_opaque(struct dentry *dentry)
-{
-       return __odf_is_opaque(UNIONFS_D(dentry)->odf_info->dentry->d_inode);
-}
-
-/*
  * checks if the /odf/sb file exists
  */
 int odf_is_new(struct odf_sb_info *osi)
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index 8ad17b6..b9a558a 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -113,10 +113,8 @@ static inline int odf_is_wh(struct odf_dentry_info *odi)
 }
 
 /* opaque */
-int odf_is_opaque(struct dentry *dentry);
 int odf_get_opaque(struct super_block *sb, struct dentry *dentry);
 int odf_set_opaque(struct dentry *dentry, int branch);
-int __odf_is_opaque(struct inode *i);
 int __odf_set_opaque(struct dentry *d, int branch);
 #define __odf_get_opaque(i) (i->i_gid -1)
 
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to