From: Sage Weil Date: Tue, 8 Sep 2009 20:15:39 +0000 (-0700) Subject: mds: bump file_max to powers of two X-Git-Tag: v0.14~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cc245854293371f362b5d3075b045380cf5a65ef;p=ceph.git mds: bump file_max to powers of two --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 2ac251034a7..614994518bb 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1829,6 +1829,18 @@ void Locker::kick_cap_releases(MDRequest *mdr) } } + +static __u64 calc_bounding(__u64 t) +{ + t |= t >> 1; + t |= t >> 2; + t |= t >> 4; + t |= t >> 8; + t |= t >> 16; + t |= t >> 32; + return t + 1; +} + /* * update inode based on cap flush|flushsnap|wanted. * adjust max_size, if needed. @@ -1859,7 +1871,8 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap, change_max = true; new_max = ROUND_UP_TO((m->get_max_size()+1) << 1, latest->get_layout_size_increment()); } else { - new_max = ROUND_UP_TO((size+1)<<1, latest->get_layout_size_increment()); + //new_max = ROUND_UP_TO((size+1)<<1, latest->get_layout_size_increment()); + new_max = calc_bounding(size * 2); if (new_max > old_max) change_max = true; else