diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-08-13 01:54:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-10 19:15:34 -0400 |
commit | 44aa5359be589f9cbe9cf0d5c97e22b27a04c7d3 (patch) | |
tree | d69dc626068b45e62f2456b1d7ab7ca08aff018f | |
parent | 3524de1c7953e7a22c43b9214ffc3680af6f8edb (diff) |
[PATCH] ufs endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/ufs/util.c | 14 | ||||
-rw-r--r-- | include/linux/ufs_fs.h | 10 |
2 files changed, 15 insertions, 9 deletions
diff --git a/fs/ufs/util.c b/fs/ufs/util.c index 22f820a9b15c..17437574f79c 100644 --- a/fs/ufs/util.c +++ b/fs/ufs/util.c | |||
@@ -184,14 +184,13 @@ void _ubh_memcpyubh_(struct ufs_sb_private_info * uspi, | |||
184 | dev_t | 184 | dev_t |
185 | ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi) | 185 | ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi) |
186 | { | 186 | { |
187 | __fs32 fs32; | 187 | __u32 fs32; |
188 | dev_t dev; | 188 | dev_t dev; |
189 | 189 | ||
190 | if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) | 190 | if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) |
191 | fs32 = ufsi->i_u1.i_data[1]; | 191 | fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[1]); |
192 | else | 192 | else |
193 | fs32 = ufsi->i_u1.i_data[0]; | 193 | fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[0]); |
194 | fs32 = fs32_to_cpu(sb, fs32); | ||
195 | switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { | 194 | switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { |
196 | case UFS_ST_SUNx86: | 195 | case UFS_ST_SUNx86: |
197 | case UFS_ST_SUN: | 196 | case UFS_ST_SUN: |
@@ -212,7 +211,7 @@ ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi) | |||
212 | void | 211 | void |
213 | ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev) | 212 | ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev) |
214 | { | 213 | { |
215 | __fs32 fs32; | 214 | __u32 fs32; |
216 | 215 | ||
217 | switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { | 216 | switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { |
218 | case UFS_ST_SUNx86: | 217 | case UFS_ST_SUNx86: |
@@ -227,11 +226,10 @@ ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev | |||
227 | fs32 = old_encode_dev(dev); | 226 | fs32 = old_encode_dev(dev); |
228 | break; | 227 | break; |
229 | } | 228 | } |
230 | fs32 = cpu_to_fs32(sb, fs32); | ||
231 | if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) | 229 | if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) |
232 | ufsi->i_u1.i_data[1] = fs32; | 230 | ufsi->i_u1.i_data[1] = cpu_to_fs32(sb, fs32); |
233 | else | 231 | else |
234 | ufsi->i_u1.i_data[0] = fs32; | 232 | ufsi->i_u1.i_data[0] = cpu_to_fs32(sb, fs32); |
235 | } | 233 | } |
236 | 234 | ||
237 | /** | 235 | /** |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index fc62887c5206..61eef508b041 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -351,6 +351,14 @@ struct ufs2_csum_total { | |||
351 | __fs64 cs_spare[3]; /* future expansion */ | 351 | __fs64 cs_spare[3]; /* future expansion */ |
352 | }; | 352 | }; |
353 | 353 | ||
354 | struct ufs_csum_core { | ||
355 | __u64 cs_ndir; /* number of directories */ | ||
356 | __u64 cs_nbfree; /* number of free blocks */ | ||
357 | __u64 cs_nifree; /* number of free inodes */ | ||
358 | __u64 cs_nffree; /* number of free frags */ | ||
359 | __u64 cs_numclusters; /* number of free clusters */ | ||
360 | }; | ||
361 | |||
354 | /* | 362 | /* |
355 | * File system flags | 363 | * File system flags |
356 | */ | 364 | */ |
@@ -715,7 +723,7 @@ struct ufs_cg_private_info { | |||
715 | 723 | ||
716 | struct ufs_sb_private_info { | 724 | struct ufs_sb_private_info { |
717 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ | 725 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ |
718 | struct ufs2_csum_total cs_total; | 726 | struct ufs_csum_core cs_total; |
719 | __u32 s_sblkno; /* offset of super-blocks in filesys */ | 727 | __u32 s_sblkno; /* offset of super-blocks in filesys */ |
720 | __u32 s_cblkno; /* offset of cg-block in filesys */ | 728 | __u32 s_cblkno; /* offset of cg-block in filesys */ |
721 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ | 729 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ |