aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r--fs/ext3/super.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index afc2d4f42d77..b34886734a44 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -436,7 +436,7 @@ static void ext3_put_super (struct super_block * sb)
436 return; 436 return;
437} 437}
438 438
439static kmem_cache_t *ext3_inode_cachep; 439static struct kmem_cache *ext3_inode_cachep;
440 440
441/* 441/*
442 * Called inside transaction, so use GFP_NOFS 442 * Called inside transaction, so use GFP_NOFS
@@ -445,7 +445,7 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
445{ 445{
446 struct ext3_inode_info *ei; 446 struct ext3_inode_info *ei;
447 447
448 ei = kmem_cache_alloc(ext3_inode_cachep, SLAB_NOFS); 448 ei = kmem_cache_alloc(ext3_inode_cachep, GFP_NOFS);
449 if (!ei) 449 if (!ei)
450 return NULL; 450 return NULL;
451#ifdef CONFIG_EXT3_FS_POSIX_ACL 451#ifdef CONFIG_EXT3_FS_POSIX_ACL
@@ -462,7 +462,7 @@ static void ext3_destroy_inode(struct inode *inode)
462 kmem_cache_free(ext3_inode_cachep, EXT3_I(inode)); 462 kmem_cache_free(ext3_inode_cachep, EXT3_I(inode));
463} 463}
464 464
465static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) 465static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
466{ 466{
467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo; 467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
468 468
@@ -1264,6 +1264,12 @@ static void ext3_orphan_cleanup (struct super_block * sb,
1264 return; 1264 return;
1265 } 1265 }
1266 1266
1267 if (bdev_read_only(sb->s_bdev)) {
1268 printk(KERN_ERR "EXT3-fs: write access "
1269 "unavailable, skipping orphan cleanup.\n");
1270 return;
1271 }
1272
1267 if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { 1273 if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
1268 if (es->s_last_orphan) 1274 if (es->s_last_orphan)
1269 jbd_debug(1, "Errors on filesystem, " 1275 jbd_debug(1, "Errors on filesystem, "
@@ -1341,8 +1347,6 @@ static void ext3_orphan_cleanup (struct super_block * sb,
1341 sb->s_flags = s_flags; /* Restore MS_RDONLY status */ 1347 sb->s_flags = s_flags; /* Restore MS_RDONLY status */
1342} 1348}
1343 1349
1344#define log2(n) ffz(~(n))
1345
1346/* 1350/*
1347 * Maximal file size. There is a direct, and {,double-,triple-}indirect 1351 * Maximal file size. There is a direct, and {,double-,triple-}indirect
1348 * block limit, and also a limit of (2^32 - 1) 512-byte sectors in i_blocks. 1352 * block limit, and also a limit of (2^32 - 1) 512-byte sectors in i_blocks.
@@ -1591,8 +1595,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
1591 sbi->s_desc_per_block = blocksize / sizeof(struct ext3_group_desc); 1595 sbi->s_desc_per_block = blocksize / sizeof(struct ext3_group_desc);
1592 sbi->s_sbh = bh; 1596 sbi->s_sbh = bh;
1593 sbi->s_mount_state = le16_to_cpu(es->s_state); 1597 sbi->s_mount_state = le16_to_cpu(es->s_state);
1594 sbi->s_addr_per_block_bits = log2(EXT3_ADDR_PER_BLOCK(sb)); 1598 sbi->s_addr_per_block_bits = ilog2(EXT3_ADDR_PER_BLOCK(sb));
1595 sbi->s_desc_per_block_bits = log2(EXT3_DESC_PER_BLOCK(sb)); 1599 sbi->s_desc_per_block_bits = ilog2(EXT3_DESC_PER_BLOCK(sb));
1596 for (i=0; i < 4; i++) 1600 for (i=0; i < 4; i++)
1597 sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); 1601 sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
1598 sbi->s_def_hash_version = es->s_def_hash_version; 1602 sbi->s_def_hash_version = es->s_def_hash_version;
@@ -2387,6 +2391,7 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)
2387 struct ext3_super_block *es = sbi->s_es; 2391 struct ext3_super_block *es = sbi->s_es;
2388 ext3_fsblk_t overhead; 2392 ext3_fsblk_t overhead;
2389 int i; 2393 int i;
2394 u64 fsid;
2390 2395
2391 if (test_opt (sb, MINIX_DF)) 2396 if (test_opt (sb, MINIX_DF))
2392 overhead = 0; 2397 overhead = 0;
@@ -2433,6 +2438,10 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)
2433 buf->f_files = le32_to_cpu(es->s_inodes_count); 2438 buf->f_files = le32_to_cpu(es->s_inodes_count);
2434 buf->f_ffree = percpu_counter_sum(&sbi->s_freeinodes_counter); 2439 buf->f_ffree = percpu_counter_sum(&sbi->s_freeinodes_counter);
2435 buf->f_namelen = EXT3_NAME_LEN; 2440 buf->f_namelen = EXT3_NAME_LEN;
2441 fsid = le64_to_cpup((void *)es->s_uuid) ^
2442 le64_to_cpup((void *)es->s_uuid + sizeof(u64));
2443 buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL;
2444 buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL;
2436 return 0; 2445 return 0;
2437} 2446}
2438 2447