- GOTO(err_out, rc2 = rc);
-
- for (ptr = dirent; (char *)ptr < (char *)dirent + rc;
- (char *)ptr += ptr->d_reclen) {
- int namlen = strlen(ptr->d_name);
-
- if (((namlen == 1) && !strcmp(ptr->d_name, ".")) ||
- ((namlen == 2) && !strcmp(ptr->d_name, "..")))
+ GOTO(err_out, rc);
+
+ list_for_each_entry_safe(dirent, n, &dentry_list, lld_list) {
+ i ++;
+ list_del(&dirent->lld_list);
+
+ namlen = strlen(dirent->lld_name);
+ LASSERT(sizeof(d_name) >= namlen + 1);
+ memcpy(d_name, dirent->lld_name, namlen);
+ PORTAL_FREE(dirent, sizeof(*dirent));
+
+ CDEBUG(D_INODE, "entry "LPU64" of PENDING DIR: %s\n",
+ i, d_name);
+
+ if (((namlen == 1) && !strcmp(d_name, ".")) ||
+ ((namlen == 2) && !strcmp(d_name, ".."))) {