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>
This commit is contained in:
@@ -412,17 +412,6 @@ struct xfs_dir3_data_hdr {
|
||||
|
||||
#define XFS_DIR3_DATA_CRC_OFF offsetof(struct xfs_dir3_data_hdr, hdr.crc)
|
||||
|
||||
static inline struct xfs_dir2_data_free *
|
||||
xfs_dir3_data_bestfree_p(struct xfs_dir2_data_hdr *hdr)
|
||||
{
|
||||
if (hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
|
||||
hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC)) {
|
||||
struct xfs_dir3_data_hdr *hdr3 = (struct xfs_dir3_data_hdr *)hdr;
|
||||
return hdr3->best_free;
|
||||
}
|
||||
return hdr->bestfree;
|
||||
}
|
||||
|
||||
/*
|
||||
* Active entry in a data block.
|
||||
*
|
||||
@@ -465,36 +454,6 @@ xfs_dir2_data_unused_tag_p(struct xfs_dir2_data_unused *dup)
|
||||
be16_to_cpu(dup->length) - sizeof(__be16));
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
xfs_dir3_data_hdr_size(bool dir3)
|
||||
{
|
||||
if (dir3)
|
||||
return sizeof(struct xfs_dir3_data_hdr);
|
||||
return sizeof(struct xfs_dir2_data_hdr);
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
xfs_dir3_data_entry_offset(struct xfs_dir2_data_hdr *hdr)
|
||||
{
|
||||
bool dir3 = hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
|
||||
hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC);
|
||||
return xfs_dir3_data_hdr_size(dir3);
|
||||
}
|
||||
|
||||
static inline struct xfs_dir2_data_entry *
|
||||
xfs_dir3_data_entry_p(struct xfs_dir2_data_hdr *hdr)
|
||||
{
|
||||
return (struct xfs_dir2_data_entry *)
|
||||
((char *)hdr + xfs_dir3_data_entry_offset(hdr));
|
||||
}
|
||||
|
||||
static inline struct xfs_dir2_data_unused *
|
||||
xfs_dir3_data_unused_p(struct xfs_dir2_data_hdr *hdr)
|
||||
{
|
||||
return (struct xfs_dir2_data_unused *)
|
||||
((char *)hdr + xfs_dir3_data_entry_offset(hdr));
|
||||
}
|
||||
|
||||
/*
|
||||
* Leaf block structures.
|
||||
*
|
||||
|
Reference in New Issue
Block a user