{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/64579774","id":64579774,"diff_hunk":"@@ -12109,28 +12083,26 @@ void RGWStoreManager::close_storage(RGWRados *store)\n \n librados::Rados* RGWRados::get_rados_handle()\n {\n-  if (num_rados_handles == 1) {\n-    return rados[0];\n+  if (rados.size() == 1) {\n+    return &rados[0];\n   } else {\n     handle_lock.get_read();\n     pthread_t id = pthread_self();\n     std::map<pthread_t, int>:: iterator it = rados_map.find(id);\n \n     if (it != rados_map.end()) {\n       handle_lock.put_read();\n-      return rados[it->second];\n+      return &rados[it->second];\n     } else {\n       handle_lock.put_read();\n       handle_lock.get_write();\n-      uint32_t handle = next_rados_handle.read();\n-      if (handle == num_rados_handles) {\n-        next_rados_handle.set(0);\n-        handle = 0;\n-      }\n+      const uint32_t handle = next_rados_handle;\n       rados_map[id] = handle;\n-      next_rados_handle.inc();\n+      if (++next_rados_handle == rados.size()) {","path":"src/rgw/rgw_rados.cc","position":117,"original_position":117,"commit_id":"53a7f1a9951fa21cb46b5fb3914db3547b568aa5","original_commit_id":"53a7f1a9951fa21cb46b5fb3914db3547b568aa5","user":{"login":"rzarzynski","id":1891217,"avatar_url":"https://avatars.githubusercontent.com/u/1891217?v=3","gravatar_id":"","url":"https://api.github.com/users/rzarzynski","html_url":"https://github.com/rzarzynski","followers_url":"https://api.github.com/users/rzarzynski/followers","following_url":"https://api.github.com/users/rzarzynski/following{/other_user}","gists_url":"https://api.github.com/users/rzarzynski/gists{/gist_id}","starred_url":"https://api.github.com/users/rzarzynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rzarzynski/subscriptions","organizations_url":"https://api.github.com/users/rzarzynski/orgs","repos_url":"https://api.github.com/users/rzarzynski/repos","events_url":"https://api.github.com/users/rzarzynski/events{/privacy}","received_events_url":"https://api.github.com/users/rzarzynski/received_events","type":"User","site_admin":false},"body":"Great. Yet another one optimization here. :-)","created_at":"2016-05-25T14:14:09Z","updated_at":"2016-05-25T14:14:09Z","html_url":"https://github.com/ceph/ceph/pull/9295#discussion_r64579774","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/9295","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/64579774"},"html":{"href":"https://github.com/ceph/ceph/pull/9295#discussion_r64579774"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9295"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/9295","id":71227844,"html_url":"https://github.com/ceph/ceph/pull/9295","diff_url":"https://github.com/ceph/ceph/pull/9295.diff","patch_url":"https://github.com/ceph/ceph/pull/9295.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/9295","number":9295,"state":"open","locked":false,"title":"rgw: use vector for librados handles","user":{"login":"cbodley","id":1928002,"avatar_url":"https://avatars.githubusercontent.com/u/1928002?v=3","gravatar_id":"","url":"https://api.github.com/users/cbodley","html_url":"https://github.com/cbodley","followers_url":"https://api.github.com/users/cbodley/followers","following_url":"https://api.github.com/users/cbodley/following{/other_user}","gists_url":"https://api.github.com/users/cbodley/gists{/gist_id}","starred_url":"https://api.github.com/users/cbodley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbodley/subscriptions","organizations_url":"https://api.github.com/users/cbodley/orgs","repos_url":"https://api.github.com/users/cbodley/repos","events_url":"https://api.github.com/users/cbodley/events{/privacy}","received_events_url":"https://api.github.com/users/cbodley/received_events","type":"User","site_admin":false},"body":"using a vector instead of an array of pointers cleans up our initialization/shutdown logic","created_at":"2016-05-24T14:15:08Z","updated_at":"2016-05-25T14:14:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f09b8abd4afe07980cabff010ba8560ce56987","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/9295/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/9295/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/9295/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/53a7f1a9951fa21cb46b5fb3914db3547b568aa5","head":{"label":"cbodley:wip-rgw-rados-vector","ref":"wip-rgw-rados-vector","sha":"53a7f1a9951fa21cb46b5fb3914db3547b568aa5","user":{"login":"cbodley","id":1928002,"avatar_url":"https://avatars.githubusercontent.com/u/1928002?v=3","gravatar_id":"","url":"https://api.github.com/users/cbodley","html_url":"https://github.com/cbodley","followers_url":"https://api.github.com/users/cbodley/followers","following_url":"https://api.github.com/users/cbodley/following{/other_user}","gists_url":"https://api.github.com/users/cbodley/gists{/gist_id}","starred_url":"https://api.github.com/users/cbodley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbodley/subscriptions","organizations_url":"https://api.github.com/users/cbodley/orgs","repos_url":"https://api.github.com/users/cbodley/repos","events_url":"https://api.github.com/users/cbodley/events{/privacy}","received_events_url":"https://api.github.com/users/cbodley/received_events","type":"User","site_admin":false},"repo":{"id":42138483,"name":"ceph","full_name":"cbodley/ceph","owner":{"login":"cbodley","id":1928002,"avatar_url":"https://avatars.githubusercontent.com/u/1928002?v=3","gravatar_id":"","url":"https://api.github.com/users/cbodley","html_url":"https://github.com/cbodley","followers_url":"https://api.github.com/users/cbodley/followers","following_url":"https://api.github.com/users/cbodley/following{/other_user}","gists_url":"https://api.github.com/users/cbodley/gists{/gist_id}","starred_url":"https://api.github.com/users/cbodley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbodley/subscriptions","organizations_url":"https://api.github.com/users/cbodley/orgs","repos_url":"https://api.github.com/users/cbodley/repos","events_url":"https://api.github.com/users/cbodley/events{/privacy}","received_events_url":"https://api.github.com/users/cbodley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbodley/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/cbodley/ceph","forks_url":"https://api.github.com/repos/cbodley/ceph/forks","keys_url":"https://api.github.com/repos/cbodley/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbodley/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbodley/ceph/teams","hooks_url":"https://api.github.com/repos/cbodley/ceph/hooks","issue_events_url":"https://api.github.com/repos/cbodley/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/cbodley/ceph/events","assignees_url":"https://api.github.com/repos/cbodley/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/cbodley/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/cbodley/ceph/tags","blobs_url":"https://api.github.com/repos/cbodley/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbodley/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbodley/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbodley/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbodley/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/cbodley/ceph/languages","stargazers_url":"https://api.github.com/repos/cbodley/ceph/stargazers","contributors_url":"https://api.github.com/repos/cbodley/ceph/contributors","subscribers_url":"https://api.github.com/repos/cbodley/ceph/subscribers","subscription_url":"https://api.github.com/repos/cbodley/ceph/subscription","commits_url":"https://api.github.com/repos/cbodley/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbodley/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbodley/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbodley/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbodley/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/cbodley/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbodley/ceph/merges","archive_url":"https://api.github.com/repos/cbodley/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbodley/ceph/downloads","issues_url":"https://api.github.com/repos/cbodley/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/cbodley/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/cbodley/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/cbodley/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbodley/ceph/labels{/name}","releases_url":"https://api.github.com/repos/cbodley/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/cbodley/ceph/deployments","created_at":"2015-09-08T20:54:18Z","updated_at":"2015-09-08T20:54:33Z","pushed_at":"2016-05-25T13:14:46Z","git_url":"git://github.com/cbodley/ceph.git","ssh_url":"git@github.com:cbodley/ceph.git","clone_url":"https://github.com/cbodley/ceph.git","svn_url":"https://github.com/cbodley/ceph","homepage":"http://ceph.com","size":161641,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"a41860a501a245b57510543946cb1d2a24b61342","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2016-05-25T10:24:16Z","pushed_at":"2016-05-25T13:58:16Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":215436,"stargazers_count":2171,"watchers_count":2171,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1285,"mirror_url":null,"open_issues_count":364,"forks":1285,"open_issues":364,"watchers":2171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9295"},"html":{"href":"https://github.com/ceph/ceph/pull/9295"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/9295"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/9295/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9295/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9295/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/53a7f1a9951fa21cb46b5fb3914db3547b568aa5"}}}}
{"actor":{"display_login":"rzarzynski"}}