summaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-28 22:00:09 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-28 22:00:09 +0000
commit1a1d77dd589de5a567fa95e36aa6999c704ceca4 (patch)
tree141e31f89f18b9fe0831f31852e0435ceaccafc5 /fs/ext2
parentfb9c690a18b3d66925a65b17441c37fa14d4370b (diff)
Merge with 2.4.0-test7.
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/dir.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 3a18b375c..cd49b5da6 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -20,6 +20,10 @@
#include <linux/fs.h>
+static unsigned char ext2_filetype_table[] = {
+ DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK
+};
+
static int ext2_readdir(struct file *, void *, filldir_t);
struct file_operations ext2_dir_operations = {
@@ -152,10 +156,15 @@ revalidate:
* during the copy operation.
*/
unsigned long version = filp->f_version;
+ unsigned char d_type = DT_UNKNOWN;
+ if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE)
+ && de->file_type < EXT2_FT_MAX)
+ d_type = ext2_filetype_table[de->file_type];
error = filldir(dirent, de->name,
de->name_len,
- filp->f_pos, le32_to_cpu(de->inode));
+ filp->f_pos, le32_to_cpu(de->inode),
+ d_type);
if (error)
break;
if (version != filp->f_version)