]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - fs/ceph/file.c
ceph: rework dcache readdir
authorYan, Zheng <zyan@redhat.com>
Tue, 16 Jun 2015 12:48:56 +0000 (20:48 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 25 Jun 2015 08:49:32 +0000 (11:49 +0300)
commitfdd4e15838e59c394a1ec4963b57c22c12608685
treeb5486f7b0f12abf9ed670d187f4841dfdb2aa13e
parentb459be739f97e2062b2ba77cfe8ea198dbd58904
ceph: rework dcache readdir

Previously our dcache readdir code relies on that child dentries in
directory dentry's d_subdir list are sorted by dentry's offset in
descending order. When adding dentries to the dcache, if a dentry
already exists, our readdir code moves it to head of directory
dentry's d_subdir list. This design relies on dcache internals.
Al Viro suggests using ncpfs's approach: keeping array of pointers
to dentries in page cache of directory inode. the validity of those
pointers are presented by directory inode's complete and ordered
flags. When a dentry gets pruned, we clear directory inode's complete
flag in the d_prune() callback. Before moving a dentry to other
directory, we clear the ordered flag for both old and new directory.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/caps.c
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.h
fs/ceph/super.h