linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / ext2 / ialloc.c
index 8fb7f00..11e7d7a 100644 (file)
@@ -12,6 +12,7 @@
  *        David S. Miller (davem@caip.rutgers.edu), 1995
  */
 
+#include <linux/config.h>
 #include <linux/quotaops.h>
 #include <linux/sched.h>
 #include <linux/backing-dev.h>
@@ -582,6 +583,7 @@ got:
        inode->i_mode = mode;
 
        inode->i_ino = ino;
+       inode->i_blksize = PAGE_SIZE;   /* This is the optimal IO size (for stat), not the fs block size */
        inode->i_blocks = 0;
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
        memset(ei->i_data, 0, sizeof(ei->i_data));
@@ -659,6 +661,7 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
        unsigned long bitmap_count = 0;
        struct buffer_head *bitmap_bh = NULL;
 
+       lock_super (sb);
        es = EXT2_SB(sb)->s_es;
        for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {
                unsigned x;
@@ -681,6 +684,7 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
        printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n",
                percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter),
                desc_count, bitmap_count);
+       unlock_super(sb);
        return desc_count;
 #else
        for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {