mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-07 12:35:28 +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
|
#undef S_SHIFT
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned int dentry_type(unsigned int type)
|
static unsigned int dentry_type(unsigned int type)
|
||||||
{
|
{
|
||||||
static unsigned char types[] = {
|
static unsigned char types[] = {
|
||||||
@@ -86,7 +85,6 @@ static unsigned int dentry_type(unsigned int type)
|
|||||||
|
|
||||||
return DT_UNKNOWN;
|
return DT_UNKNOWN;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int names_equal(const char *name_a, int len_a, const char *name_b,
|
static int names_equal(const char *name_a, int len_a, const char *name_b,
|
||||||
int len_b)
|
int len_b)
|
||||||
@@ -310,7 +308,8 @@ static int scoutfs_readdir(struct file *file, void *dirent, filldir_t filldir)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (filldir(dirent, dent->name, dent->name_len, pos,
|
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;
|
break;
|
||||||
|
|
||||||
file->f_pos = (pos | dent->coll_nr) + 1;
|
file->f_pos = (pos | dent->coll_nr) + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user