]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge branch 'rootsnap' into unstable
authorSage Weil <sage@newdream.net>
Tue, 24 Aug 2010 19:17:57 +0000 (12:17 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 Aug 2010 19:17:57 +0000 (12:17 -0700)
Conflicts:
src/mds/Server.cc

1  2 
src/mds/AnchorServer.cc
src/mds/CDentry.h
src/mds/CInode.cc
src/mds/CInode.h
src/mds/Locker.cc
src/mds/MDCache.cc
src/mds/Server.cc

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 2c92e492c3a10aaf96ffc64d174a6a4c1effb52d,0d44b2ea63ca5fe626482c646e16b3c75af708c3..21b68bdd85361c224e59ddd9bec7d35fa08189c3
@@@ -4166,20 -4143,26 +4155,20 @@@ void Server::_unlink_local_finish(MDReq
  
  
  
 -/** _dir_is_not_empty
 - *
 - * check if a directory is non-empty (i.e. we can rmdir it), and make
 - * sure it is part of the same subtree (i.e. local) so that rmdir will
 - * occur locally.
 +/** _dir_is_nonempty[_unlocked]
   *
 - * this is a fastpath check.  we can't really be sure until we rdlock
 - * the filelock.
 + * check if a directory is non-empty (i.e. we can rmdir it).
   *
 - * @param in is the inode being rmdir'd.  return true if it is
 - * definitely not empty.
 + * the unlocked varient this is a fastpath check.  we can't really be
 + * sure until we rdlock the filelock.
   */
 -bool Server::_dir_is_nonempty(MDRequest *mdr, CInode *in)
 +bool Server::_dir_is_nonempty_unlocked(MDRequest *mdr, CInode *in)
  {
 -  dout(10) << "dir_is_nonempty " << *in << dendl;
 +  dout(10) << "dir_is_nonempty_unlocked " << *in << dendl;
    assert(in->is_auth());
  
-   if (in->snaprealm && in->snaprealm->snaps.size())
 -  
+   if (in->snaprealm && in->snaprealm->srnode.snaps.size())
 -    return true; //in a snapshot!
 +    return true; // in a snapshot!
  
    list<frag_t> frags;
    in->dirfragtree.get_leaves(frags);
      CDir *dir = in->get_or_open_dirfrag(mdcache, *p);
      assert(dir);
  
 -    // does the frag _look_ empty?
 -    if (dir->inode->get_projected_inode()->dirstat.size() > 0) {      
 -      dout(10) << "dir_is_nonempty projected dir size still "
 -             << dir->inode->get_projected_inode()->dirstat.size()
 -             << " on " << *dir->inode
 -             << dendl;
 -      return true;
 +    // is the frag obviously non-empty?
 +    if (dir->is_auth()) {
 +      if (dir->get_projected_fnode()->fragstat.size()) {
 +      dout(10) << "dir_is_nonempty_unlocked dirstat has " 
 +               << dir->get_projected_fnode()->fragstat.size() << " items " << *dir << dendl;
 +      return true;
 +      }
      }
 +  }
  
 -    // not dir auth?
 -    if (!dir->is_auth()) {
 -      dout(10) << "dir_is_nonempty non-auth dirfrag for " << *dir << dendl;
 -    }
 +  return false;
 +}
 +
 +bool Server::_dir_is_nonempty(MDRequest *mdr, CInode *in)
 +{
 +  dout(10) << "dir_is_nonempty " << *in << dendl;
 +  assert(in->is_auth());
 +
-   if (in->snaprealm && in->snaprealm->snaps.size())
++  if (in->snaprealm && in->snaprealm->srnode.snaps.size())
 +    return true; // in a snapshot!
 +
 +  if (in->get_projected_inode()->dirstat.size() > 0) {        
 +    dout(10) << "dir_is_nonempty projected dir size still "
 +           << in->get_projected_inode()->dirstat.size()
 +           << " on " << *in
 +           << dendl;
 +    return true;
    }
  
    return false;