crush: whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
crush: make item adjust weight adjust *all* instances of the item

This is useful if you have parallel trees and an item appears in both.

Return the number of items changed instead of 0; fix callers.

Signed-off-by: Sage Weil <sage@inktank.com>
crush: add test for reweighting multiple items in the tree

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: remove fiemap use from import

On some kernels and filesystems fiemap can be racy and provide
incorrect data even after an fsync. Later we can use SEEK_HOLE and
SEEK_DATA, but for now just detect zero runs like we do with stdin.

Basically this adapts import from stdin to work in the case of a file
or block device, and gets rid of other cruft in the import that used
fiemap.

Fixes: #4388
Backport: bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: clean up do_import() a bit

Move declarations above error conditons so we can goto done almost
everywhere. Remove cpp_strerror printing, since it will be done by the
caller.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge branch 'wip-rbd-import' into next

Reviewed-by: Sage Weil <sage.weil@inktank.com>
mon/PaxosService: fix proposal waiter handling

- Cancel the propsal waiters with EAGAIN on election, etc.
- Drop the wakeup helper and open-code the one caller.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph-disk-prepare: 'mkfs -t' instead of 'mkfs --type='

Older mkfs (el6) doesn't like --type=.

Fixes: #4495
Reported-by: Alexandre Maragone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'next'
Makefile.am: fix misspelt header name

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: use enum instead of static const int

This way it compiles.

Signed-off-by: Sage Weil <sage@inktank.com>
Makefile: missing header

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: optionally wait for a flush before enabling writeback

Older guests may not send flushes properly (i.e. never), so if this is
enabled, rbd_cache=true is safe for them transparently.

Disable by default, since it will unnecessarily slow down newer guest
boot, and prevent writeback caching for things that don't need to send
flushes, like the command line tool.

Refs: #3817
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
PendingReleaseNotes: fix typo

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
QuorumService.h: use enum instead of static const int

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #118 from dalgaaf/wip-da-enum

QuorumService.h: use enum instead of static const int

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #106 from ceph/wip-crush

crush: update weights properly for DAG (not tree) maps 

Reviewed-by: caleb miles <caleb.miles@inktank.com>
mds: preserve subtree bounds until slave commit

When replaying an operation that rename a directory inode to non-auth subtree,
if the inode has subtree bounds, we should prevent them from being trimmed
until slave commit.

This patch also fixes a bug in ESlaveUpdate::replay(). EMetaBlob::replay()
should be called before MDCache::finish_uncommitted_slave_update().

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: process finished contexts in batch

If there are several unstable locks in an inode, current Locker::eval(CInode*,)
processes each lock's finished contexts seperately. This may cause very deep
call stack if finished contexts also call Locker::eval() on the same inode.
An extreme example is:

Locker::eval() wakes an open request(). Server::handle_client_open() starts
a log entry, then call Locker::issue_new_caps(). Locker::issue_new_caps()
calls Locker::eval() and wakes another request. The later request also tries
starting a log entry.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: fix MDCache::adjust_bounded_subtree_auth()

There are cases that need both create new bound and swallow intervening
subtree. For example: A MDS exports subtree A with bound B and imports
subtree B with bound C at the same time. The MDS crashes, exporting
subtree A fails, but importing subtree B succeed. During recovery, the
MDS may create new bound C and swallow subtree B.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>