diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-10-29 07:11:49 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-10-30 14:39:31 -0400 |
commit | 2ca9877410594dd321621efc9e1cbcd1ca24d0f3 (patch) | |
tree | 002e968ea70087df002ecc70d0966868c49b0cd1 /fs/xfs/xfs_da_format.h | |
parent | 9d23fc8575de7012b8853bd6fefe10534665de2f (diff) |
xfs: vectorise directory data operations part 2
Convert the rest of the directory data block encode/decode
operations to vector format.
This further reduces the size of the built binary:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig
792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1
792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2
789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3
789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_da_format.h')
-rw-r--r-- | fs/xfs/xfs_da_format.h | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/fs/xfs/xfs_da_format.h b/fs/xfs/xfs_da_format.h index 5b72dd2f8a69..aeca0038a013 100644 --- a/fs/xfs/xfs_da_format.h +++ b/fs/xfs/xfs_da_format.h | |||
@@ -412,17 +412,6 @@ struct xfs_dir3_data_hdr { | |||
412 | 412 | ||
413 | #define XFS_DIR3_DATA_CRC_OFF offsetof(struct xfs_dir3_data_hdr, hdr.crc) | 413 | #define XFS_DIR3_DATA_CRC_OFF offsetof(struct xfs_dir3_data_hdr, hdr.crc) |
414 | 414 | ||
415 | static inline struct xfs_dir2_data_free * | ||
416 | xfs_dir3_data_bestfree_p(struct xfs_dir2_data_hdr *hdr) | ||
417 | { | ||
418 | if (hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) || | ||
419 | hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC)) { | ||
420 | struct xfs_dir3_data_hdr *hdr3 = (struct xfs_dir3_data_hdr *)hdr; | ||
421 | return hdr3->best_free; | ||
422 | } | ||
423 | return hdr->bestfree; | ||
424 | } | ||
425 | |||
426 | /* | 415 | /* |
427 | * Active entry in a data block. | 416 | * Active entry in a data block. |
428 | * | 417 | * |
@@ -465,36 +454,6 @@ xfs_dir2_data_unused_tag_p(struct xfs_dir2_data_unused *dup) | |||
465 | be16_to_cpu(dup->length) - sizeof(__be16)); | 454 | be16_to_cpu(dup->length) - sizeof(__be16)); |
466 | } | 455 | } |
467 | 456 | ||
468 | static inline size_t | ||
469 | xfs_dir3_data_hdr_size(bool dir3) | ||
470 | { | ||
471 | if (dir3) | ||
472 | return sizeof(struct xfs_dir3_data_hdr); | ||
473 | return sizeof(struct xfs_dir2_data_hdr); | ||
474 | } | ||
475 | |||
476 | static inline size_t | ||
477 | xfs_dir3_data_entry_offset(struct xfs_dir2_data_hdr *hdr) | ||
478 | { | ||
479 | bool dir3 = hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) || | ||
480 | hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC); | ||
481 | return xfs_dir3_data_hdr_size(dir3); | ||
482 | } | ||
483 | |||
484 | static inline struct xfs_dir2_data_entry * | ||
485 | xfs_dir3_data_entry_p(struct xfs_dir2_data_hdr *hdr) | ||
486 | { | ||
487 | return (struct xfs_dir2_data_entry *) | ||
488 | ((char *)hdr + xfs_dir3_data_entry_offset(hdr)); | ||
489 | } | ||
490 | |||
491 | static inline struct xfs_dir2_data_unused * | ||
492 | xfs_dir3_data_unused_p(struct xfs_dir2_data_hdr *hdr) | ||
493 | { | ||
494 | return (struct xfs_dir2_data_unused *) | ||
495 | ((char *)hdr + xfs_dir3_data_entry_offset(hdr)); | ||
496 | } | ||
497 | |||
498 | /* | 457 | /* |
499 | * Leaf block structures. | 458 | * Leaf block structures. |
500 | * | 459 | * |