]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoMerge remote-tracking branch 'gh/wip-deploy'
Sage Weil [Sat, 16 Feb 2013 17:39:34 +0000 (09:39 -0800)]
Merge remote-tracking branch 'gh/wip-deploy'

Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Sat, 16 Feb 2013 01:21:42 +0000 (17:21 -0800)]
Merge branch 'next'

12 years agoMerge remote-tracking branch 'upstream/wip-4075'
Samuel Just [Sat, 16 Feb 2013 00:53:40 +0000 (16:53 -0800)]
Merge remote-tracking branch 'upstream/wip-4075'

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge pull request #62 from dalgaaf/wip-da-sca-cppcheck-performance-3
Sage Weil [Sat, 16 Feb 2013 00:26:58 +0000 (16:26 -0800)]
Merge pull request #62 from dalgaaf/wip-da-sca-cppcheck-performance-3

More performance patches

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoqa: rbd/map-snapshat-io: unmap image when done
Sage Weil [Sat, 16 Feb 2013 00:26:16 +0000 (16:26 -0800)]
qa: rbd/map-snapshat-io: unmap image when done

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk-prepare: always force mkfs.xfs
Alexandre Marangone [Fri, 15 Feb 2013 20:24:01 +0000 (12:24 -0800)]
ceph-disk-prepare: always force mkfs.xfs

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
12 years agoudev: trigger on dmcrypted osd partitions
Sage Weil [Thu, 14 Feb 2013 02:22:45 +0000 (18:22 -0800)]
udev: trigger on dmcrypted osd partitions

Automatically map encrypted journal partitions.

For encrypted OSD partitions, map them, wait for the mapped device to
appear, and then ceph-disk-activate.

This is much simpler than doing the work in ceph-disk-activate.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk-prepare: add initial support for dm-crypt
Sage Weil [Wed, 13 Feb 2013 05:35:56 +0000 (21:35 -0800)]
ceph-disk-prepare: add initial support for dm-crypt

Keep keys in /etc/ceph/dmcrypt-keys.

Identify partition instances by the partition UUID.  Identify encrypted
partitions by a parallel set of type UUIDs.

Signed-off-by: Alexandre Marangone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk-activate: pull mount options from ceph.conf
Alexandre Marangone [Fri, 15 Feb 2013 20:22:33 +0000 (12:22 -0800)]
ceph-disk-activate: pull mount options from ceph.conf

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
12 years agoceph-disk-activate: use full paths for everything
Sage Weil [Fri, 15 Feb 2013 01:05:32 +0000 (17:05 -0800)]
ceph-disk-activate: use full paths for everything

We are run from udev, which doesn't get a decent PATH.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk-prepare: do partprobe after setting final partition type
Sage Weil [Fri, 15 Feb 2013 01:04:55 +0000 (17:04 -0800)]
ceph-disk-prepare: do partprobe after setting final partition type

This is necessary to kick udev into processing the updated partition and
running its rules.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoReplicatedPG: handle missing set even for old format
Samuel Just [Fri, 15 Feb 2013 21:52:37 +0000 (13:52 -0800)]
ReplicatedPG: handle missing set even for old format

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoqa: rbd/map-snapshot-io.sh: chown rbd device stuff
Sage Weil [Fri, 15 Feb 2013 21:57:47 +0000 (13:57 -0800)]
qa: rbd/map-snapshot-io.sh: chown rbd device stuff

This is fugly, but sudo -E doesn't work.  Fix this after we are installing
debs and the path doesn't matter anymore!

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocls/lock/cls_lock.cc: use !lockers.empty() instead of size() 62/head
Danny Al-Gaaf [Tue, 12 Feb 2013 17:51:51 +0000 (18:51 +0100)]
cls/lock/cls_lock.cc: use !lockers.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 cppchecker was:
[src/cls/lock/cls_lock.cc:209]: (performance) Possible inefficient
  checking for 'lockers' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/client/SyntheticClient.cc: use !subdirs.empty() instead of size()
Danny Al-Gaaf [Tue, 12 Feb 2013 17:48:50 +0000 (18:48 +0100)]
src/client/SyntheticClient.cc: use !subdirs.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 cppchecker was:
[src/client/SyntheticClient.cc:2706]: (performance) Possible
  inefficient checking for 'subdirs' emptiness

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoclient/Client.cc: use empty() instead of size()
Danny Al-Gaaf [Tue, 12 Feb 2013 17:44:04 +0000 (18:44 +0100)]
client/Client.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 cppchecker was:
[src/client/Client.cc:3649]: (performance) Possible inefficient
  checking for 'mds_sessions' emptiness.
[src/client/Client.cc:7489]: (performance) Possible inefficient
  checking for 'osds' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDSMap.h: use up.empty() instead of up.size()
Danny Al-Gaaf [Tue, 12 Feb 2013 16:41:04 +0000 (17:41 +0100)]
mds/MDSMap.h: use up.empty() instead of up.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:
[src/mds/MDSMap.h:448]: (performance) Possible inefficient
  checking for 'up' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CDentry.h: use projected.empty() instead of projected.size()
Danny Al-Gaaf [Tue, 12 Feb 2013 16:25:00 +0000 (17:25 +0100)]
mds/CDentry.h: use projected.empty() instead of projected.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:
[src/mds/CDentry.h:234]: (performance) Possible inefficient
  checking for 'projected' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoceph_authtool.cc: use empty() instead of size()
Danny Al-Gaaf [Tue, 12 Feb 2013 16:20:19 +0000 (17:20 +0100)]
ceph_authtool.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 cppchecker was:
[src/ceph_authtool.cc:124]: (performance) Possible inefficient
  checking for 'caps' emptiness.
[src/ceph_authtool.cc:237]: (performance) Possible inefficient
  checking for 'caps' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoOSD: add leveldblog compatibility flag for OSD
Samuel Just [Fri, 15 Feb 2013 19:07:40 +0000 (11:07 -0800)]
OSD: add leveldblog compatibility flag for OSD

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: verify log versions during read_log
Samuel Just [Fri, 15 Feb 2013 01:45:35 +0000 (17:45 -0800)]
PG: verify log versions during read_log

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: write_log if we read an old-format log
Samuel Just [Fri, 15 Feb 2013 01:29:46 +0000 (17:29 -0800)]
PG: write_log if we read an old-format log

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd: move pg log into leveldb
David Zafman [Fri, 8 Feb 2013 22:43:50 +0000 (14:43 -0800)]
osd: move pg log into leveldb

log from wip-pginfo
Fix bugs in PG::read_log() handling
Eliminate compiler warnings

Feature #4075: osd: move pg log into leveldb

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: David Zafman <david.zafman@inktank.com>
12 years agoqa: pull qa stuff from ceph.com ceph.git mirror
Sage Weil [Fri, 15 Feb 2013 17:20:14 +0000 (09:20 -0800)]
qa: pull qa stuff from ceph.com ceph.git mirror

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: radosgw: document config without 100-continue and custom fastcgi
Sage Weil [Fri, 15 Feb 2013 17:02:12 +0000 (09:02 -0800)]
doc: radosgw: document config without 100-continue and custom fastcgi

Reported-by: carsonoid on github
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoconfig: Add small note about default number of PGs
Wido den Hollander [Sat, 9 Feb 2013 19:55:48 +0000 (20:55 +0100)]
config: Add small note about default number of PGs

It's still not clear to end users this should go into the
mon or global section of ceph.conf

Until this gets resolved document it here as well for the people
who look up their settings in the source code.

Signed-off-by: Wido den Hollander <wido@42on.com>
12 years agoMerge remote-tracking branch 'origin/wip-hadoop-docs'
Noah Watkins [Fri, 15 Feb 2013 16:55:28 +0000 (08:55 -0800)]
Merge remote-tracking branch 'origin/wip-hadoop-docs'

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoMerge pull request #59 from dalgaaf/wip-da-add-errorhandling
Sage Weil [Fri, 15 Feb 2013 16:54:57 +0000 (08:54 -0800)]
Merge pull request #59 from dalgaaf/wip-da-add-errorhandling

add error handling to test_sync_*.c

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Fri, 15 Feb 2013 16:48:37 +0000 (08:48 -0800)]
Merge remote-tracking branch 'gh/next'

12 years agotest_sync_io.c: add error handling 59/head
Danny Al-Gaaf [Tue, 12 Feb 2013 15:48:15 +0000 (16:48 +0100)]
test_sync_io.c: add error handling

Add error handling for open(), posix_memalign() and malloc().
Reuse code for read_* and write_* functions.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_short_dio_read.c: add error handling
Danny Al-Gaaf [Tue, 12 Feb 2013 16:01:49 +0000 (17:01 +0100)]
test_short_dio_read.c: add error handling

Add error handling for open() calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agodoc: update rados troubleshooting for slow requests
Sage Weil [Fri, 15 Feb 2013 01:33:22 +0000 (17:33 -0800)]
doc: update rados troubleshooting for slow requests

The example was out of date.  Adding a note about how to look at the request
queue on the OSD.

Reported-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd/OSDCap: add unit test for parsing pools/objects with _ and -
Sage Weil [Thu, 14 Feb 2013 19:37:57 +0000 (11:37 -0800)]
osd/OSDCap: add unit test for parsing pools/objects with _ and -

Hunting #4122, where a user saw

2013-02-13 19:39:25.467916 7f766fdb4700 10 osd.0 10  session 0x2c8cc60 client.libvirt has caps osdcap[grant(object_prefix rbd^@children  class-read),grant(pool libvirt^@pool^@test rwx)] 'allow class-read object_prefix rbd_children, allow pool libvirt-pool-test rwx'

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 2ce28ef1d7f95e71e1043912dfa269ea3b0d1599)

12 years agoosd/OSDCap: tweak unquoted_word parsing in osd caps
Sage Weil [Thu, 14 Feb 2013 23:39:43 +0000 (15:39 -0800)]
osd/OSDCap: tweak unquoted_word parsing in osd caps

Newer versions of spirit (1.49.0-3.1ubuntu1.1 in quantal, in particular)
dislike the construct with alnum and replace the - and _ with '\0' in the
resulting string.

Fixes: #4122
Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSD: always activate_map in advance_pgs, only send messages if up
Samuel Just [Thu, 14 Feb 2013 22:03:56 +0000 (14:03 -0800)]
OSD: always activate_map in advance_pgs, only send messages if up

We should always handle_activate_map() after handle_advance_map() in
order to kick the pg into a valid peering state for processing requests
prior to dropping the lock.

Additionally, we would prefer to avoid sending irrelevant messages
during boot, so only send if we are up according to the current service
osdmap.

Fixes: #4064
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoosd/OSDCap: add unit test for parsing pools/objects with _ and -
Sage Weil [Thu, 14 Feb 2013 19:37:57 +0000 (11:37 -0800)]
osd/OSDCap: add unit test for parsing pools/objects with _ and -

Hunting #4122, where a user saw

2013-02-13 19:39:25.467916 7f766fdb4700 10 osd.0 10  session 0x2c8cc60 client.libvirt has caps osdcap[grant(object_prefix rbd^@children  class-read),grant(pool libvirt^@pool^@test rwx)] 'allow class-read object_prefix rbd_children, allow pool libvirt-pool-test rwx'

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: user can specify 'rgw port' to listen on a tcp port.
Guilhem Lettron [Wed, 6 Feb 2013 21:38:52 +0000 (22:38 +0100)]
rgw: user can specify 'rgw port' to listen on a tcp port.

'rgw socket path' overrides 'rgw port'.
An 'rgw host' can be set to listen on a specific ip (default is 0.0.0.0)

Signed-off-by: Guilhem Lettron <guilhem.lettron@youscribe.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agotest/filestore/chain_xattr: remove testfile; disable LOGFILE
Sage Weil [Thu, 14 Feb 2013 20:36:12 +0000 (12:36 -0800)]
test/filestore/chain_xattr: remove testfile; disable LOGFILE

These make the gitbuilder checks unhappy.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'master' of github.com:ceph/ceph
Greg Farnum [Thu, 14 Feb 2013 19:39:13 +0000 (11:39 -0800)]
Merge branch 'master' of github.com:ceph/ceph

12 years agoMerge branch 'wip-danny-perf-checks'
Greg Farnum [Thu, 14 Feb 2013 19:36:40 +0000 (11:36 -0800)]
Merge branch 'wip-danny-perf-checks'

12 years agoosd: log error when ondisk snap collections do not match
Sage Weil [Thu, 14 Feb 2013 19:34:04 +0000 (11:34 -0800)]
osd: log error when ondisk snap collections do not match

This way we notice when it happens instead of blindly moving on.

Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'origin/wip-mds-names'
Greg Farnum [Thu, 14 Feb 2013 19:31:30 +0000 (11:31 -0800)]
Merge remote-tracking branch 'origin/wip-mds-names'

12 years agoosd: fix read_log error/warning messages to mon
Sage Weil [Thu, 14 Feb 2013 18:44:31 +0000 (10:44 -0800)]
osd: fix read_log error/warning messages to mon

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #40 from dachary/master
Sage Weil [Thu, 14 Feb 2013 18:31:37 +0000 (10:31 -0800)]
Merge pull request #40 from dachary/master

Unit tests for chain_xattr.cc

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agowireshark/ceph/packet-ceph.c: fix some issues from cppcheck
Danny Al-Gaaf [Wed, 13 Feb 2013 18:22:43 +0000 (19:22 +0100)]
wireshark/ceph/packet-ceph.c: fix some issues from cppcheck

Fix some smaller performance related issues from cppcheck due to
"Variable '..xy..' is reassigned a value before the old one has been used.

Fix some indention.

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

Use empty() instead of 'size() == 0' or 'size() < 1' to check
for emptiness for performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotools/common.cc. use !empty() to check for non-emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 18:13:51 +0000 (19:13 +0100)]
tools/common.cc. use !empty() to check for non-emptiness

Use !empty() instead of size() to check for non-emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_filejournal.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 18:11:22 +0000 (19:11 +0100)]
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>
12 years agosrc/test/osd/RadosModel.h: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 18:09:40 +0000 (19:09 +0100)]
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>
12 years agotest_mon_workloadgen.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 18:07:33 +0000 (19:07 +0100)]
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>
12 years agoTestFileStoreState.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 18:03:13 +0000 (19:03 +0100)]
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>
12 years agoFileStoreTracker.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 18:01:12 +0000 (19:01 +0100)]
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>
12 years agotest_object_map.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:58:41 +0000 (18:58 +0100)]
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>
12 years agotest_keyvaluedb_iterators.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:55:54 +0000 (18:55 +0100)]
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>
12 years agoscratchtoolpp.cc: print some more results
Danny Al-Gaaf [Wed, 13 Feb 2013 17:53:20 +0000 (18:53 +0100)]
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>
12 years agorgw/rgw_user.cc: use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:47:54 +0000 (18:47 +0100)]
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>
12 years agorgw/rgw_usage.cc use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:45:31 +0000 (18:45 +0100)]
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>
12 years agorgw/rgw_rest_swift.cc: don't pass c_str() result to std::string argument
Danny Al-Gaaf [Wed, 13 Feb 2013 17:42:47 +0000 (18:42 +0100)]
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>
12 years agorgw/rgw_rados.cc: : use empty() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:40:23 +0000 (18:40 +0100)]
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>
12 years agorgw/rgw_op.cc: use empty() instead of size() to check for emptiness
Danny Al-Gaaf [Wed, 13 Feb 2013 17:22:37 +0000 (18:22 +0100)]
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>
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 agoMerge pull request #57 from dalgaaf/wip-da-mkcephfs-init-2
Sage Weil [Thu, 14 Feb 2013 17:22:20 +0000 (09:22 -0800)]
Merge pull request #57 from dalgaaf/wip-da-mkcephfs-init-2

Fix some init/mkcephfs related issues

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoinit-ceph.in: replace "/var/run/" by already used $RUN_DIR 57/head
Danny Al-Gaaf [Thu, 14 Feb 2013 13:36:37 +0000 (14:36 +0100)]
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>
12 years agoceph_common.sh: check if $sshdir exist, otherwise create it
Danny Al-Gaaf [Thu, 14 Feb 2013 12:47:02 +0000 (13:47 +0100)]
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>
12 years agoinit-ceph.in: create pid and log dir only on start
Danny Al-Gaaf [Thu, 14 Feb 2013 12:39:28 +0000 (13:39 +0100)]
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>
12 years agoMerge pull request #53 from dachary/wip-4123
Sage Weil [Thu, 14 Feb 2013 17:07:02 +0000 (09:07 -0800)]
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>
12 years agoMerge pull request #54 from javacruft/wip-pthread-linking
Sage Weil [Thu, 14 Feb 2013 17:01:49 +0000 (09:01 -0800)]
Merge pull request #54 from javacruft/wip-pthread-linking

LDADD PTHREAD_LIBS to fix librados-config linking

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #56 from trhoden/doc_cephx
Sage Weil [Thu, 14 Feb 2013 17:01:06 +0000 (09:01 -0800)]
Merge pull request #56 from trhoden/doc_cephx

Make cephx key creation syntax consistent

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #55 from dalgaaf/wip-da-cleanup-specfile
Sage Weil [Thu, 14 Feb 2013 16:56:54 +0000 (08:56 -0800)]
Merge pull request #55 from dalgaaf/wip-da-cleanup-specfile

Cleanup some requirements of spec file

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodoc: Update create example to use 'allow ' syntax 56/head
Travis Rhoden [Thu, 14 Feb 2013 16:23:52 +0000 (11:23 -0500)]
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>
12 years agodoc: Move pool=... syntax inside of single quotes
Travis Rhoden [Thu, 14 Feb 2013 16:19:20 +0000 (11:19 -0500)]
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>
12 years agoceph.spec.in: remove librados2 requirement from librbd1 55/head
Danny Al-Gaaf [Thu, 14 Feb 2013 14:27:00 +0000 (15:27 +0100)]
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>
12 years agoceph.spec.in: cleanup requirements of fuse packages
Danny Al-Gaaf [Thu, 14 Feb 2013 14:11:18 +0000 (15:11 +0100)]
ceph.spec.in: cleanup requirements of fuse packages

Cleanup the Requires: list of the fuse packages. Remove fuse-libs,
libstdc++, libuuid. Don't add libraries to the list, the RPM build
system will find the dependencies by itself.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoLDADD PTHREAD_LIBS to fix librados-config linking 54/head
James Page [Thu, 14 Feb 2013 13:10:39 +0000 (13:10 +0000)]
LDADD PTHREAD_LIBS to fix librados-config linking

librados-config depends on libglobal which in turn
reference symbols in pthread; this caused issues
when linking due to the indirect dependency via
libglobal.

Signed-off-by: James Page <james.page@ubuntu.com>
12 years agofix buffer::list::zero(unsigned o, unsigned l) to act on all buffer::ptr 53/head
Loic Dachary [Thu, 14 Feb 2013 11:05:54 +0000 (12:05 +0100)]
fix buffer::list::zero(unsigned o, unsigned l) to act on all buffer::ptr

When buffer::list::zero was called on a buffer::list with "ABC" and
"DEF" in two different buffer::ptr with buffer::list::zero(4, 1) it
did nothing. The expected result is that the "DEF" buffer::ptr is
modified to "D\0F"

The test to check if the pointer is past the end of range to be zeroed
was reversed. It was o+l >= p which would always be true if the range
spans over the first buffer::ptr . It must be "o+l <= p" meaning the
pointer is past the end of the range and there is no need to loop over
the remaining buffer::ptr in the buffer::list

The p+it->length() >= o+l part of the if (p >= o && p+it->length() >=
o+l) test was also reversed. When called on "ABC" with zero(0, 1) it
would match because the range to be zeroed is contained in the
buffer::ptr. The call to it->zero() would zero the entire buffer::ptr
instead of just the first character.

unit tests are added to demonstrate the two problems with the previous
code and show that the patch fixes them.

http://tracker.ceph.com/issues/4123 refs #4123

Signed-off-by: Loic Dachary <loic@dachary.org>