Commit 2ef10312 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] hpfs endianness annotations

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 31b1f85b
...@@ -60,14 +60,14 @@ void hpfs_read_inode(struct inode *i) ...@@ -60,14 +60,14 @@ void hpfs_read_inode(struct inode *i)
if (hpfs_sb(i->i_sb)->sb_eas) { if (hpfs_sb(i->i_sb)->sb_eas) {
if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) { if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) {
if (ea_size == 2) { if (ea_size == 2) {
i->i_uid = le16_to_cpu(*(u16*)ea); i->i_uid = le16_to_cpu(*(__le16*)ea);
hpfs_inode->i_ea_uid = 1; hpfs_inode->i_ea_uid = 1;
} }
kfree(ea); kfree(ea);
} }
if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) { if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) {
if (ea_size == 2) { if (ea_size == 2) {
i->i_gid = le16_to_cpu(*(u16*)ea); i->i_gid = le16_to_cpu(*(__le16*)ea);
hpfs_inode->i_ea_gid = 1; hpfs_inode->i_ea_gid = 1;
} }
kfree(ea); kfree(ea);
...@@ -87,7 +87,7 @@ void hpfs_read_inode(struct inode *i) ...@@ -87,7 +87,7 @@ void hpfs_read_inode(struct inode *i)
int rdev = 0; int rdev = 0;
umode_t mode = hpfs_sb(sb)->sb_mode; umode_t mode = hpfs_sb(sb)->sb_mode;
if (ea_size == 2) { if (ea_size == 2) {
mode = le16_to_cpu(*(u16*)ea); mode = le16_to_cpu(*(__le16*)ea);
hpfs_inode->i_ea_mode = 1; hpfs_inode->i_ea_mode = 1;
} }
kfree(ea); kfree(ea);
...@@ -95,7 +95,7 @@ void hpfs_read_inode(struct inode *i) ...@@ -95,7 +95,7 @@ void hpfs_read_inode(struct inode *i)
if (S_ISBLK(mode) || S_ISCHR(mode)) { if (S_ISBLK(mode) || S_ISCHR(mode)) {
if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) { if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) {
if (ea_size == 4) if (ea_size == 4)
rdev = le32_to_cpu(*(u32*)ea); rdev = le32_to_cpu(*(__le32*)ea);
kfree(ea); kfree(ea);
} }
} }
...@@ -148,7 +148,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode) ...@@ -148,7 +148,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
we'd better not overwrite them we'd better not overwrite them
hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino); hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino);
} else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) { } else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) {
u32 ea; __le32 ea;
if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) { if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) {
ea = cpu_to_le32(i->i_uid); ea = cpu_to_le32(i->i_uid);
hpfs_set_ea(i, fnode, "UID", (char*)&ea, 2); 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,6 +165,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
&& i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333)) && i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333))
| (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) { | (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) {
ea = cpu_to_le32(i->i_mode); ea = cpu_to_le32(i->i_mode);
/* sick, but legal */
hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2); hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2);
hpfs_inode->i_ea_mode = 1; hpfs_inode->i_ea_mode = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment