lkml.org 
[lkml]   [2012]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 70/73] fallthru: ext2 support for lookup of d_type/d_ino in fallthrus [ver #2]
Date
Now that we have full union lookup support, lookup the true d_type and
d_ino of a fallthru.

Original-author: Valerie Aurora <vaurora@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com> (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);


\
 
 \ /
  Last update: 2012-02-21 21:01    [W:0.226 / U:8.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site