commit 068002e059f86f429a5a0c82a605fddfa17932d0
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Sat Feb 24 15:40:43 2007 -0500

    uuids

diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 954c154..90e1c2f 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1775,6 +1775,13 @@ int __odf_set_opaque(struct inode *i, int branch)
        return err;
 }
 
+void print_uuid(unsigned char *uuid)
+{
+       int i;
+       for (i = 0; i < 4; i++){
+               printk("%x-", *((unsigned int *) ((uuid+i*4))));                
}
+       printk("\n");
+}
 /* 
  * checks the sb/content file exists 
  */
@@ -1864,6 +1871,8 @@ int odf_write_sb_data(struct odf_sb_info* osi, struct 
unionfs_data *data, struct
        int len, bindex;
        int err = 0;
        __le32 le32;
+       unsigned char *uuid = NULL;
+       u32 *bid = NULL;
        char *branch_entry = kmalloc(ODF_BRANCH_PATH, GFP_KERNEL);
        char *branch_path = kmalloc(ODF_BRANCH_PATH, GFP_KERNEL);
        mm_segment_t oldfs;
@@ -1928,6 +1937,14 @@ int odf_write_sb_data(struct odf_sb_info* osi, struct 
unionfs_data *data, struct
                goto out_close;
        }
 
+       bid = kmalloc(count * sizeof(u32), GFP_KERNEL);
+       uuid = kmalloc(count * UUID_LEN, GFP_KERNEL);
+       if (!bid || !uuid) {
+               err = -ENOMEM;
+               goto out_close;
+       }
+       count = 0;
+
        /* now info about each branch */
        for (bindex = 0; bindex < branches; bindex++) {
 
@@ -1984,6 +2001,8 @@ out_close:
        set_fs(oldfs);
        filp_close(file,NULL);
 out:
+       kfree(uuid);
+       kfree(bid);
        kfree(branch_path);
        kfree(branch_entry);
        return err;
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index 4d4e06c..df52ee1 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -166,5 +166,6 @@ static inline void odf_unlock(struct odf_dentry_info *odi)
        mutex_unlock(&odi->lock);
 }
 
+extern void generate_random_uuid(unsigned char uuid_out[16]);
 
 #endif /* _ODF_H_ */
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to