]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: only go through the max_size change rigamarole if the client requested it
authorGreg Farnum <greg@inktank.com>
Fri, 12 Apr 2013 00:42:59 +0000 (17:42 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 12 Apr 2013 00:42:59 +0000 (17:42 -0700)
The previous patch was forcing a new size change even if we were
doing it as part of our regular optimistic settings; we don't much
want to do that. This is a small optimization, but Sage asked for
it and it's very easy.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/mds/Locker.cc

index ea923c3eba1d615f445169eb14e796af3df175e6..56bd47654ca1edf0dbb989e1c480b339a1850b31 100644 (file)
@@ -2731,6 +2731,7 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
   // increase or zero max_size?
   uint64_t size = m->get_size();
   bool change_max = false;
+  bool forced_change_max = false;
   uint64_t old_max = latest->client_ranges.count(client) ? latest->client_ranges[client].range.last : 0;
   uint64_t new_max = old_max;
   
@@ -2743,6 +2744,7 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
        dout(10) << "client requests file_max " << m->get_max_size()
                 << " > max " << old_max << dendl;
        change_max = true;
+       forced_change_max = true;
        new_max = ROUND_UP_TO((m->get_max_size()+1) << 1, latest->get_layout_size_increment());
       } else {
        new_max = calc_bounding(size * 2);
@@ -2783,7 +2785,8 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
          !in->filelock.can_force_wrlock(client)) {
        C_MDL_CheckMaxSize *cms = new C_MDL_CheckMaxSize(this, in,
                                                         false, 0,
-                                                        change_max, new_max,
+                                                        forced_change_max,
+                                                        new_max,
                                                         utime_t());
 
        in->filelock.add_waiter(SimpleLock::WAIT_STABLE, cms);