mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-05 03:44:05 +00:00
scoutfs: translate d_type in readdir
I had forgotten to translate from the scoutfs types in items to the vfs types for filldir() so userspace was seeing garbage d_type values. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -67,7 +67,6 @@ static unsigned int mode_to_type(umode_t mode)
|
||||
#undef S_SHIFT
|
||||
}
|
||||
|
||||
#if 0
|
||||
static unsigned int dentry_type(unsigned int type)
|
||||
{
|
||||
static unsigned char types[] = {
|
||||
@@ -86,7 +85,6 @@ static unsigned int dentry_type(unsigned int type)
|
||||
|
||||
return DT_UNKNOWN;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int names_equal(const char *name_a, int len_a, const char *name_b,
|
||||
int len_b)
|
||||
@@ -310,7 +308,8 @@ static int scoutfs_readdir(struct file *file, void *dirent, filldir_t filldir)
|
||||
continue;
|
||||
|
||||
if (filldir(dirent, dent->name, dent->name_len, pos,
|
||||
le64_to_cpu(dent->ino), dent->type))
|
||||
le64_to_cpu(dent->ino),
|
||||
dentry_type(dent->type)))
|
||||
break;
|
||||
|
||||
file->f_pos = (pos | dent->coll_nr) + 1;
|
||||
|
||||
Reference in New Issue
Block a user