commit 99bd3ecddc80445310de4ab7bc5d6deb7773050e
Author: Erez_Zadok <[EMAIL PROTECTED]>
Date:   Fri Jun 29 00:45:47 2007 -0400

    Unionfs: Remove superfluous check for NULL pointer
    
    Since we use containers and the struct inode is _inside_ the
    unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL inode
    pointer), return a valid non-NULL pointer.
    
    Signed-off-by: Josef 'Jeff' Sipek <[EMAIL PROTECTED]>
    
    Conflicts:
    
        fs/unionfs/super.c

diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h
index 
4d1a620f75da8a87e1324f86ed1ad42e332ec778..4db15311977790837e5b37a28d06ecba14e13c3f
 100644
--- a/fs/unionfs/fanout.h
+++ b/fs/unionfs/fanout.h
@@ -18,7 +18,13 @@
 #ifndef _FANOUT_H_
 #define _FANOUT_H_
 
-/* Inode to private data */
+/*
+ * Inode to private data
+ *
+ * Since we use containers and the struct inode is _inside_ the
+ * unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL
+ * inode pointer), return a valid non-NULL pointer.
+ */
 static inline struct unionfs_inode_info *UNIONFS_I(const struct inode *inode)
 {
        return container_of(inode, struct unionfs_inode_info, vfs_inode);
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 
79487c730e5a370e9dadc402a03cc045a2f546cc..b1504121e6cbd55807b7ae2dc32ea1e86c6b34a4
 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -30,11 +30,7 @@ static void unionfs_read_inode(struct in
        int size;
        struct unionfs_inode_info *info = UNIONFS_I(inode);
 
-       if (!info) {
-               printk(KERN_ERR "unionfs: no kernel memory when allocating "
-                      "inode private data!\n");
-               BUG();
-       }
+       unionfs_read_lock(inode->i_sb);
 
        memset(info, 0, offsetof(struct unionfs_inode_info, vfs_inode));
        info->bstart = -1;
@@ -59,6 +55,8 @@ static void unionfs_read_inode(struct in
        inode->i_fop = &unionfs_main_fops;
 
        inode->i_mapping->a_ops = &unionfs_aops;
+
+       unionfs_read_unlock(inode->i_sb);
 }
 
 /*
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to