]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: directory operations
authorSage Weil <sage@newdream.net>
Wed, 22 Jul 2009 19:38:17 +0000 (12:38 -0700)
committerSage Weil <sage@newdream.net>
Wed, 22 Jul 2009 19:38:17 +0000 (12:38 -0700)
commitbe7164ee01422c58d941a6d789ac5c4a853e70f6
tree6571a697ce1efe245540e4c9d4fbd94189bc5ffa
parent681df992cb410d3ac06355390c55249b8698b53a
ceph: directory operations

Directory operations, including lookup, are defined here.  We take
advantage of lookup intents when possible.  For the most part, we just
need to build the proper requests for the metadata server(s) and
pass things off to the mds_client.

The results of most operations are normally incorporated into the
client's cache when the reply is parsed by ceph_fill_trace().
However, if the MDS replies without a trace (e.g., when retrying an
update after an MDS failure recovery), some operation-specific cleanup
may be needed.

We can validate cached dentries in two ways.  A per-dentry lease may
be issued by the MDS, or a per-directory cap may be issued that acts
as a lease on the entire directory.  In the latter case, a 'gen' value
is used to determine which dentries belong to the currently leased
directory contents.

We normally prepopulate the dcache and icache with readdir results.
This makes subsequent lookups and getattrs avoid any server
interaction.  It also lets us satisfy readdir operation by peeking at
the dcache IFF we hold the per-directory cap/lease, previously
performed a readdir, and haven't dropped any of the resulting
dentries.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c [new file with mode: 0644]