commit 00996ae81967aac08d5d6f0e88ce4f9a800876f1
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Fri May 11 17:31:23 2007 -0400

    export: export ops get_parent, get the parent inode from odf fs's get_parent

diff --git a/fs/unionfs/export.c b/fs/unionfs/export.c
index c1560c4..7c3107d 100644
--- a/fs/unionfs/export.c
+++ b/fs/unionfs/export.c
@@ -1,4 +1,51 @@
 #include "union.h"
 
+static struct dentry *unionfs_get_parent(struct dentry *child)
+{
+       struct odf_sb_info *odf;
+       struct super_block *odf_sb;
+       struct inode *odf_i, *i;
+       struct dentry *odf_child, *odf_parent, *res ;
+
+       res = ERR_PTR(-EACCES);
+       odf = UNIONFS_SB(child->d_sb)->odf;
+       odf_sb = odf->sb->d_sb;
+
+       if (!odf_sb->s_export_op || !odf_sb->s_export_op->get_parent)
+               goto out;
+
+       odf_i = iget(odf_sb, child->d_inode->i_ino);
+       if (!odf_i)
+               goto out;
+
+       odf_child = d_alloc_anon(odf_i);
+       if (!odf_child) {
+               iput(odf_i);
+               res = ERR_PTR(-ENOMEM);
+               goto out;
+       }
+
+       odf_parent = odf_sb->s_export_op->get_parent(odf_child);
+       if (IS_ERR(odf_parent)) {
+               iput(odf_i);
+               res = odf_parent;
+               goto out;
+       }
+
+       i = iget(child->d_sb, odf_parent->d_inode->i_ino);
+       if (!i)
+               goto out;
+       res = d_alloc_anon(i);
+       if (!res) {
+               iput(i);
+               res = ERR_PTR(-ENOMEM);
+               goto out;
+       }
+       res->d_op = &unionfs_dops;
+out:
+       return res;
+}
+
 struct export_operations unionfs_export_ops = {
+       .get_parent = unionfs_get_parent
 };
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to