[PATCH 58/74] fallthru: ext2 support for lookup of d_type/d_ino in fallthrus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Valerie Aurora <vaurora@xxxxxxxxxx>

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

Signed-off-by: Valerie Aurora <valerie.aurora@xxxxxxxxx>
---
 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 daff471..145d9eb 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -352,15 +352,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);
-- 
1.7.0.4

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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux