xfs: Make xfs_dir2_entry_name_cmp() inline
authorPaulo Alcantara <pcacjr@zytor.com>
Mon, 21 Jan 2013 19:42:59 +0000 (17:42 -0200)
committerPaulo Alcantara <pcacjr@zytor.com>
Mon, 21 Jan 2013 19:44:16 +0000 (17:44 -0200)
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
core/fs/xfs/xfs_dir2.c
core/fs/xfs/xfs_dir2.h

index 4c63ec9..d833c25 100644 (file)
 
 #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;
index 8e4e985..fa403f3 100644 (file)
@@ -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_ */