Added some debug printk's for shares_write problems that Steve is seeing
[linux-2.6.git] / fs / ext3 / ialloc.c
index c682405..f30a4f4 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/quotaops.h>
 #include <linux/buffer_head.h>
 #include <linux/random.h>
+#include <linux/vs_dlimit.h>
 
 #include <asm/bitops.h>
 #include <asm/byteorder.h>
@@ -124,6 +125,7 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
         */
        DQUOT_INIT(inode);
        ext3_xattr_delete_inode(handle, inode);
+       DLIMIT_FREE_INODE(sb, inode->i_xid);
        DQUOT_FREE_INODE(inode);
        DQUOT_DROP(inode);
 
@@ -444,6 +446,16 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
        inode = new_inode(sb);
        if (!inode)
                return ERR_PTR(-ENOMEM);
+
+       if (sb->s_flags & MS_TAGXID)
+               inode->i_xid = current->xid;
+       else
+               inode->i_xid = 0;
+
+       if (DLIMIT_ALLOC_INODE(sb, inode->i_xid)) {
+               err = -ENOSPC;
+               goto out;
+       }
        ei = EXT3_I(inode);
 
        sbi = EXT3_SB(sb);
@@ -582,11 +594,10 @@ got:
        ei->i_file_acl = 0;
        ei->i_dir_acl = 0;
        ei->i_dtime = 0;
-       ei->i_rsv_window.rsv_start = 0;
-       ei->i_rsv_window.rsv_end = 0;
-       atomic_set(&ei->i_rsv_window.rsv_goal_size, EXT3_DEFAULT_RESERVE_BLOCKS);
-       ei->i_rsv_window.rsv_alloc_hit = 0;
-       INIT_LIST_HEAD(&ei->i_rsv_window.rsv_list);
+#ifdef EXT3_PREALLOCATE
+       ei->i_prealloc_block = 0;
+       ei->i_prealloc_count = 0;
+#endif
        ei->i_block_group = group;
 
        ext3_set_inode_flags(inode);
@@ -620,6 +631,7 @@ got:
        ext3_debug("allocating inode %lu\n", inode->i_ino);
        goto really_out;
 fail:
+       DLIMIT_FREE_INODE(sb, inode->i_xid);
        ext3_std_error(sb, err);
 out:
        iput(inode);
@@ -629,6 +641,7 @@ really_out:
        return ret;
 
 fail2:
+       DLIMIT_FREE_INODE(sb, inode->i_xid);
        inode->i_flags |= S_NOQUOTA;
        inode->i_nlink = 0;
        iput(inode);