Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / fs / udf / ialloc.c
index be11d8a..3873c67 100644 (file)
@@ -4,11 +4,6 @@
  * PURPOSE
  *     Inode allocation handling routines for the OSTA-UDF(tm) filesystem.
  *
- * CONTACTS
- *     E-mail regarding any portion of the Linux UDF file system should be
- *     directed to the development team mailing list (run by majordomo):
- *             linux_udf@hpesjro.fc.hp.com
- *
  * COPYRIGHT
  *     This file is distributed under the terms of the GNU General Public
  *     License (GPL). Copies of the GPL can be obtained from:
 
 void udf_free_inode(struct inode * inode)
 {
-       struct super_block * sb = inode->i_sb;
-       int is_directory;
-       unsigned long ino;
-
-       ino = inode->i_ino;
+       struct super_block *sb = inode->i_sb;
+       struct udf_sb_info *sbi = UDF_SB(sb);
 
        /*
         * Note: we must free any quota before locking the superblock,
@@ -48,36 +40,32 @@ void udf_free_inode(struct inode * inode)
        DQUOT_FREE_INODE(inode);
        DQUOT_DROP(inode);
 
-       lock_super(sb);
-
-       is_directory = S_ISDIR(inode->i_mode);
-
        clear_inode(inode);
 
-       if (UDF_SB_LVIDBH(sb))
-       {
-               if (is_directory)
+       mutex_lock(&sbi->s_alloc_mutex);
+       if (sbi->s_lvidbh) {
+               if (S_ISDIR(inode->i_mode))
                        UDF_SB_LVIDIU(sb)->numDirs =
                                cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs) - 1);
                else
                        UDF_SB_LVIDIU(sb)->numFiles =
                                cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) - 1);
                
-               mark_buffer_dirty(UDF_SB_LVIDBH(sb));
+               mark_buffer_dirty(sbi->s_lvidbh);
        }
-       unlock_super(sb);
+       mutex_unlock(&sbi->s_alloc_mutex);
 
        udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1);
 }
 
 struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
 {
-       struct super_block *sb;
+       struct super_block *sb = dir->i_sb;
+       struct udf_sb_info *sbi = UDF_SB(sb);
        struct inode * inode;
        int block;
        uint32_t start = UDF_I_LOCATION(dir).logicalBlockNum;
 
-       sb = dir->i_sb;
        inode = new_inode(sb);
 
        if (!inode)
@@ -94,8 +82,8 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
                iput(inode);
                return NULL;
        }
-       lock_super(sb);
 
+       mutex_lock(&sbi->s_alloc_mutex);
        UDF_I_UNIQUE(inode) = 0;
        UDF_I_LENEXTENTS(inode) = 0;
        UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
@@ -157,11 +145,11 @@ struct inode * udf_new_inode (struct inode *dir, int mode, int * err)
        else
                UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_LONG;
        inode->i_mtime = inode->i_atime = inode->i_ctime =
-               UDF_I_CRTIME(inode) = CURRENT_TIME;
+               UDF_I_CRTIME(inode) = current_fs_time(inode->i_sb);
        insert_inode_hash(inode);
        mark_inode_dirty(inode);
+       mutex_unlock(&sbi->s_alloc_mutex);
 
-       unlock_super(sb);
        if (DQUOT_ALLOC_INODE(inode))
        {
                DQUOT_DROP(inode);