diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-06 14:30:07 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-29 23:28:37 -0400 |
commit | c4c995430a94e7d94526fcb347c4ba4b2ae82500 (patch) | |
tree | 00dd49eb6252305e90106a375fc3fa12d25f4d1b /fs/hpfs/hpfs.h | |
parent | 4085e155b14a89ee36f7bfc5bd07294b0c34b0e6 (diff) |
hpfs: get rid of bitfields in struct fnode
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs/hpfs.h')
-rw-r--r-- | fs/hpfs/hpfs.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/fs/hpfs/hpfs.h b/fs/hpfs/hpfs.h index ca90bde6564c..37cc4483fbd1 100644 --- a/fs/hpfs/hpfs.h +++ b/fs/hpfs/hpfs.h | |||
@@ -436,6 +436,7 @@ struct bplus_header | |||
436 | 436 | ||
437 | #define FNODE_MAGIC 0xf7e40aae | 437 | #define FNODE_MAGIC 0xf7e40aae |
438 | 438 | ||
439 | enum {FNODE_anode = cpu_to_le16(2), FNODE_dir = cpu_to_le16(256)}; | ||
439 | struct fnode | 440 | struct fnode |
440 | { | 441 | { |
441 | u32 magic; /* f7e4 0aae */ | 442 | u32 magic; /* f7e4 0aae */ |
@@ -451,26 +452,9 @@ struct fnode | |||
451 | secno ea_secno; /* first sector of disk-resident ea's*/ | 452 | secno ea_secno; /* first sector of disk-resident ea's*/ |
452 | u16 ea_size_s; /* length of fnode-resident ea's */ | 453 | u16 ea_size_s; /* length of fnode-resident ea's */ |
453 | 454 | ||
454 | #ifdef __LITTLE_ENDIAN | 455 | __le16 flags; /* bit 1 set -> ea_secno is an anode */ |
455 | u8 flag0: 1; | 456 | /* bit 8 set -> directory. first & only extent |
456 | u8 ea_anode: 1; /* 1 -> ea_secno is an anode */ | ||
457 | u8 flag234567: 6; | ||
458 | #else | ||
459 | u8 flag234567: 6; | ||
460 | u8 ea_anode: 1; /* 1 -> ea_secno is an anode */ | ||
461 | u8 flag0: 1; | ||
462 | #endif | ||
463 | |||
464 | #ifdef __LITTLE_ENDIAN | ||
465 | u8 dirflag: 1; /* 1 -> directory. first & only extent | ||
466 | points to dnode. */ | ||
467 | u8 flag9012345: 7; | ||
468 | #else | ||
469 | u8 flag9012345: 7; | ||
470 | u8 dirflag: 1; /* 1 -> directory. first & only extent | ||
471 | points to dnode. */ | 457 | points to dnode. */ |
472 | #endif | ||
473 | |||
474 | struct bplus_header btree; /* b+ tree, 8 extents or 12 subtrees */ | 458 | struct bplus_header btree; /* b+ tree, 8 extents or 12 subtrees */ |
475 | union { | 459 | union { |
476 | struct bplus_leaf_node external[8]; | 460 | struct bplus_leaf_node external[8]; |
@@ -492,6 +476,16 @@ struct fnode | |||
492 | via fnode + ea_offs. I think.) */ | 476 | via fnode + ea_offs. I think.) */ |
493 | }; | 477 | }; |
494 | 478 | ||
479 | static inline bool fnode_in_anode(struct fnode *p) | ||
480 | { | ||
481 | return (p->flags & FNODE_anode) != 0; | ||
482 | } | ||
483 | |||
484 | static inline bool fnode_is_dir(struct fnode *p) | ||
485 | { | ||
486 | return (p->flags & FNODE_dir) != 0; | ||
487 | } | ||
488 | |||
495 | 489 | ||
496 | /* anode: 99.44% pure allocation tree */ | 490 | /* anode: 99.44% pure allocation tree */ |
497 | 491 | ||