commit 92e5fa270babc58a88a4e4bc6147555536dad9ef
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Tue Apr 10 13:36:47 2007 -0400
whiteouts as hardlinks, removed ext2 dependancy
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index b161dd3..2ec0e28 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1663,7 +1663,6 @@ int odf_remove(struct dentry *dentry, int flags)
err = odf_reclaim(dentry);
else
err = vfs_unlink(odi->dentry->d_parent->d_inode, odi->dentry);
-
if (err)
goto out_unlock;
@@ -1757,28 +1756,9 @@ int odf_get_opaque(struct super_block *sb, struct dentry
*dentry)
return i;
}
-int __odf_is_opaque(struct inode *i)
-{
- if (!S_ISDIR(i->i_mode))
- return 0;
- if (EXT2_I(i)->i_flags & ODF_OPAQUE)
- return 1;
- return 0;
-}
-
/*
- * Gets opaque branch id from an inode, -1 if not opaque
- */
-int __odf_get_opaque(struct inode *i)
-{
- if (!__odf_is_opaque(i))
- return -1;
-
- return i->i_gid;
-}
-
-/*
- * Sets a dentry as opaque, if not use -1 for branch
+ * Sets a dentry as opaque. The branch must be the branch_id as stored in
unionfs sb.
+ * If the dentry is not to be opaque, then branch must be -1
* The dentry version takes a UnionFS dentry, the inode one an ODF inode
*/
int odf_set_opaque(struct dentry *dentry, int branch)
@@ -1792,15 +1772,10 @@ int odf_set_opaque(struct dentry *dentry, int branch)
int __odf_set_opaque(struct inode *i, int branch)
{
- int err = 0;
- if (branch < 0)
- EXT2_I(i)->i_flags &= ~ODF_OPAQUE;
- else {
- EXT2_I(i)->i_flags |= ODF_OPAQUE;
- i->i_gid = branch;
- }
- err = ext2_write_inode(i, 1);
- return err;
+ struct iattr ia;
+ ia.ia_valid = ATTR_GID;
+ ia.ia_gid = branch + 1; /* since gid is unsigned */
+ return inode_setattr(i, &ia);
}
/*
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index 36669bc..8a06d48 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -67,6 +67,8 @@
#define ODF_CONTENT "content"
#define ODF_CONTENT_LEN 7
+#define ODF_WH_NAME "whiteout"
+#define ODF_WH_LEN 8
#define ODF_CLEAN_ALL 1
#define ODF_CLEAN_CACHE 2
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs