diff options
| -rw-r--r-- | fs/ceph/dir.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 2e3b30dcfc94..45eda6d7a40c 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
| @@ -100,6 +100,14 @@ static unsigned fpos_off(loff_t p) | |||
| 100 | return p & 0xffffffff; | 100 | return p & 0xffffffff; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | static int fpos_cmp(loff_t l, loff_t r) | ||
| 104 | { | ||
| 105 | int v = ceph_frag_compare(fpos_frag(l), fpos_frag(r)); | ||
| 106 | if (v) | ||
| 107 | return v; | ||
| 108 | return (int)(fpos_off(l) - fpos_off(r)); | ||
| 109 | } | ||
| 110 | |||
| 103 | /* | 111 | /* |
| 104 | * When possible, we try to satisfy a readdir by peeking at the | 112 | * When possible, we try to satisfy a readdir by peeking at the |
| 105 | * dcache. We make this work by carefully ordering dentries on | 113 | * dcache. We make this work by carefully ordering dentries on |
| @@ -156,7 +164,7 @@ more: | |||
| 156 | if (!d_unhashed(dentry) && dentry->d_inode && | 164 | if (!d_unhashed(dentry) && dentry->d_inode && |
| 157 | ceph_snap(dentry->d_inode) != CEPH_SNAPDIR && | 165 | ceph_snap(dentry->d_inode) != CEPH_SNAPDIR && |
| 158 | ceph_ino(dentry->d_inode) != CEPH_INO_CEPH && | 166 | ceph_ino(dentry->d_inode) != CEPH_INO_CEPH && |
| 159 | ctx->pos <= di->offset) | 167 | fpos_cmp(ctx->pos, di->offset) <= 0) |
| 160 | break; | 168 | break; |
| 161 | dout(" skipping %p %.*s at %llu (%llu)%s%s\n", dentry, | 169 | dout(" skipping %p %.*s at %llu (%llu)%s%s\n", dentry, |
| 162 | dentry->d_name.len, dentry->d_name.name, di->offset, | 170 | dentry->d_name.len, dentry->d_name.name, di->offset, |
