commit ba040cf86539a30883a88e1c784ca6df048b8820
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Fri Feb 23 22:25:35 2007 -0500

    odf= mount option

diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index d3615b5..4a6f81a 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -547,10 +547,6 @@ static int unionfs_read_super(struct super_block *sb, void 
*raw_data,
                         * and will be put by s_root. put_ns decides if we got
                         * the ns dentry but not yet assigned it to s_root */
 
-       /* this ofcourse would need to get odf file from options 1st*/
-       if ( !raw_data )
-               raw_data = odf_getoptions();
-       
        if (!raw_data) {
                printk(KERN_WARNING
                       "unionfs_read_super: missing data argument\n");
@@ -602,7 +598,6 @@ static int unionfs_read_super(struct super_block *sb, void 
*raw_data,
        }
 
        hidden_root_info = unionfs_parse_options(sb, raw_data);
-
        if (IS_ERR(hidden_root_info)) {
                printk(KERN_WARNING
                       "unionfs_read_super: error while parsing options "
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 29d94c2..954c154 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -306,15 +306,45 @@ out:
        return err;
 }
 /*
- * Moves the dentry to /odf/reclaim with the name of its inode no
+ * Returns 0 if the given path is a valid odf file
  */
-int odf_reclaim(struct dentry *dentry)
+int odf_is_odf(struct dentry *d_odf)
+{
+       struct dentry *magic;
+       int err = 0;
+       
+       if (!d_odf->d_inode) {
+               err = -EINVAL;
+               goto out;
+       }
+
+       if (!S_ISDIR(d_odf->d_inode->i_mode)) {
+               err = -EINVAL;
+               goto out;
+       }
+
+       magic = lookup_one_len(ODF_MAGIC_FILE, d_odf, strlen(ODF_MAGIC_FILE));
+       if (IS_ERR(magic) || !magic) {
+               err = -EINVAL;
+               goto out;
+       }
+       else if (!magic->d_inode)
+               err = -EINVAL;
+
+       dput(magic);
+out:
+       if (err)
+               printk("unionfs: Invalid odf\n");
+       return err;
+}
+int odf_parse_options(char *options, char **odf_path)
 {
        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;
+       char *ptr, *ptrend;
 
        odf_dentry = UNIONFS_D(dentry)->odf_info->dentry;
        odi = UNIONFS_SB(dentry->d_sb)->odf->odi_rc;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to