]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agorgw/rgw_main.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:20:39 +0000 (18:20 +0100)]
rgw/rgw_main.cc: use empty() instead of size() to check for emptiness

Use empty() instead of 'size() == 0' for performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/journal.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:12:22 +0000 (18:12 +0100)]
mds/journal.cc: use !empty() instead of size() to check for emptiness

Use !empty() instead of size() for performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/SnapServer.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:08:32 +0000 (18:08 +0100)]
mds/SnapServer.cc: use !empty() instead of size() to check for emptiness

Use !empty() instead of size() for performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDSMap.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:06:41 +0000 (18:06 +0100)]
mds/MDSMap.cc: use !empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDS.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 16:59:09 +0000 (17:59 +0100)]
mds/MDS.cc: use !empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDCache.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 16:57:54 +0000 (17:57 +0100)]
mds/MDCache.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Locker.cc: use !empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 16:56:12 +0000 (17:56 +0100)]
mds/Locker.cc: use !empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CInode.cc: use !empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 16:53:41 +0000 (17:53 +0100)]
mds/CInode.cc: use !empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CDir.cc: use !empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 16:50:32 +0000 (17:50 +0100)]
mds/CDir.cc: use !empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrbd/internal.cc: use !empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 16:48:48 +0000 (17:48 +0100)]
librbd/internal.cc: use !empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agokv_flat_btree_async.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 16:41:55 +0000 (17:41 +0100)]
kv_flat_btree_async.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocls_kvs.cc: use !empty() instead of 'size() > 0' to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 16:38:56 +0000 (17:38 +0100)]
cls_kvs.cc: use !empty() instead of 'size() > 0' to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocrushtool.cc: use !empty() instead of 'size() > 0' to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 16:33:12 +0000 (17:33 +0100)]
crushtool.cc: use !empty() instead of 'size() > 0' to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocrush/CrushWrapper.cc: don't pass c_str() result to std::string argument
Danny Al-Gaaf [Wed, 13 Feb 2013 16:30:54 +0000 (17:30 +0100)]
crush/CrushWrapper.cc: don't pass c_str() result to std::string argument

Fix issue found by cppcheck:

[src/crush/CrushWrapper.cc:352]: (performance) Passing the result of
  c_str() to a function that takes std::string as argument no. 4 is
  slow and redundant.
[src/crush/CrushWrapper.cc:388]: (performance) Passing the result of
  c_str() to a function that takes std::string as argument no. 4 is
  slow and redundant.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoobj_bencher.cc: use empty() instead of 'size() == 0' to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 16:22:41 +0000 (17:22 +0100)]
obj_bencher.cc: use empty() instead of 'size() == 0' to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocommon/WorkQueue.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 15:57:29 +0000 (16:57 +0100)]
common/WorkQueue.cc: use !empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocls_refcount.cc: use empty() instead of !size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 15:53:59 +0000 (16:53 +0100)]
cls_refcount.cc: use empty() instead of !size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocls/rbd/cls_rbd.cc: use !empty() instead of 'size() > 0'
Danny Al-Gaaf [Wed, 13 Feb 2013 15:49:53 +0000 (16:49 +0100)]
cls/rbd/cls_rbd.cc: use !empty() instead of 'size() > 0'

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_log.cc: don't pass c_str() result to std::string argument
Danny Al-Gaaf [Wed, 13 Feb 2013 15:01:48 +0000 (16:01 +0100)]
rgw/rgw_log.cc: don't pass c_str() result to std::string argument

Fix issue found by cppcheck:

[src/rgw/rgw_log.cc:340]: (performance) Passing the result of c_str() to a
  function that takes std::string as argument no. 4 is slow and redundant.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_gc.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:57:45 +0000 (15:57 +0100)]
rgw/rgw_gc.cc: use !empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_admin.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:45:27 +0000 (15:45 +0100)]
rgw/rgw_admin.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_admin.cc: prevent useless value assignment
Danny Al-Gaaf [Wed, 13 Feb 2013 14:42:58 +0000 (15:42 +0100)]
rgw/rgw_admin.cc: prevent useless value assignment

Fix issue found by cppcheck:
[src/rgw/rgw_admin.cc:710] -> [src/rgw/rgw_admin.cc:714]:
  (performance) Variable 'ret' is reassigned a value before
  the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Deal with this by moving the declaration to where we define
the value for a couple variables.

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agorbd.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:38:58 +0000 (15:38 +0100)]
rbd.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorados.cc: use omap.empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:36:29 +0000 (15:36 +0100)]
rados.cc: use omap.empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdmaptool.cc: : use empty() instead of 'size() < 1'
Danny Al-Gaaf [Wed, 13 Feb 2013 14:34:05 +0000 (15:34 +0100)]
osdmaptool.cc: : use empty() instead of 'size() < 1'

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

This way the code is more logical.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoObjecter.cc: prevent useless value assignment
Danny Al-Gaaf [Wed, 13 Feb 2013 14:30:19 +0000 (15:30 +0100)]
Objecter.cc: prevent useless value assignment

Fix issue found by cppcheck:
[src/osdc/Objecter.cc:989] -> [src/osdc/Objecter.cc:992]: (performance)
  Variable 'check_for_latest_map' is reassigned a value before the old
  one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix it by declaring at the first real definition.

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agoObjecter.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:29:03 +0000 (15:29 +0100)]
Objecter.cc: use !empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoObjectCacher.cc: use empty() instead of !size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:24:37 +0000 (15:24 +0100)]
ObjectCacher.cc: use empty() instead of !size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoReplicatedPG.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:21:48 +0000 (15:21 +0100)]
ReplicatedPG.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

This replaces also some size() >=/== checks.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoPG.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:18:55 +0000 (15:18 +0100)]
PG.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

This replaces also some size() >=/== checks.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoOSD.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 14:03:31 +0000 (15:03 +0100)]
OSD.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

This replaces also some size() >=/== checks.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoLFNIndex.cc: use !holes.empty() instead of 'size() > 0'
Danny Al-Gaaf [Wed, 13 Feb 2013 13:59:53 +0000 (14:59 +0100)]
LFNIndex.cc: use !holes.empty() instead of 'size() > 0'

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoHashIndex.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 13:58:45 +0000 (14:58 +0100)]
HashIndex.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoFileStore.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 13:56:03 +0000 (14:56 +0100)]
FileStore.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoDBObjectMap.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 13:51:28 +0000 (14:51 +0100)]
DBObjectMap.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomonmaptool.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 13:46:05 +0000 (14:46 +0100)]
monmaptool.cc: use empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoPGMonitor.cc: use !empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 13:42:47 +0000 (14:42 +0100)]
PGMonitor.cc: use !empty() instead of size() to check for emptiness

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoOSDMonitor.cc: use !empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 13:41:04 +0000 (14:41 +0100)]
OSDMonitor.cc: use !empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMonitor.cc: use empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 13:38:28 +0000 (14:38 +0100)]
Monitor.cc: use empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

warning from cppcheck was:
[src/mon/Monitor.cc:487]: (performance) Possible inefficient
  checking for 'initial_members' emptiness.
[src/mon/Monitor.cc:1361]: (performance) Possible inefficient
  checking for 'timecheck_skews' emptiness.
[src/mon/Monitor.cc:2302]: (performance) Possible inefficient
  checking for 'timecheck_waiting' emptiness.
[src/mon/Monitor.cc:2547]: (performance) Possible inefficient
  checking for 'timecheck_waiting' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMonCaps.cc: use !empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 13:34:26 +0000 (14:34 +0100)]
MonCaps.cc: use !empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoOSDMonitor.h: use !reporters.empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 13:10:21 +0000 (14:10 +0100)]
OSDMonitor.h: use !reporters.empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Using empty() in this case makes the code more logical.

warning from cppcheck was:

[src/mon/OSDMonitor.h:59]: (performance) Possible inefficient
  checking for 'reporters' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoAuthMonitor.cc: use !pending_auth.empty() instead of 'size() > 0'
Danny Al-Gaaf [Wed, 13 Feb 2013 12:56:48 +0000 (13:56 +0100)]
AuthMonitor.cc: use !pending_auth.empty() instead of 'size() > 0'

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

warning from cppcheck was:
[src/mon/AuthMonitor.cc:210]: (performance) Possible inefficient
  checking for 'pending_auth' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoCInode.h: use !old_inodes.empty() instead of size()
Danny Al-Gaaf [Wed, 13 Feb 2013 12:52:44 +0000 (13:52 +0100)]
CInode.h: use !old_inodes.empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

warning from cppcheck was:
[src/mds/journal.cc:470]: (performance) Possible inefficient
  checking for 'old_inodes' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoCephxProtocol.h: pass CryptoKey by reference to decode_decrypt()
Danny Al-Gaaf [Wed, 13 Feb 2013 12:14:02 +0000 (13:14 +0100)]
CephxProtocol.h: pass CryptoKey by reference to decode_decrypt()

Fix issues found by cppcheck:

[src/auth/cephx/CephxProtocol.h:469]: (performance) Function
  parameter 'key' should be passed by reference.

Pass CryptoKey by reference as already done in encode_encrypt().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/PG: initialize info_struct_v in ctor
Sage Weil [Wed, 13 Feb 2013 05:20:20 +0000 (21:20 -0800)]
osd/PG: initialize info_struct_v in ctor

Otherwise we randomly assert on the first write_info() for newly created
PGs.  Introduced by 188f3ea6867eeb6e950f6efed18d53ff17522bbc.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: clarified ceph id vs. ceph name, and fixed a typo.
John Wilkins [Wed, 13 Feb 2013 01:53:02 +0000 (17:53 -0800)]
doc: clarified ceph id vs. ceph name, and fixed a typo.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoMerge branch 'next'
Josh Durgin [Wed, 13 Feb 2013 00:55:32 +0000 (16:55 -0800)]
Merge branch 'next'

Conflicts:
src/include/ceph_features.h

12 years agoosd/PG: store pg_info_t in leveldb (omap), purged_snaps separately
David Zafman [Mon, 11 Feb 2013 20:20:23 +0000 (12:20 -0800)]
osd/PG: store pg_info_t in leveldb (omap), purged_snaps separately

Separate the purged_snaps portion of pg_info_t (the one that gets big).

Feature #3891: osd: move purged_snaps out of info

Add a separate dirty_big_info flag so that we only update the pginfo
"biginfo" file if that state changes.  This lets us avoid the cost in the
general case, like a regular PG write.

Add LEVELDBINFO feature

Put info, biginfo in leveldb
Move epoch to omap

Feature #3892: osd: move pg info into leveldb

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
12 years agodoc: Added some of the troubleshooting steps into the libvirt procedure and removed...
John Wilkins [Wed, 13 Feb 2013 01:12:41 +0000 (17:12 -0800)]
doc: Added some of the troubleshooting steps into the libvirt procedure and removed path for virsh edit.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agolibrbd: unprotect any non-unprotected snapshot
Josh Durgin [Tue, 12 Feb 2013 01:08:55 +0000 (17:08 -0800)]
librbd: unprotect any non-unprotected snapshot

Include snapshots in the UNPROTECTING state as well, which can occur
after an unprotect is interrupted.

Fixes: #4100
Backport: bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agodeb: Add ceph-coverage to ceph-test deb package
Sam Lang [Tue, 12 Feb 2013 17:32:29 +0000 (11:32 -0600)]
deb:  Add ceph-coverage to ceph-test deb package

Teuthology uses the ceph-coverage script extensively
and expects it to be installed by the ceph task.  Add
the script to the ceph-test debian package so that it
gets installed for that use case.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: Setting pool on a file requires latest osdmap
Sam Lang [Tue, 12 Feb 2013 22:33:58 +0000 (16:33 -0600)]
mds: Setting pool on a file requires latest osdmap

If we create a file, then create a pool, then try to
set the pool on the file with the vxattr, no mds operation
triggers a request for the latest osdmap, so we get back
EINVAL.  So if we fail to find the pool initially, fall back
to requesting a new osdmap and trying the vxattr again.  We
don't wait for a new map if we don't get anything newer than
what we already have.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomds: Add retry field to MDRequest
Sam Lang [Tue, 12 Feb 2013 22:33:19 +0000 (16:33 -0600)]
mds:  Add retry field to MDRequest

The MDRequest can be retried via the RetryRequest finisher,
we add a retry field that gets incremented before each
retry in the finisher.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoqa/workunits: Add vxattr set pool test script
Sam Lang [Mon, 11 Feb 2013 22:13:07 +0000 (16:13 -0600)]
qa/workunits:  Add vxattr set pool test script

Add a test script that tests for creating a pool
and then setting the layout for a (pre-existing)
file to that pool.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agocephtool: Add add_data_pool command to help
Sam Lang [Mon, 11 Feb 2013 22:12:15 +0000 (16:12 -0600)]
cephtool:  Add add_data_pool command to help

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomsg/Messenger: rename option
Sage Weil [Tue, 12 Feb 2013 22:18:24 +0000 (14:18 -0800)]
msg/Messenger: rename option

It's unhandled, not unexpected.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #50 from dalgaaf/wip-da-sca-clang-overloaded-virt-2
Gregory Farnum [Tue, 12 Feb 2013 22:17:57 +0000 (14:17 -0800)]
Merge pull request #50 from dalgaaf/wip-da-sca-clang-overloaded-virt-2

mds/LogEvent.h: change print() signature to const

12 years agoosd: only share maps on hb connection of OSD_HBMSGS feature is set
Sage Weil [Tue, 12 Feb 2013 22:11:09 +0000 (14:11 -0800)]
osd: only share maps on hb connection of OSD_HBMSGS feature is set

Back in 1bc419a7affb056540ba8f9b332b6ff9380b37af we started sharing maps
with dead osds via the heartbeat connection, but old code will crash on an
unexpected message.  Only do this if the OSD_HBMSGS feature is present.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoosd: tolerate unexpected messages on the heartbeat interface
Sage Weil [Tue, 12 Feb 2013 22:10:51 +0000 (14:10 -0800)]
osd: tolerate unexpected messages on the heartbeat interface

We should note but not crash on unexpected messages.  Announce this awesome
new "capability" via a feature bit.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agomsg/Messenger: do not crash on unhandled message
Sage Weil [Tue, 12 Feb 2013 21:52:09 +0000 (13:52 -0800)]
msg/Messenger: do not crash on unhandled message

This is just polite.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years ago.gitignore: fix ceph_filestore_dump name
Sage Weil [Tue, 12 Feb 2013 16:29:29 +0000 (08:29 -0800)]
.gitignore: fix ceph_filestore_dump name

Underscores!

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoRevert "Makefile: name binary ceph-filestore-dump"
Sage Weil [Tue, 12 Feb 2013 16:28:31 +0000 (08:28 -0800)]
Revert "Makefile: name binary ceph-filestore-dump"

This reverts commit f0b2e32af69d7d009837832066a1445c45bbc362.

Be consistent with everything else.

12 years agomds/LogEvent.h: change print() signature to const 50/head
Danny Al-Gaaf [Tue, 12 Feb 2013 21:17:38 +0000 (22:17 +0100)]
mds/LogEvent.h: change print() signature to const

Fix print() function of src/mds/LogEvent.h, declare as

virtual void print(ostream& out) const {...}

Adapt functions of derived classes. This should fix a problem
with print function of derived classes EImportStart and
EImportFinish, which had a const signature, hiding virtual
function of the base class LogEvent (which wasn't const).

Fix -Woverloaded-virtual warning from clang was:

mds/events/EImportStart.h:43:8: warning: 'EImportStart::print'
 hides overloaded virtual function [-Woverloaded-virtual]
  void print(ostream& out) const {
       ^
mds/events/../LogEvent.h:95:16: note: hidden overloaded virtual
 function 'LogEvent::print' declared here
  virtual void print(ostream& out) {
               ^
In file included from mds/journal.cc:31:
mds/events/EImportFinish.h:35:8: warning: 'EImportFinish::print'
 hides overloaded virtual function [-Woverloaded-virtual]
  void print(ostream& out) const {
       ^
mds/events/../LogEvent.h:95:16: note: hidden overloaded
 virtual function 'LogEvent::print' declared here
  virtual void print(ostream& out) {

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomodified the perl file name
tamil [Tue, 12 Feb 2013 18:55:27 +0000 (10:55 -0800)]
modified the perl file name
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agoMerge branch 'wip-4064-sam'
Samuel Just [Tue, 12 Feb 2013 18:15:26 +0000 (10:15 -0800)]
Merge branch 'wip-4064-sam'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoFileStore: set replay guard on create_collection
Samuel Just [Mon, 11 Feb 2013 20:52:07 +0000 (12:52 -0800)]
FileStore: set replay guard on create_collection

This should prevent sequences like:

rmcoll a
mkcoll a
touch a foo
<crash>

from causing trouble by preventing the rmcoll
and mkcoll from being replayed.

Fixes: 4064
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: _split_collection should not create the collection
Samuel Just [Mon, 11 Feb 2013 20:24:14 +0000 (12:24 -0800)]
FileStore: _split_collection should not create the collection

This will simplify adding a replay guard to create_collection.

Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoos/FileStore: do not tolerate ENOENT on collection_add
Sage Weil [Mon, 11 Feb 2013 03:52:13 +0000 (19:52 -0800)]
os/FileStore: do not tolerate ENOENT on collection_add

If we get ENOENT on a collection_add that is a bad thing; do not ignore
the error.  This was hiding #4071 for some time.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: make coll_t::is_pg() correctly validate the snapid suffix
Sage Weil [Sun, 10 Feb 2013 05:36:58 +0000 (21:36 -0800)]
osd: make coll_t::is_pg() correctly validate the snapid suffix

The strtoull() man page suggests resetting errno and using that to
check for a parsing error.  This ensures the OSD::load_pgs() callers are
getting what they expect (now that they aren't relying on the broken
behavior).  The other callers in the os/* code is moved to a different
method that ignores the suffix.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoos: use coll_t:is_pg_prefix() check instead of is_pg()
Sage Weil [Sun, 10 Feb 2013 05:34:02 +0000 (21:34 -0800)]
os: use coll_t:is_pg_prefix() check instead of is_pg()

The objectstore code was trying to parse out a pgid from the collection
name and using the is_pg() helper, which incorrectly tolerates a _TEMP
suffix and returns a bad value for the snapid.  The objectstore doesn't
actually care about that value, so this is harmless, but sloppy.

Introduce a simpler is_pg_prefix() helper and use that instead.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Removed legacy comment regarding Keystone integration.
John Wilkins [Tue, 12 Feb 2013 17:54:07 +0000 (09:54 -0800)]
doc: Removed legacy comment regarding Keystone integration.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added link to <disk> reference. Added minor clarifications.
John Wilkins [Tue, 12 Feb 2013 17:53:17 +0000 (09:53 -0800)]
doc: Added link to <disk> reference. Added minor clarifications.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoceph-filestore-dump: Improve error message
David Zafman [Fri, 8 Feb 2013 07:39:11 +0000 (23:39 -0800)]
ceph-filestore-dump: Improve error message

Fix error message when encountering already in use
OSD store.

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge branch 'wip-mds-encode-rebased'
Greg Farnum [Tue, 12 Feb 2013 06:02:33 +0000 (22:02 -0800)]
Merge branch 'wip-mds-encode-rebased'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMakefile: name binary ceph-filestore-dump
Sage Weil [Tue, 12 Feb 2013 04:49:03 +0000 (20:49 -0800)]
Makefile: name binary ceph-filestore-dump

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Added procedures for using libvirt VMs with Ceph.
John Wilkins [Tue, 12 Feb 2013 03:44:55 +0000 (19:44 -0800)]
doc: Added procedures for using libvirt VMs with Ceph.

fixes: #3432

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years ago.gitignore: fix typo and missing vstart.sh output
Josh Durgin [Tue, 12 Feb 2013 02:38:06 +0000 (18:38 -0800)]
.gitignore: fix typo and missing vstart.sh output

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agowork unit for rbd cli tests
tamil [Tue, 12 Feb 2013 02:11:26 +0000 (18:11 -0800)]
work unit for rbd cli tests
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agoadded new cli tests
tamil [Tue, 12 Feb 2013 01:24:50 +0000 (17:24 -0800)]
added new cli tests
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Tue, 12 Feb 2013 01:12:22 +0000 (17:12 -0800)]
Merge remote-tracking branch 'gh/next'

12 years agoosd: update snap collections for sub_op_modify log records conditionaly
Sage Weil [Mon, 11 Feb 2013 14:23:54 +0000 (06:23 -0800)]
osd: update snap collections for sub_op_modify log records conditionaly

The only remaining caller is sub_op_modify().  If we do have a non-empty
op transaction, we want to do this update, regardless of what we think
last_backfill is (our notion may be not completely in sync with the
primary).  In particular, our last_backfill may be the same object but
a different snapid, but the primary disagrees and is pushing an op
transaction through.

Instead, update the collections if we have a non-empty transaction.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoosd: include snaps in pg_log_entry_t::dump()
Sage Weil [Mon, 11 Feb 2013 01:02:45 +0000 (17:02 -0800)]
osd: include snaps in pg_log_entry_t::dump()

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoosd: unconditionally encode snaps buffer
Sage Weil [Mon, 11 Feb 2013 00:59:48 +0000 (16:59 -0800)]
osd: unconditionally encode snaps buffer

Previously we would only encode the updated snaps vector for CLONE ops.
This doesn't work for MODIFY ops generated by the snap trimmer, which
may also adjust the clone collections.  It is also possible that other
operations may need to populate this field in the future (e.g.,
LOST_REVERT may, although it currently does not).

Fixes: #4071, and possibly #4051.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoosd: improve debug output on snap collections
Sage Weil [Sun, 10 Feb 2013 18:57:12 +0000 (10:57 -0800)]
osd: improve debug output on snap collections

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoRevert "rgw: plain format always appends eol to data"
Yehuda Sadeh [Mon, 11 Feb 2013 19:30:02 +0000 (11:30 -0800)]
Revert "rgw: plain format always appends eol to data"

This commit breaks the swift unit test. The reason is that it
makes it so that returned error status ends with eol, which
is not as expected.

This reverts commit c31aff5f9f0b9fe4ada6b259dd1f424627b3e875.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-da-rename-ceph-test'
Josh Durgin [Mon, 11 Feb 2013 19:02:16 +0000 (11:02 -0800)]
Merge branch 'wip-da-rename-ceph-test'

12 years agolibcephfs: fix for #4068
Joe Buck [Sun, 10 Feb 2013 02:48:57 +0000 (18:48 -0800)]
libcephfs: fix for #4068

If client->init() fails in mount, then client->shutdown()
should not be called. This patch uses a bool to ensure
that shutdown is only called if init() succeeds.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #47 from dalgaaf/wip-da-sca-cppcheck-clang-2
Sage Weil [Mon, 11 Feb 2013 17:43:31 +0000 (09:43 -0800)]
Merge pull request #47 from dalgaaf/wip-da-sca-cppcheck-clang-2

fix more issues from clang(++) and cppchecker

Reviewed-by: Sage Weil <sage@inktank.com>
12 years ago.gitignore: add local ones for ocf and man
Josh Durgin [Mon, 11 Feb 2013 17:08:01 +0000 (09:08 -0800)]
.gitignore: add local ones for ocf and man

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa/rbd: +x on map-snapshot-io.sh
Sage Weil [Mon, 11 Feb 2013 16:48:44 +0000 (08:48 -0800)]
qa/rbd: +x on map-snapshot-io.sh

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest: fix run-rbd-tests
Josh Durgin [Mon, 11 Feb 2013 16:04:47 +0000 (08:04 -0800)]
test: fix run-rbd-tests

The python tests were not renamed

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years ago.gitignore: re-add vstart dirs and tags, fix typo
Josh Durgin [Mon, 11 Feb 2013 16:04:01 +0000 (08:04 -0800)]
.gitignore: re-add vstart dirs and tags, fix typo

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMutex.cc: fix implicitly-defined namespace 'std' 47/head
Danny Al-Gaaf [Mon, 11 Feb 2013 15:47:58 +0000 (16:47 +0100)]
Mutex.cc: fix implicitly-defined namespace 'std'

Fix warning from clang(++):

common/Mutex.cc:14:17: warning: using directive refers to
  implicitly-defined namespace 'std'
using namespace std;
                ^

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoceph_authtool.cc: fix implicitly-defined namespace 'std'
Danny Al-Gaaf [Mon, 11 Feb 2013 15:42:27 +0000 (16:42 +0100)]
ceph_authtool.cc: fix implicitly-defined namespace 'std'

Fix warning from clang(++):

ceph_authtool.cc:15:17: warning: using directive refers to
 implicitly-defined namespace 'std'
using namespace std;
                ^
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrados/librados.cc: fix implicitly-defined namespace 'std'
Danny Al-Gaaf [Thu, 7 Feb 2013 19:36:15 +0000 (20:36 +0100)]
librados/librados.cc: fix implicitly-defined namespace 'std'

Fix warning from clang(++):

librados/librados.cc:15:17: warning: using directive refers to
 implicitly-defined namespace 'std'
using namespace std;
                ^
Include what we need and use the related classes.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_mon_workloadgen.cc: fix -Wgnu
Danny Al-Gaaf [Thu, 7 Feb 2013 19:19:03 +0000 (20:19 +0100)]
test_mon_workloadgen.cc: fix -Wgnu

Fix warning from clang(++):

 test/mon/test_mon_workloadgen.cc:311:23: warning: in-class
 initializer for static data member of type 'const double' is
 a GNU extension [-Wgnu]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/osd/PG.h: use empty() instead of size()
Danny Al-Gaaf [Thu, 7 Feb 2013 19:16:46 +0000 (20:16 +0100)]
src/osd/PG.h: use empty() instead of size()

Fix warning for usage of objects.size(). Use empty() since it
should be prefered as it has, following the standard, a constant
time complexity regardless of the containter type. The same is not
guaranteed for size().

warning from cppchecker was:
[osd/PG.h:599]: (performance) Possible inefficient checking for
  'objects' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/osd/OSD.h: use empty() instead of size()
Danny Al-Gaaf [Thu, 7 Feb 2013 19:14:34 +0000 (20:14 +0100)]
src/osd/OSD.h: use empty() instead of size()

Fix warning for usage of *.size(). Use empty() since it should be
prefered as it has, following the standard, a constant time
complexity regardless of the containter type. The same is not
guaranteed for size().

warning from cppchecker was:
[osd/OSD.h:265]: (performance) Possible inefficient checking for
   'last_scrub_pg' emptiness.
[osd/OSD.h:274]: (performance) Possible inefficient checking for
   'last_scrub_pg' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/msg/Messenger.h: pass function parameter by reference
Danny Al-Gaaf [Thu, 7 Feb 2013 19:13:28 +0000 (20:13 +0100)]
src/msg/Messenger.h: pass function parameter by reference

Fix "(performance) Function parameter 'm' should be passed by reference."
from cppchecker.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/mon/PGMonitor.cc: remove unused variable
Danny Al-Gaaf [Thu, 7 Feb 2013 19:09:23 +0000 (20:09 +0100)]
src/mon/PGMonitor.cc: remove unused variable

Remove unused variable to fix:

mon/PGMonitor.cc:170:11: warning: unused variable 'now'
  [-Wunused-variable]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>