aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext2/super.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 3aafb1dd917a..255cef5f7420 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1090,8 +1090,10 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
1090{ 1090{
1091 struct super_block *sb = dentry->d_sb; 1091 struct super_block *sb = dentry->d_sb;
1092 struct ext2_sb_info *sbi = EXT2_SB(sb); 1092 struct ext2_sb_info *sbi = EXT2_SB(sb);
1093 struct ext2_super_block *es = sbi->s_es;
1093 unsigned long overhead; 1094 unsigned long overhead;
1094 int i; 1095 int i;
1096 u64 fsid;
1095 1097
1096 if (test_opt (sb, MINIX_DF)) 1098 if (test_opt (sb, MINIX_DF))
1097 overhead = 0; 1099 overhead = 0;
@@ -1104,7 +1106,7 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
1104 * All of the blocks before first_data_block are 1106 * All of the blocks before first_data_block are
1105 * overhead 1107 * overhead
1106 */ 1108 */
1107 overhead = le32_to_cpu(sbi->s_es->s_first_data_block); 1109 overhead = le32_to_cpu(es->s_first_data_block);
1108 1110
1109 /* 1111 /*
1110 * Add the overhead attributed to the superblock and 1112 * Add the overhead attributed to the superblock and
@@ -1125,14 +1127,18 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
1125 1127
1126 buf->f_type = EXT2_SUPER_MAGIC; 1128 buf->f_type = EXT2_SUPER_MAGIC;
1127 buf->f_bsize = sb->s_blocksize; 1129 buf->f_bsize = sb->s_blocksize;
1128 buf->f_blocks = le32_to_cpu(sbi->s_es->s_blocks_count) - overhead; 1130 buf->f_blocks = le32_to_cpu(es->s_blocks_count) - overhead;
1129 buf->f_bfree = ext2_count_free_blocks(sb); 1131 buf->f_bfree = ext2_count_free_blocks(sb);
1130 buf->f_bavail = buf->f_bfree - le32_to_cpu(sbi->s_es->s_r_blocks_count); 1132 buf->f_bavail = buf->f_bfree - le32_to_cpu(es->s_r_blocks_count);
1131 if (buf->f_bfree < le32_to_cpu(sbi->s_es->s_r_blocks_count)) 1133 if (buf->f_bfree < le32_to_cpu(es->s_r_blocks_count))
1132 buf->f_bavail = 0; 1134 buf->f_bavail = 0;
1133 buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count); 1135 buf->f_files = le32_to_cpu(es->s_inodes_count);
1134 buf->f_ffree = ext2_count_free_inodes (sb); 1136 buf->f_ffree = ext2_count_free_inodes(sb);
1135 buf->f_namelen = EXT2_NAME_LEN; 1137 buf->f_namelen = EXT2_NAME_LEN;
1138 fsid = le64_to_cpup((void *)es->s_uuid) ^
1139 le64_to_cpup((void *)es->s_uuid + sizeof(u64));
1140 buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL;
1141 buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL;
1136 return 0; 1142 return 0;
1137} 1143}
1138 1144