diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2005-12-24 14:31:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-10 19:15:34 -0400 |
commit | 2ef1031282cd401b47a5f7f7477fe9ae69aff058 (patch) | |
tree | da811802fac7a2d8f4271ea6ddbc5001305a870a | |
parent | 31b1f85b71b0b69afba89a60989097cd805f13c3 (diff) |
[PATCH] hpfs endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/hpfs/inode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index bcf6ee36e065..7faef8544f32 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c | |||
@@ -60,14 +60,14 @@ void hpfs_read_inode(struct inode *i) | |||
60 | if (hpfs_sb(i->i_sb)->sb_eas) { | 60 | if (hpfs_sb(i->i_sb)->sb_eas) { |
61 | if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) { | 61 | if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) { |
62 | if (ea_size == 2) { | 62 | if (ea_size == 2) { |
63 | i->i_uid = le16_to_cpu(*(u16*)ea); | 63 | i->i_uid = le16_to_cpu(*(__le16*)ea); |
64 | hpfs_inode->i_ea_uid = 1; | 64 | hpfs_inode->i_ea_uid = 1; |
65 | } | 65 | } |
66 | kfree(ea); | 66 | kfree(ea); |
67 | } | 67 | } |
68 | if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) { | 68 | if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) { |
69 | if (ea_size == 2) { | 69 | if (ea_size == 2) { |
70 | i->i_gid = le16_to_cpu(*(u16*)ea); | 70 | i->i_gid = le16_to_cpu(*(__le16*)ea); |
71 | hpfs_inode->i_ea_gid = 1; | 71 | hpfs_inode->i_ea_gid = 1; |
72 | } | 72 | } |
73 | kfree(ea); | 73 | kfree(ea); |
@@ -87,7 +87,7 @@ void hpfs_read_inode(struct inode *i) | |||
87 | int rdev = 0; | 87 | int rdev = 0; |
88 | umode_t mode = hpfs_sb(sb)->sb_mode; | 88 | umode_t mode = hpfs_sb(sb)->sb_mode; |
89 | if (ea_size == 2) { | 89 | if (ea_size == 2) { |
90 | mode = le16_to_cpu(*(u16*)ea); | 90 | mode = le16_to_cpu(*(__le16*)ea); |
91 | hpfs_inode->i_ea_mode = 1; | 91 | hpfs_inode->i_ea_mode = 1; |
92 | } | 92 | } |
93 | kfree(ea); | 93 | kfree(ea); |
@@ -95,7 +95,7 @@ void hpfs_read_inode(struct inode *i) | |||
95 | if (S_ISBLK(mode) || S_ISCHR(mode)) { | 95 | if (S_ISBLK(mode) || S_ISCHR(mode)) { |
96 | if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) { | 96 | if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) { |
97 | if (ea_size == 4) | 97 | if (ea_size == 4) |
98 | rdev = le32_to_cpu(*(u32*)ea); | 98 | rdev = le32_to_cpu(*(__le32*)ea); |
99 | kfree(ea); | 99 | kfree(ea); |
100 | } | 100 | } |
101 | } | 101 | } |
@@ -148,7 +148,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode) | |||
148 | we'd better not overwrite them | 148 | we'd better not overwrite them |
149 | hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino); | 149 | hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino); |
150 | } else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) { | 150 | } else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) { |
151 | u32 ea; | 151 | __le32 ea; |
152 | if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) { | 152 | if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) { |
153 | ea = cpu_to_le32(i->i_uid); | 153 | ea = cpu_to_le32(i->i_uid); |
154 | hpfs_set_ea(i, fnode, "UID", (char*)&ea, 2); | 154 | hpfs_set_ea(i, fnode, "UID", (char*)&ea, 2); |
@@ -165,6 +165,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode) | |||
165 | && i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333)) | 165 | && i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333)) |
166 | | (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) { | 166 | | (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) { |
167 | ea = cpu_to_le32(i->i_mode); | 167 | ea = cpu_to_le32(i->i_mode); |
168 | /* sick, but legal */ | ||
168 | hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2); | 169 | hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2); |
169 | hpfs_inode->i_ea_mode = 1; | 170 | hpfs_inode->i_ea_mode = 1; |
170 | } | 171 | } |