From: David Howells <dhowells@redhat.com>
To: linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk,
valerie.aurora@gmail.com
Cc: linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org
Subject: [PATCH 55/73] fallthru: tmpfs support for lookup of d_type/d_ino in fallthrus [ver #2]
Date: Tue, 21 Feb 2012 18:04:22 +0000 [thread overview]
Message-ID: <20120221180422.25235.59500.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20120221175721.25235.8901.stgit@warthog.procyon.org.uk>
From: Valerie Aurora <vaurora@redhat.com>
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>
Cc: Hugh Dickins <hughd@google.com>
Cc: linux-mm@kvack.org
---
fs/libfs.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 43f1ac2..bd9388f 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -143,6 +143,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
ino_t ino;
char d_type;
int i = filp->f_pos;
+ int err = 0;
switch (i) {
case 0:
@@ -177,9 +178,13 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
spin_unlock(&next->d_lock);
spin_unlock(&dentry->d_lock);
if (d_is_fallthru(next)) {
- /* XXX placeholder until generic_readdir_fallthru() arrives */
- ino = 1;
- d_type = DT_UNKNOWN;
+ /* On tmpfs, should only fail with ENOMEM, EIO, etc. */
+ err = generic_readdir_fallthru(filp->f_path.dentry,
+ next->d_name.name,
+ next->d_name.len,
+ &ino, &d_type);
+ if (err)
+ return err;
} else {
ino = next->d_inode->i_ino;
d_type = dt_type(next->d_inode);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-02-21 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120221175721.25235.8901.stgit@warthog.procyon.org.uk>
2012-02-21 17:59 ` [PATCH 15/73] tmpfs: Add whiteout support " David Howells
2012-02-21 18:04 ` David Howells [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120221180422.25235.59500.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=hughd@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=valerie.aurora@gmail.com \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox