File tree 4 files changed +11
-12
lines changed
4 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -1399,7 +1399,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
1399
1399
struct super_block * sb = dentry -> d_sb ;
1400
1400
struct ext2_sb_info * sbi = EXT2_SB (sb );
1401
1401
struct ext2_super_block * es = sbi -> s_es ;
1402
- u64 fsid ;
1403
1402
1404
1403
spin_lock (& sbi -> s_lock );
1405
1404
@@ -1453,9 +1452,7 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
1453
1452
buf -> f_ffree = ext2_count_free_inodes (sb );
1454
1453
es -> s_free_inodes_count = cpu_to_le32 (buf -> f_ffree );
1455
1454
buf -> f_namelen = EXT2_NAME_LEN ;
1456
- fsid = le64_to_cpup ((void * )es -> s_uuid ) ^
1457
- le64_to_cpup ((void * )es -> s_uuid + sizeof (u64 ));
1458
- buf -> f_fsid = u64_to_fsid (fsid );
1455
+ buf -> f_fsid = uuid_to_fsid (es -> s_uuid );
1459
1456
spin_unlock (& sbi -> s_lock );
1460
1457
return 0 ;
1461
1458
}
Original file line number Diff line number Diff line change @@ -6148,7 +6148,6 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
6148
6148
struct ext4_sb_info * sbi = EXT4_SB (sb );
6149
6149
struct ext4_super_block * es = sbi -> s_es ;
6150
6150
ext4_fsblk_t overhead = 0 , resv_blocks ;
6151
- u64 fsid ;
6152
6151
s64 bfree ;
6153
6152
resv_blocks = EXT4_C2B (sbi , atomic64_read (& sbi -> s_resv_clusters ));
6154
6153
@@ -6169,9 +6168,7 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
6169
6168
buf -> f_files = le32_to_cpu (es -> s_inodes_count );
6170
6169
buf -> f_ffree = percpu_counter_sum_positive (& sbi -> s_freeinodes_counter );
6171
6170
buf -> f_namelen = EXT4_NAME_LEN ;
6172
- fsid = le64_to_cpup ((void * )es -> s_uuid ) ^
6173
- le64_to_cpup ((void * )es -> s_uuid + sizeof (u64 ));
6174
- buf -> f_fsid = u64_to_fsid (fsid );
6171
+ buf -> f_fsid = uuid_to_fsid (es -> s_uuid );
6175
6172
6176
6173
#ifdef CONFIG_QUOTA
6177
6174
if (ext4_test_inode_flag (dentry -> d_inode , EXT4_INODE_PROJINHERIT ) &&
Original file line number Diff line number Diff line change @@ -1104,7 +1104,6 @@ static int zonefs_statfs(struct dentry *dentry, struct kstatfs *buf)
1104
1104
struct super_block * sb = dentry -> d_sb ;
1105
1105
struct zonefs_sb_info * sbi = ZONEFS_SB (sb );
1106
1106
enum zonefs_ztype t ;
1107
- u64 fsid ;
1108
1107
1109
1108
buf -> f_type = ZONEFS_MAGIC ;
1110
1109
buf -> f_bsize = sb -> s_blocksize ;
@@ -1127,9 +1126,7 @@ static int zonefs_statfs(struct dentry *dentry, struct kstatfs *buf)
1127
1126
1128
1127
spin_unlock (& sbi -> s_lock );
1129
1128
1130
- fsid = le64_to_cpup ((void * )sbi -> s_uuid .b ) ^
1131
- le64_to_cpup ((void * )sbi -> s_uuid .b + sizeof (u64 ));
1132
- buf -> f_fsid = u64_to_fsid (fsid );
1129
+ buf -> f_fsid = uuid_to_fsid (sbi -> s_uuid .b );
1133
1130
1134
1131
return 0 ;
1135
1132
}
Original file line number Diff line number Diff line change 4
4
5
5
#include <linux/types.h>
6
6
#include <asm/statfs.h>
7
+ #include <asm/byteorder.h>
7
8
8
9
struct kstatfs {
9
10
long f_type ;
@@ -50,4 +51,11 @@ static inline __kernel_fsid_t u64_to_fsid(u64 v)
50
51
return (__kernel_fsid_t ){.val = {(u32 )v , (u32 )(v >>32 )}};
51
52
}
52
53
54
+ /* Fold 16 bytes uuid to 64 bit fsid */
55
+ static inline __kernel_fsid_t uuid_to_fsid (__u8 * uuid )
56
+ {
57
+ return u64_to_fsid (le64_to_cpup ((void * )uuid ) ^
58
+ le64_to_cpup ((void * )(uuid + sizeof (u64 ))));
59
+ }
60
+
53
61
#endif
You can’t perform that action at this time.
0 commit comments