Commit Graph

24184 Commits

Author SHA1 Message Date
Danny Al-Gaaf
18348857c4 test_filejournal.cc: use empty() to check for emptiness
Use !empty() instead of size() to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
f9bf1275d0 src/test/osd/RadosModel.h: use empty() to check for emptiness
Use empty() instead of size() to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
37bb45f29a test_mon_workloadgen.cc: use empty() to check for emptiness
Use empty() instead of '!size()' and "size() == 0" to check for emptiness
for performance reasons and since it's more logical.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
f923be5d43 TestFileStoreState.cc: use empty() to check for emptiness
Use empty() instead of '!size()' to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
47413b3df6 FileStoreTracker.cc: use empty() to check for emptiness
Use !empty() instead of size() to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
9da963efda test_object_map.cc: use empty() to check for emptiness
Use !empty() instead of 'size()' to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
e551dd4c5d test_keyvaluedb_iterators.cc: use empty() to check for emptiness
Use !empty() instead of 'size() > 0' to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
a8614b86c7 scratchtoolpp.cc: print some more results
Print some more results to fix issue found by cppcheck:

[src/scratchtoolpp.cc:111] -> [src/scratchtoolpp.cc:114]:
  (performance) Variable 'r' is reassigned a value before
  the old one has been used.
[src/scratchtoolpp.cc:207] -> [src/scratchtoolpp.cc:208]:
  (performance) Variable 'r' is reassigned a value before
  the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
e2af5b3e5f rgw/rgw_user.cc: use empty() to check for emptiness
Use !empty() instead of 'size()' to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
a30017fbb9 rgw/rgw_usage.cc use empty() to check for emptiness
Use !empty() instead of 'size()' to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:40 -08:00
Danny Al-Gaaf
b14994e51b rgw/rgw_rest_swift.cc: don't pass c_str() result to std::string argument
Fix issue found by cppcheck:
[src/rgw/rgw_rest_swift.cc:770]: (performance) Passing the result of
  c_str() to a function that takes std::string as argument no. 1 is
  slow and redundant.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
dfe1b45237 rgw/rgw_rados.cc: : use empty() to check for emptiness
Use empty() instead of '!size()' for performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
005fe42cbe rgw/rgw_op.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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
e980d52c46 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
6044083920 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
f244fd731a 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
e57d9913f7 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
aa2ae6a269 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
1755fd9715 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
3ed962be8c 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
a65c71cae3 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
d0896404a9 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
4c11a5d135 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>
2013-02-14 10:27:39 -08:00
Danny Al-Gaaf
15248ae12b 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
fc0a108773 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
30fe1077a8 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
f4cae00052 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
d6c4a62fc8 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
e719e0a286 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
810d23e92f 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
c4f1c0799f 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
fb811ecff8 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
59f8c8d8ec 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
338e168015 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>
2013-02-14 10:27:38 -08:00
Danny Al-Gaaf
8c1cb21598 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>
2013-02-14 10:26:22 -08:00
Danny Al-Gaaf
c115bdb495 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>
2013-02-14 10:26:22 -08:00
Danny Al-Gaaf
95eda3267d 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>
2013-02-14 10:26:22 -08:00
Danny Al-Gaaf
4950a1b3b8 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>
2013-02-14 10:26:22 -08:00
Danny Al-Gaaf
fb6561e742 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>
2013-02-14 10:19:53 -08:00
Sage Weil
e259f3c8e5 Merge pull request #57 from dalgaaf/wip-da-mkcephfs-init-2
Fix some init/mkcephfs related issues

Reviewed-by: Sage Weil <sage@inktank.com>
2013-02-14 09:22:20 -08:00
Danny Al-Gaaf
d029b936bb init-ceph.in: replace "/var/run/" by already used $RUN_DIR
Fix handling of admin socket. The current script already use
$RUN_DIR to define a default, which is /var/run. Replace the
explicit path from get_conf call and replace it with $RUN_DIR.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 18:12:30 +01:00
Danny Al-Gaaf
aa4cae66f0 ceph_common.sh: check if $sshdir exist, otherwise create it
Check if $sshdir exist. If not, create it before cd to the
directory.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 18:12:30 +01:00
Danny Al-Gaaf
97c6ce0a2e init-ceph.in: create pid and log dir only on start
Create pid and log dir only on start and not e.g. also on
stop. These calls are useless in other situtations than startup
the cluster or process.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 18:12:30 +01:00
Sage Weil
ffbc085de1 Merge pull request #53 from dachary/wip-4123
fix buffer::list::zero(unsigned o, unsigned l) to act on all buffer::ptr

Backport: bobtail
Reviewed-by: Sage Weil <sage@inktank.com>
2013-02-14 09:07:02 -08:00
Sage Weil
6365ded412 Merge pull request #54 from javacruft/wip-pthread-linking
LDADD PTHREAD_LIBS to fix librados-config linking

Reviewed-by: Sage Weil <sage@inktank.com>
2013-02-14 09:01:49 -08:00
Sage Weil
e31baeeb5e Merge pull request #56 from trhoden/doc_cephx
Make cephx key creation syntax consistent

Reviewed-by: Sage Weil <sage@inktank.com>
2013-02-14 09:01:06 -08:00
Sage Weil
c4306cb94f Merge pull request #55 from dalgaaf/wip-da-cleanup-specfile
Cleanup some requirements of spec file

Reviewed-by: Sage Weil <sage@inktank.com>
2013-02-14 08:56:54 -08:00
Travis Rhoden
7eefe0b7d8 doc: Update create example to use 'allow ' syntax
The ceph auth get-or-create example here is the only place on the
page that does not use 'allow <perms.' syntax.  I found that
confusing.  Update to use allow and single quotes.

Signed-off-by: Travis Rhoden <trhoden@gmail.com>
2013-02-14 11:23:52 -05:00
Travis Rhoden
51a0a220c1 doc: Move pool=... syntax inside of single quotes
When specifying caps, the entire 'allow ...' bit needs to be in the
single quotes, including the pool= part.

Signed-off-by: Travis Rhoden <trhoden@gmail.com>
2013-02-14 11:19:20 -05:00
Danny Al-Gaaf
01f82b842b ceph.spec.in: remove librados2 requirement from librbd1
Remove librados2 requirement from librbd1. The RPM build system
will find the dependency by itself.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-14 15:27:00 +01:00