ext4: improve credit estimate for EXT4_SINGLEDATA_TRANS_BLOCKS
authorJan Kara <jack@suse.cz>
Tue, 9 Apr 2013 16:39:26 +0000 (12:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Apr 2013 16:39:26 +0000 (12:39 -0400)
Estimate of 27 credits for allocation of a block in extent based inode
is unnecessarily high. We can easily argue 20 is enough.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4_jbd2.h

index aeed0bac693b8707a994616b6908192b009fc843..c8c6885406db16cd7e273a2fc3f7e37ccd27fa6c 100644 (file)
  * block to complete the transaction.
  *
  * For extents-enabled fs we may have to allocate and modify up to
- * 5 levels of tree + root which are stored in the inode. */
+ * 5 levels of tree, data block (for each of these we need bitmap + group
+ * summaries), root which is stored in the inode, sb
+ */
 
 #define EXT4_SINGLEDATA_TRANS_BLOCKS(sb)                               \
        (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)   \
-        ? 27U : 8U)
+        ? 20U : 8U)
 
 /* Extended attribute operations touch at most two data buffers,
  * two bitmap buffers, and two group summaries, in addition to the inode