Whamcloud - gitweb
ext2fs: check if Lustre filesystem is mounted
[tools/e2fsprogs.git] / lib / ext2fs / lookup.c
index af9fdd1..c1d802c 100644 (file)
@@ -1,14 +1,15 @@
 /*
  * lookup.c --- ext2fs directory lookup operations
- * 
+ *
  * Copyright (C) 1993, 1994, 1994, 1995 Theodore Ts'o.
  *
  * %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
  * %End-Header%
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
 #if HAVE_UNISTD_H
@@ -23,22 +24,22 @@ struct lookup_struct  {
        int             len;
        ext2_ino_t      *inode;
        int             found;
-};     
+};
 
 #ifdef __TURBOC__
  #pragma argsused
 #endif
 static int lookup_proc(struct ext2_dir_entry *dirent,
-                      int      offset,
-                      int      blocksize,
-                      char     *buf,
+                      int      offset EXT2FS_ATTR((unused)),
+                      int      blocksize EXT2FS_ATTR((unused)),
+                      char     *buf EXT2FS_ATTR((unused)),
                       void     *priv_data)
 {
        struct lookup_struct *ls = (struct lookup_struct *) priv_data;
 
-       if (ls->len != (dirent->name_len & 0xFF))
+       if (ls->len != ext2fs_dirent_name_len(dirent))
                return 0;
-       if (strncmp(ls->name, dirent->name, (dirent->name_len & 0xFF)))
+       if (strncmp(ls->name, dirent->name, ext2fs_dirent_name_len(dirent)))
                return 0;
        *ls->inode = dirent->inode;
        ls->found++;