[PATCH 70/73] fallthru: ext2 support for lookup of d_type/d_ino infallthrus [ver #2]

From: David Howells
Date: Tue Feb 21 2012 - 14:58:08 EST


Now that we have full union lookup support, lookup the true d_type and
d_ino of a fallthru.

Original-author: Valerie Aurora <vaurora@xxxxxxxxxx>
Signed-off-by: David Howells <dhowells@xxxxxxxxxx> (Further development)
---

fs/ext2/dir.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 5fd6bbe..a509096 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -366,15 +366,21 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
}
} else if (de->file_type == EXT2_FT_FALLTHRU) {
int over;
+ unsigned char d_type = DT_UNKNOWN;
+ ino_t ino;
+ int err;

offset = (char *)de - kaddr;
- /* XXX placeholder until generic_readdir_fallthru() arrives */
- over = filldir(dirent, de->name, de->name_len,
- (n<<PAGE_CACHE_SHIFT) | offset,
- 1, DT_UNKNOWN); /* XXX */
- if (over) {
- ext2_put_page(page);
- return 0;
+ err = generic_readdir_fallthru(filp->f_path.dentry, de->name,
+ de->name_len, &ino, &d_type);
+ if (!err) {
+ over = filldir(dirent, de->name, de->name_len,
+ (n<<PAGE_CACHE_SHIFT) | offset,
+ ino, d_type);
+ if (over) {
+ ext2_put_page(page);
+ return 0;
+ }
}
}
filp->f_pos += ext2_rec_len_from_disk(de->rec_len);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/