summaryrefslogtreecommitdiffstats
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-02 11:54:25 -0800
committerSage Weil <sage@newdream.net>2009-12-03 14:59:48 -0800
commit1d1de9160e0d8aff0d67a21137b62e63ffd6f184 (patch)
tree45482bacc25511428b150424f0bdb934b6d9bf73 /fs/ceph/dir.c
parent50b885b96c903e420a1eac54dd27626244704a06 (diff)
ceph: hide /.ceph from readdir results
We need to skip /.ceph in (cached) readdir results, and exclude "/.ceph" from the cached ENOENT lookup check. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 32ef5436722..89ce3ba4a61 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -132,6 +132,7 @@ more:
}
if (!d_unhashed(dentry) && dentry->d_inode &&
ceph_snap(dentry->d_inode) != CEPH_SNAPDIR &&
+ ceph_ino(dentry->d_inode) != CEPH_INO_CEPH &&
filp->f_pos <= di->offset)
break;
dout(" skipping %p %.*s at %llu (%llu)%s%s\n", dentry,
@@ -512,6 +513,12 @@ struct dentry *ceph_finish_lookup(struct ceph_mds_request *req,
return dentry;
}
+static int is_root_ceph_dentry(struct inode *inode, struct dentry *dentry)
+{
+ return ceph_ino(inode) == CEPH_INO_ROOT &&
+ strncmp(dentry->d_name.name, ".ceph", 5) == 0;
+}
+
/*
* Look up a single dir entry. If there is a lookup intent, inform
* the MDS so that it gets our 'caps wanted' value in a single op.
@@ -554,6 +561,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
if (strncmp(dentry->d_name.name,
client->mount_args->snapdir_name,
dentry->d_name.len) &&
+ !is_root_ceph_dentry(dir, dentry) &&
(ci->i_ceph_flags & CEPH_I_COMPLETE) &&
(__ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1))) {
di->offset = ci->i_max_offset++;