ino_t inode;
int flags;
int done;
+ struct ext2fs_sb *sb;
};
static int link_proc(struct ext2_dir_entry *dirent,
dirent->inode = ls->inode;
dirent->name_len = ls->namelen;
strncpy(dirent->name, ls->name, ls->namelen);
+ if (ls->sb->s_feature_incompat & EXT2_FEATURE_INCOMPAT_FILETYPE)
+ dirent->name_len |= (ls->flags & 0x7) << 8;
ls->done++;
return DIRENT_ABORT|DIRENT_CHANGED;
}
+/*
+ * Note: the low 3 bits of the flags field are used as the directory
+ * entry filetype.
+ */
#ifdef __TURBOC__
#pragma argsused
#endif
ls.name = name;
ls.namelen = name ? strlen(name) : 0;
ls.inode = ino;
- ls.flags = 0;
+ ls.flags = flags;
ls.done = 0;
+ ls.sb = (struct ext2fs_sb *) fs->super;
retval = ext2fs_dir_iterate(fs, dir, DIRENT_FLAG_INCLUDE_EMPTY,
0, link_proc, &ls);