Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / fs / ext4 / ext4_jbd2.h
index f976111710231d3090bf9229d8a31a013b70b1c1..dabad1bc861723932fd7f25da1d86cdd0a641ce9 100644 (file)
 
 #define EXT4_RESERVE_TRANS_BLOCKS      12U
 
-#define EXT4_INDEX_EXTRA_TRANS_BLOCKS  8
+/*
+ * Number of credits needed if we need to insert an entry into a
+ * directory.  For each new index block, we need 4 blocks (old index
+ * block, new index block, bitmap block, bg summary).  For normal
+ * htree directories there are 2 levels; if the largedir feature
+ * enabled it's 3 levels.
+ */
+#define EXT4_INDEX_EXTRA_TRANS_BLOCKS  12U
 
 #ifdef CONFIG_QUOTA
 /* Amount of blocks needed for quota update - we know that the structure was
 #define EXT4_MAXQUOTAS_INIT_BLOCKS(sb) (EXT4_MAXQUOTAS*EXT4_QUOTA_INIT_BLOCKS(sb))
 #define EXT4_MAXQUOTAS_DEL_BLOCKS(sb) (EXT4_MAXQUOTAS*EXT4_QUOTA_DEL_BLOCKS(sb))
 
-static inline int ext4_jbd2_credits_xattr(struct inode *inode)
-{
-       int credits = EXT4_DATA_TRANS_BLOCKS(inode->i_sb);
-
-       /*
-        * In case of inline data, we may push out the data to a block,
-        * so we need to reserve credits for this eventuality
-        */
-       if (ext4_has_inline_data(inode))
-               credits += ext4_writepage_trans_blocks(inode) + 1;
-       return credits;
-}
-
-
 /*
  * Ext4 handle operation types -- for logging purposes
  */