commit ffaf1772bad2ae9b410c09e9e392a4740d5a37cd
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 34e5219..9d6852d 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -277,6 +277,7 @@ static int parse_dirs_option(struct super_block *sb, struct 
unionfs_dentry_info
        struct dentry *dent2;
 
        if (options[0] == '\0') {
+               branches = 0;
                printk(KERN_WARNING "unionfs: no branches specified\n");
                err = -EINVAL;
                goto out;
@@ -457,6 +458,9 @@ static struct unionfs_dentry_info 
*unionfs_parse_options(struct super_block *sb,
                        continue;
                }
 
+               if (!strcmp("odf", optname))
+                       continue;
+               
                /* All of these options require an integer argument. */
                intval = simple_strtoul(optarg, &endptr, 0);
                if (*endptr) {
@@ -536,11 +540,12 @@ static int unionfs_read_super(struct super_block *sb, 
void *raw_data,
 
        struct unionfs_dentry_info *hidden_root_info = NULL;
        int bindex, bstart, bend;
+       char *odf_options = NULL;
+       int put_ns = 0; /* we dget the ns dentry in odf_read_super but do not
+                        * put it in odf_put_super since it is also assigned to 
s_root
+                        * 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");
@@ -561,8 +566,28 @@ static int unionfs_read_super(struct super_block *sb, void 
*raw_data,
        init_rwsem(&UNIONFS_SB(sb)->rwsem);
        UNIONFS_SB(sb)->high_branch_id = -1; /* -1 == invalid branch ID */
 
+       /* get the odf super block */
+       UNIONFS_SB(sb)->odf = odf_read_super(raw_data);
+       if (IS_ERR(UNIONFS_SB(sb)->odf)) {
+               printk(KERN_WARNING "unionfs_read_super: odf error\n");
+               err = PTR_ERR(UNIONFS_SB(sb)->odf);
+               UNIONFS_SB(sb)->odf = NULL;
+               goto out_free;
+       }
+       put_ns = 1;
+       if (!odf_is_new(UNIONFS_SB(sb)->odf, 0)) {
+               odf_options = odf_get_options(UNIONFS_SB(sb)->odf);
+               if (!odf_options) {
+                       printk(KERN_WARNING "unionfs_read_super: could not load 
options from odf\n");
+                       err = -EINVAL;
+                       goto out_free;
+               }
+               if (strstr(raw_data,"dirs="))
+                       printk(KERN_WARNING "unionfs: Ignoring dirs option\n");
+               raw_data = odf_options;
+       }
+       
        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 "
@@ -576,18 +601,9 @@ static int unionfs_read_super(struct super_block *sb, void 
*raw_data,
                goto out_free;
        }
 
-       /* get the odf super block */
-       UNIONFS_SB(sb)->odf = odf_read_super(ODF_MOUNT);        
-       if ( IS_ERR(UNIONFS_SB(sb)->odf) ) {
-               printk(KERN_WARNING "unionfs_read_super: odf error\n");
-               err = PTR_ERR(UNIONFS_SB(sb)->odf);
-               UNIONFS_SB(sb)->odf = NULL;
-               goto out_free;
-       }
-
        /* if new bit set, unset it and save branch conf */           
-       if (odf_is_new(1))
-               odf_putoptions(sb, hidden_root_info);
+       if (odf_is_new(UNIONFS_SB(sb)->odf, 1))
+               odf_put_options(sb, hidden_root_info);
 
        /* set the hidden superblock field of upper superblock */
        bstart = hidden_root_info->bstart;
@@ -639,7 +655,8 @@ static int unionfs_read_super(struct super_block *sb, void 
*raw_data,
        /* save odf root dentry */
        UNIONFS_D(sb->s_root)->odf_info = 
                        UNIONFS_SB(sb)->odf->odi_ns;
-
+       put_ns = 0;
+       
        /* Set the generation number to one, since this is for the mount. */
        atomic_set(&UNIONFS_D(sb->s_root)->generation, 1);
 
@@ -677,11 +694,17 @@ out_dput:
        }
 
 out_free:
+       if (UNIONFS_SB(sb)->odf) {
+               if (put_ns)
+                       odf_put_info(UNIONFS_SB(sb)->odf->odi_ns);
+               odf_put_super(UNIONFS_SB(sb)->odf);
+       }
        kfree(UNIONFS_SB(sb)->data);
        kfree(UNIONFS_SB(sb));
        sb->s_fs_info = NULL;
 
 out:
+       kfree(odf_options);
        if (hidden_root_info && !IS_ERR(hidden_root_info)) {
                kfree(hidden_root_info->lower_paths);
                kfree(hidden_root_info);
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 94ba039..d83491f 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1,62 +1,71 @@
 #include "union.h"
 
 /*
- *     Initialize any odf data we might need
+ * Initialize any odf data we might need
+ * Reads the odf file from the options
  */
-struct odf_sb_info* odf_read_super(char *odffile)
+struct odf_sb_info* odf_read_super(char *options)
 {
        struct nameidata nd;
        struct odf_sb_info *osi;
+       char *odffile = NULL;
        int err = 0;
        
-       if (odffile == NULL) {
-               printk(KERN_WARNING "unionfs_odf: No odf mount specified\n");
-               osi = ERR_PTR(-EINVAL);
+       err = odf_parse_options(options, &odffile);
+       if (err) {
+               osi = ERR_PTR(err);
                goto out;
        }
        
        err = path_lookup(odffile, LOOKUP_FOLLOW, &nd); 
        if (err) {      
-               printk(KERN_WARNING "unionfs_odf: Cannot access odf mount\n");
+               printk(KERN_WARNING "unionfs_odf: Cannot access odf\n");
                osi = ERR_PTR(err);
                goto out;
        }
-       
-       osi = kzalloc(sizeof(struct odf_sb_info), GFP_KERNEL);
 
-       osi->odi_ns = odf_getpath(ODF_NS);
+       err = odf_is_odf(nd.dentry);
+       if (err) {
+               osi = ERR_PTR(err);
+               goto out_release;
+       }
+       osi = kzalloc(sizeof(struct odf_sb_info), GFP_KERNEL);
+       if (!osi) {
+               osi = ERR_PTR(-ENOMEM);
+               goto out_release;
+       }
+       osi->odi_ns = odf_getpath(nd.dentry, ODF_NS);
        if (IS_ERR(osi->odi_ns)){
                err = PTR_ERR(osi->odi_ns);
                osi->odi_ns = NULL;
                goto out_free;
        }       
-       osi->odi_sb = odf_getpath(ODF_SB);
+       osi->odi_sb = odf_getpath(nd.dentry, ODF_SB);
        if (IS_ERR(osi->odi_sb)){
                err = PTR_ERR(osi->odi_sb);
                osi->odi_sb = NULL;
                goto out_free;
        }       
-       osi->odi_rc = odf_getpath(ODF_RC);
+       osi->odi_rc = odf_getpath(nd.dentry, ODF_RC);
        if (IS_ERR(osi->odi_rc)){
                err = PTR_ERR(osi->odi_rc);
                osi->odi_rc = NULL;
                goto out_free;
        }       
-       osi->odi_ic = odf_getpath(ODF_IC);
+       osi->odi_ic = odf_getpath(nd.dentry, ODF_IC);
        if (IS_ERR(osi->odi_ic)){
                err = PTR_ERR(osi->odi_ic);
                osi->odi_ic = NULL;
                goto out_free;
        }       
-
+       
        osi->mnt = nd.mnt;
        mntget(osi->mnt);
        dget(osi->mnt->mnt_sb->s_root);
        path_release(&nd);
-
        goto out;
 
-out_free:      
+out_free:
        odf_put_info(osi->odi_ns);
        odf_put_info(osi->odi_rc);
        odf_put_info(osi->odi_sb);
@@ -64,7 +73,10 @@ out_free:
 
        kfree(osi);
        osi = ERR_PTR(err);
+out_release:
+       path_release(&nd);
 out:
+       kfree(odffile);
        return osi;
 
 }
@@ -83,65 +95,114 @@ void odf_put_super(struct odf_sb_info *osi)
 }
 
 /*
- *     Returns the odf_dentry_info of the given path
+ * Returns the odf_dentry_info of the given special directory
+ * This is to be used for accessing whatever is in the root of the
+ * odf, ie /odf/ic, /odf/ns, etc
  */
-struct odf_dentry_info* odf_getpath(char *path)
+struct odf_dentry_info* odf_getpath(struct dentry *d_odf, const char *name)
 {
-       struct nameidata nd;
+       struct dentry *dentry;
        struct odf_dentry_info* odi = NULL;
-       int err = 0;
        
-       err = path_lookup(path, LOOKUP_FOLLOW, &nd);    
-       if (err) {      
-               printk(KERN_WARNING "unionfs_odf: Invalid odf\n");
-               odi = ERR_PTR(err);
+       dentry = lookup_one_len(name, d_odf, strlen(name));
+       if (IS_ERR(dentry) || !dentry) {
+               odi = ERR_PTR(-EINVAL);
                goto out;
        }
-       if (!nd.dentry->d_inode) {
-               printk(KERN_WARNING "unionfs_odf: Invalid odf\n");
+       else if (!dentry->d_inode) {
                odi = ERR_PTR(-EINVAL);
-               path_release(&nd);
-               goto out;
+               dput(dentry);
        }
-       odi = odf_fill_info(NULL, nd.dentry);
-       path_release(&nd);
-       
+       odi = odf_fill_info(NULL, dentry);
+       dput(dentry);
 out:
        return odi;
 }
 
 /*
- * 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 inode *old_dir, *new_dir;
-       struct dentry *old_dentry, *new_dentry;
-       struct odf_dentry_info *odi = odf_getpath(ODF_RC);
-       char *new_name = NULL;
+       struct dentry *magic;
        int err = 0;
+       
+       if (!d_odf->d_inode) {
+               err = -EINVAL;
+               goto out;
+       }
 
-       if (IS_ERR(odi)){
-               err = PTR_ERR(odi);
-               odi = NULL;
+       if (!S_ISDIR(d_odf->d_inode->i_mode)) {
+               err = -EINVAL;
                goto out;
        }
-       if (!odi){ /* Invalid ODF format(?) */
+
+       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)
+{
+       int err = 0;
+       char *ptr, *ptrend;
+
+       ptr = strstr(options,"odf=");
+       if (!ptr) {
+               err = -EINVAL;
+               printk("unionfs: odf option required\n");
+               goto out;
+       }
+       ptr+=4;
+       ptrend = (strchr(ptr, ','));
+       if (!ptrend)
+               ptrend = ptr + strlen(ptr);
+
+       if (ptr == ptrend) {
+               printk("unionfs: odf option requires an argument\n");
+               err = -EINVAL;
+               goto out;
+       }
+       *odf_path = kzalloc(ptrend - ptr + 1,GFP_KERNEL);
+       strncpy(*odf_path, ptr, ptrend - ptr);
+out:
+       return err;
+}
+/*
+ * 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_sb;
+       
        new_name = kzalloc(ODF_INAME_LEN, GFP_KERNEL);
        if (!new_name){
                err = -ENOMEM;
                goto out;
        }
-       sprintf(new_name,"%lu", dentry->d_inode->i_ino);        
+       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 = dentry;
-       old_dir = dentry->d_parent->d_inode;
+       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)) {
@@ -162,7 +223,6 @@ out_unlock:
 
 out:
        kfree(new_name);
-       odf_put_info(odi);
        return err;
 }
 
@@ -620,7 +680,7 @@ int odf_remove(struct dentry *dentry, int flags)
 
        /* remove */
        if (S_ISDIR(odi->dentry->d_inode->i_mode))
-               err = odf_reclaim(odi->dentry);
+               err = odf_reclaim(dentry);
        else 
                err = vfs_unlink(odi->dentry->d_parent->d_inode, odi->dentry);
 
@@ -740,68 +800,71 @@ int __odf_set_opaque(struct inode *i, int branch)
 }
 
 /* 
- * returns the dirs= part of the mount options 
+ * Requires an odf_sb_info, returns the dirs= part of the mount options 
  */
-char *odf_getoptions(void)
+char *odf_get_options(struct odf_sb_info *odf_sb)
 {
        int err = 0;
        char *options = NULL;
        char *branch_entry = NULL;
+       struct dentry *d_content;
+       struct file *file;
+       char *ptr;
+       mm_segment_t oldfs;
+       int perms = 0, len = 0;
+       int count;
 
-       if (!odf_is_new(0)) {
-               int i  = 0;
-               struct nameidata nd_br;
-               struct file *file;
-               char *ptr;
-               mm_segment_t oldfs;
-               int perms = 0, len = 0;
-
-               options = kzalloc(ODF_OPTIONS_LEN, GFP_KERNEL); /*XXX*/
-               branch_entry = kzalloc(ODF_BRANCH_PATH, GFP_KERNEL);
-               if (!options || !branch_entry)
-                       goto out_err;
-
-               ptr = options;
-               sprintf(ptr,"dirs=");
-               ptr+=strlen(ptr);
-               while (1) {
-                       sprintf(branch_entry,"%s%d", ODF_SB, i);
-                       err = path_lookup(branch_entry, LOOKUP_FOLLOW, &nd_br);
-                       if (err)
-                               break;
-
-                       dget(nd_br.dentry);
-                       mntget(nd_br.mnt);
-                       file = dentry_open(nd_br.dentry, nd_br.mnt, O_RDONLY);
-                       if (IS_ERR(file)) {
-                               mntput(nd_br.mnt);
-                               dput(nd_br.dentry);
-                               path_release(&nd_br);
-                               goto out_err;
-                       }
-
-                       file->f_pos = 0;
-                       oldfs = get_fs();
-                       set_fs(KERNEL_DS);
-
-                       file->f_op->read(file, (char*)&len, sizeof(int), 
&file->f_pos);
-                       file->f_op->read(file, ptr, len, &file->f_pos);
-                       file->f_op->read(file, (char*)&perms, sizeof(int), 
&file->f_pos);
-                       set_fs(oldfs);
-                       filp_close(file,NULL);
-                       path_release(&nd_br);
-
-                       ptr+=len;
-                       if (perms == MAY_READ)
-                               sprintf(ptr,"=ro:");
-                       else if (perms == (MAY_READ | MAY_WRITE))
-                               sprintf(ptr,"=rw:");
-                       ptr+=strlen(ptr);
-                       i++;
-               }
-               goto out;
+       options = kzalloc(ODF_OPTIONS_LEN, GFP_KERNEL); /*XXX*/
+       branch_entry = kzalloc(ODF_BRANCH_PATH, GFP_KERNEL);
+       if (!options || !branch_entry) {
+               err = -ENOMEM;
+               goto out_err;
+       }
+
+       ptr = options;
+       sprintf(ptr,"dirs=");
+       ptr+=strlen(ptr);
+
+       d_content = lookup_one_len("content", odf_sb->odi_sb->dentry, 
strlen("content"));
+       if (IS_ERR(d_content) || !d_content) {
+               err = -EINVAL;
+               goto out_err;
+       }
+       else if (!d_content->d_inode) {
+               dput(d_content);
+               err = -EINVAL;
+               goto out_err;
+       }
+       
+       mntget(odf_sb->mnt);
+       file = dentry_open(d_content, odf_sb->mnt, O_RDONLY);
+       if (IS_ERR(file)) {
+               mntput(odf_sb->mnt);
+               dput(d_content);
+               goto out_err;
        }
 
+       file->f_pos = 0;
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+
+       file->f_op->read(file, (char*)&count, sizeof(int), &file->f_pos);
+       while (count) {
+               file->f_op->read(file, (char*)&len, sizeof(int), &file->f_pos);
+               file->f_op->read(file, ptr, len, &file->f_pos);
+               file->f_op->read(file, (char*)&perms, sizeof(int), 
&file->f_pos);
+               
+               ptr+=len;
+               if (perms == MAY_READ)
+                       sprintf(ptr,"=ro:");
+               else if (perms == (MAY_READ | MAY_WRITE))
+                       sprintf(ptr,"=rw:");
+               ptr+=strlen(ptr);
+               count--;
+       }
+       set_fs(oldfs);
+       filp_close(file,NULL);
+       goto out;
 out_err:
        kfree(options);
        options = NULL;
@@ -813,37 +876,37 @@ out:
 /* 
  * checks the newbit, unset is a boolean, whether to unset the bit if it set 
  */
-int odf_is_new(int unset)
+int odf_is_new(struct odf_sb_info *osi, int unset)
 {
-       int err = 0;
-       struct nameidata nd;
        struct dentry *newbit;
-       
+
        /* check the new bit, for now check if file newbit exists */
-       err = path_lookup(ODF_NEWBIT, LOOKUP_FOLLOW, &nd);      
-       if (likely(err)) 
-               return 0; /* is not new */
+       newbit = lookup_one_len(ODF_NEWBIT, osi->odi_sb->dentry, 
strlen(ODF_NEWBIT));
+       if (IS_ERR(newbit) || !newbit)
+               return 0;
+       else if (likely(!newbit->d_inode)) {
+               dput(newbit);
+               return 0;
+       }
 
-       newbit = nd.dentry;
-       path_release(&nd);
        if (unset)
                vfs_unlink(newbit->d_parent->d_inode, newbit);
+       dput(newbit);
        return 1;
 }
 
 /*
  *     Writes the superblock data for new odf's, generates branch UUID's
  */
-int odf_putoptions(struct super_block* sb_union, struct unionfs_dentry_info 
*hidden_root)
+int odf_put_options(struct super_block* sb_union, struct unionfs_dentry_info 
*hidden_root)
 {
-       struct nameidata nd_sb, nd_br;
-       struct dentry *d;
-       struct vfsmount *m;
-       struct dentry *d_new;
+       struct dentry *d, *d_odf_sb, *d_content;
+       struct vfsmount *m, *odf_mnt;
        struct file *file;
        char *name;
        int perms, len, bindex;
        int err = 0;
+       int count;
        char *branch_entry = kmalloc(ODF_BRANCH_PATH, GFP_KERNEL);
        char *branch_path = kmalloc(ODF_BRANCH_PATH, GFP_KERNEL);
        mm_segment_t oldfs;
@@ -853,81 +916,57 @@ int odf_putoptions(struct super_block* sb_union, struct 
unionfs_dentry_info *hid
                goto out;
        }
 
-       err = path_lookup(ODF_SB, LOOKUP_FOLLOW, &nd_sb);       
+       d_odf_sb = UNIONFS_SB(sb_union)->odf->odi_sb->dentry;
+       odf_mnt = UNIONFS_SB(sb_union)->odf->mnt;
+
+       d_content = lookup_one_len("content", d_odf_sb, strlen("content"));
+       if (IS_ERR(d_content) || !d_content) {
+               err = -EINVAL;
+               goto out;
+       }
+       else if (d_content->d_inode) {
+               err = -EINVAL;
+               dput(d_content);
+               goto out;
+       }
+       err = vfs_create(d_odf_sb->d_inode, d_content, 0, NULL );
        if (err)
-               goto out;       
+               goto out;
+
+       mntget(odf_mnt);
+
+       file = dentry_open(d_content, odf_mnt, O_RDWR);
+       if (IS_ERR(file)) {
+               dput(d_content);
+               mntput(odf_mnt);
+               goto out;
+       }
+       file->f_pos = 0;        /* leave space for branch count */
        
-       /* FIXME: This function should check all the branches, generate fs UUID
-        * for each branch, and save the path and permissions of each branch.
-        * Right now only the latter part is implemented and the UUID's are 
simply
-        * the branch index. So we need to gen UUIDs
-        */
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       count = hidden_root->bend - hidden_root->bstart + 1;
+       file->f_op->write(file, (char*)&count, sizeof(int), &file->f_pos);
 
        for (bindex = hidden_root->bstart;
                        bindex >= 0 && bindex <= hidden_root->bend;
                        bindex++) {
 
-               /* for now, create a file per branch and 
-                  use bindex as UUID                   */
-               
                d = hidden_root->lower_paths[bindex].dentry;
                m = hidden_root->lower_paths[bindex].mnt;
-               sprintf(branch_entry,"%s%d", ODF_SB, bindex);
-               err = path_lookup(branch_entry, LOOKUP_FOLLOW, &nd_br); 
-               if (!err) {
-                       path_release(&nd_br);
-                       path_release(&nd_sb);
-                       err = -EINVAL;
-                       goto out;       
-               }
-
-               d_new = nd_br.dentry;
-               err = vfs_create(nd_sb.dentry->d_inode, 
-                               d_new,
-                               0,
-                               &nd_br );
-               if (err) {
-                       path_release(&nd_sb);
-                       goto out;
-               }
-               err = path_lookup(branch_entry, LOOKUP_FOLLOW, &nd_br); 
-               if (err) {
-                       path_release(&nd_br);
-                       path_release(&nd_sb);
-                       goto out;
-               }
-               d_new = nd_br.dentry;
 
                /* write full path, and perms in the file */
-               memset(branch_path, 0, 255);
-               name = d_path(d, m, branch_path, 255);
+               memset(branch_path, 0, ODF_BRANCH_PATH);
+               name = d_path(d, m, branch_path, ODF_BRANCH_PATH);
                perms = branchperms(sb_union, bindex); 
                len = strlen(name);
                
-               mntget(nd_br.mnt);
-               dget(d_new);
-
-               file = dentry_open(d_new, nd_br.mnt, O_WRONLY);
-               if (IS_ERR(file)) {
-                       dput(d_new);
-                       mntput(nd_br.mnt);
-                       path_release(&nd_br);
-                       path_release(&nd_sb);
-                       goto out;
-               }
-               file->f_pos = 0;
-               oldfs = get_fs();
-               set_fs(KERNEL_DS);
-
                file->f_op->write(file, (char*)&len, sizeof(int), &file->f_pos);
                file->f_op->write(file, name, strlen(name), &file->f_pos);
                file->f_op->write(file, (char*)&perms, sizeof(int), 
&file->f_pos);
-               set_fs(oldfs);
-               filp_close(file,NULL);
-               path_release(&nd_br);
        }
-
-       path_release(&nd_sb);
+       set_fs(oldfs);
+       filp_close(file,NULL);
 out:
        kfree(branch_path);
        kfree(branch_entry);
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index f72d311..a598c10 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -3,12 +3,12 @@
 
 #include "../ext2/ext2.h"
 
-#define ODF_MOUNT "/mnt/odf/"
-#define ODF_SB ODF_MOUNT "sb/"
-#define ODF_IC ODF_MOUNT "ic/"
-#define ODF_RC ODF_MOUNT "reclaim/"
-#define ODF_NS ODF_MOUNT "ns/"
-#define ODF_NEWBIT ODF_SB "newbit"
+#define ODF_SB "sb"
+#define ODF_IC "ic"
+#define ODF_RC "reclaim"
+#define ODF_NS "ns"
+#define ODF_NEWBIT "newbit"
+#define ODF_MAGIC_FILE "odfmagic"
 
 /* Some string constants */
 #define ODF_BRANCH_PATH 255
@@ -35,17 +35,19 @@
 #define ODF_DIRENT_MAGIC 0x0DFD1300
 
 /* super */
-struct odf_sb_info* odf_read_super(char *odffile);
+struct odf_sb_info* odf_read_super(char *options);
 void odf_put_super(struct odf_sb_info *osi);
-int odf_is_new(int unset);
-char *odf_getoptions(void);
-int odf_putoptions(struct super_block* sb_union, struct unionfs_dentry_info 
*hidden_root);
+int odf_is_new(struct odf_sb_info *osi, int unset);
+char *odf_get_options(struct odf_sb_info *odf_sb);
+int odf_put_options(struct super_block* sb_union, struct unionfs_dentry_info 
*hidden_root);
+int odf_parse_options(char *options, char **odf_path);
+int odf_is_odf(struct dentry *d_odf);
 
 /* lookup */
 int odf_lookup(struct dentry *parent, struct dentry *dentry, int flags);
 struct odf_dentry_info *__odf_lookup(struct odf_dentry_info *parent, const 
char *name, int len, int flags, struct odf_dentry_info *old_odi);
 
-struct odf_dentry_info *odf_getpath(char *path);
+struct odf_dentry_info *odf_getpath(struct dentry *d_odf,const char *name);
 struct odf_dentry_info *odf_fill_info(struct odf_dentry_info *odi, struct 
dentry *odf_dentry);
 struct odf_dentry_info *odf_alloc_info(struct dentry *odf_dentry);
 void odf_put_info(struct odf_dentry_info *odi);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to