summaryrefslogtreecommitdiffstats
path: root/fs/hpfs/hpfs.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-06 13:21:09 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:36 -0400
commit4085e155b14a89ee36f7bfc5bd07294b0c34b0e6 (patch)
treecf654d15d2a7cfd7c6e329f957665c2cecc3ccd4 /fs/hpfs/hpfs.h
parent185553b22436fe754f4ae8ec11344e822bb83717 (diff)
downloadop-kernel-dev-4085e155b14a89ee36f7bfc5bd07294b0c34b0e6.zip
op-kernel-dev-4085e155b14a89ee36f7bfc5bd07294b0c34b0e6.tar.gz
hpfs: get rid of bitfields endianness wanking in extended_attribute
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs/hpfs.h')
-rw-r--r--fs/hpfs/hpfs.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/fs/hpfs/hpfs.h b/fs/hpfs/hpfs.h
index 8b0650a..ca90bde 100644
--- a/fs/hpfs/hpfs.h
+++ b/fs/hpfs/hpfs.h
@@ -528,32 +528,23 @@ struct anode
run, or in multiple runs. Flags in the fnode tell whether the EA list
is immediate, in a single run, or in multiple runs. */
+enum {EA_indirect = 1, EA_anode = 2, EA_needea = 128 };
struct extended_attribute
{
-#ifdef __LITTLE_ENDIAN
- u8 indirect: 1; /* 1 -> value gives sector number
+ u8 flags; /* bit 0 set -> value gives sector number
where real value starts */
- u8 anode: 1; /* 1 -> sector is an anode
- that points to fragmented value */
- u8 flag23456: 5;
- u8 needea: 1; /* required ea */
-#else
- u8 needea: 1; /* required ea */
- u8 flag23456: 5;
- u8 anode: 1; /* 1 -> sector is an anode
+ /* bit 1 set -> sector is an anode
that points to fragmented value */
- u8 indirect: 1; /* 1 -> value gives sector number
- where real value starts */
-#endif
+ /* bit 7 set -> required ea */
u8 namelen; /* length of name, bytes */
u8 valuelen_lo; /* length of value, bytes */
u8 valuelen_hi; /* length of value, bytes */
- u8 name[0];
+ u8 name[];
/*
u8 name[namelen]; ascii attrib name
u8 nul; terminating '\0', not counted
u8 value[valuelen]; value, arbitrary
- if this.indirect, valuelen is 8 and the value is
+ if this.flags & 1, valuelen is 8 and the value is
u32 length; real length of value, bytes
secno secno; sector address where it starts
if this.anode, the above sector number is the root of an anode tree
@@ -561,6 +552,16 @@ struct extended_attribute
*/
};
+static inline bool ea_indirect(struct extended_attribute *ea)
+{
+ return ea->flags & EA_indirect;
+}
+
+static inline bool ea_in_anode(struct extended_attribute *ea)
+{
+ return ea->flags & EA_anode;
+}
+
/*
Local Variables:
comment-column: 40
OpenPOWER on IntegriCloud