]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: open inode by ino
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 15 May 2013 02:28:58 +0000 (10:28 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 28 May 2013 05:57:22 +0000 (13:57 +0800)
commiteeb68eb33d2973b8df6854c1b4ee6b41d99713b0
treefeaa705807a37654b86133341773eb0c89b87aa9
parent617f70d216d3908bf082fa0d1c144b1605a2cef6
mds: open inode by ino

This patch adds "open-by-ino" helper. It utilizes backtrace to find
inode's path and open the inode. The algorithm looks like:

1. Check MDS peers. If any MDS has the inode in its cache, goto step 6.
2. Fetch backtrace. If backtrace was previously fetched and get the
   same backtrace again, return -EIO.
3. Traverse the path in backtrace. If the inode is found, goto step 6;
   if non-auth dirfrag is encountered, goto next step. If fail to find
   the inode in its parent dir, goto step 1.
4. Request MDS peers to traverse the path in backtrace. If the inode
   is found, goto step 6. If MDS peer encounters non-auth dirfrag, it
   stops traversing. If any MDS peer fails to find the inode in its
   parent dir, goto step 1.
5. Use the same algorithm to open the inode's parent. Goto step 3 if
   succeeds; goto step 1 if fails.
6. return the inode's auth MDS ID.

The algorithm has two main assumptions:
1. If an inode is in its auth MDS's cache, its on-disk backtrace
   can be out of date.
2. If an inode is not in any MDS's cache, its on-disk backtrace
   must be up to date.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDS.cc
src/mds/MDSMap.h
src/mds/inode_backtrace.h
src/messages/MMDSOpenIno.h [new file with mode: 0644]
src/messages/MMDSOpenInoReply.h [new file with mode: 0644]
src/msg/Message.cc
src/msg/Message.h