diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2013-01-21 17:42:59 -0200 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2013-01-21 17:44:16 -0200 |
commit | e92e971550777e3170c063e348a3aab5ccaf6ff9 (patch) | |
tree | 21ad177cb82f8ce4a3c1f218482fb4724358f70f | |
parent | b90e1ce83631b0baa4d1e097d418e33d7316298a (diff) | |
download | syslinux-e92e971550777e3170c063e348a3aab5ccaf6ff9.tar.gz |
xfs: Make xfs_dir2_entry_name_cmp() inline
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | core/fs/xfs/xfs_dir2.c | 12 | ||||
-rw-r--r-- | core/fs/xfs/xfs_dir2.h | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/core/fs/xfs/xfs_dir2.c b/core/fs/xfs/xfs_dir2.c index 4c63ec99..d833c259 100644 --- a/core/fs/xfs/xfs_dir2.c +++ b/core/fs/xfs/xfs_dir2.c @@ -28,18 +28,6 @@ #include "xfs_dir2.h" -int xfs_dir2_entry_name_cmp(uint8_t *start, uint8_t *end, const char *name) -{ - if (!name || (strlen(name) != end - start)) - return -1; - - while (start < end) - if (*start++ != *name++) - return -1; - - return 0; -} - uint32_t xfs_dir2_da_hashname(const uint8_t *name, int namelen) { uint32_t hash; diff --git a/core/fs/xfs/xfs_dir2.h b/core/fs/xfs/xfs_dir2.h index 8e4e9857..fa403f38 100644 --- a/core/fs/xfs/xfs_dir2.h +++ b/core/fs/xfs/xfs_dir2.h @@ -23,7 +23,6 @@ #include "xfs.h" -int xfs_dir2_entry_name_cmp(uint8_t *start, uint8_t *end, const char *name); void *xfs_dir2_get_dirblks(struct fs_info *fs, block_t startblock, xfs_filblks_t c); uint32_t xfs_dir2_da_hashname(const uint8_t *name, int namelen); @@ -51,4 +50,17 @@ static inline bool xfs_dir2_isleaf(struct fs_info *fs, xfs_dinode_t *dip) return (last == XFS_INFO(fs)->dirleafblk + (1 << XFS_INFO(fs)->dirblklog)); } +static inline int xfs_dir2_entry_name_cmp(uint8_t *start, uint8_t *end, + const char *name) +{ + if (!name || (strlen(name) != end - start)) + return -1; + + while (start < end) + if (*start++ != *name++) + return -1; + + return 0; +} + #endif /* XFS_DIR2_H_ */ |