{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/63535035","id":63535035,"diff_hunk":"@@ -1024,6 +1025,46 @@ void Operations<I>::execute_snap_unprotect(const char *snap_name,\n }\n \n template <typename I>\n+int Operations<I>::set_snap_limit(const int limit) {\n+  CephContext *cct = m_image_ctx.cct;\n+  ldout(cct, 5) << this << \" \" << __func__ << \": limit=\" << limit << dendl;\n+\n+  if (m_image_ctx.read_only) {\n+    return -EROFS;\n+  }\n+\n+  int r = m_image_ctx.state->refresh_if_required();\n+  if (r < 0) {\n+    return r;\n+  }\n+\n+  {\n+    RWLock::RLocker owner_lock(m_image_ctx.owner_lock);\n+    C_SaferCond cond_ctx;","path":"src/librbd/Operations.cc","position":27,"original_position":27,"commit_id":"8611d1696e607bb475ec67c3d727525e98b20fdc","original_commit_id":"8611d1696e607bb475ec67c3d727525e98b20fdc","user":{"login":"dillaman","id":4739042,"avatar_url":"https://avatars.githubusercontent.com/u/4739042?v=3","gravatar_id":"","url":"https://api.github.com/users/dillaman","html_url":"https://github.com/dillaman","followers_url":"https://api.github.com/users/dillaman/followers","following_url":"https://api.github.com/users/dillaman/following{/other_user}","gists_url":"https://api.github.com/users/dillaman/gists{/gist_id}","starred_url":"https://api.github.com/users/dillaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dillaman/subscriptions","organizations_url":"https://api.github.com/users/dillaman/orgs","repos_url":"https://api.github.com/users/dillaman/repos","events_url":"https://api.github.com/users/dillaman/events{/privacy}","received_events_url":"https://api.github.com/users/dillaman/received_events","type":"User","site_admin":false},"body":"```librbd::ExclusiveLock::request_lock``` ","created_at":"2016-05-17T14:43:48Z","updated_at":"2016-05-17T14:43:48Z","html_url":"https://github.com/ceph/ceph/pull/9151#discussion_r63535035","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/9151","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/63535035"},"html":{"href":"https://github.com/ceph/ceph/pull/9151#discussion_r63535035"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9151"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/9151","id":70252618,"html_url":"https://github.com/ceph/ceph/pull/9151","diff_url":"https://github.com/ceph/ceph/pull/9151.diff","patch_url":"https://github.com/ceph/ceph/pull/9151.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/9151","number":9151,"state":"open","locked":false,"title":"rbd: add methods to set and get snapshot limits","user":{"login":"fullerdj","id":959872,"avatar_url":"https://avatars.githubusercontent.com/u/959872?v=3","gravatar_id":"","url":"https://api.github.com/users/fullerdj","html_url":"https://github.com/fullerdj","followers_url":"https://api.github.com/users/fullerdj/followers","following_url":"https://api.github.com/users/fullerdj/following{/other_user}","gists_url":"https://api.github.com/users/fullerdj/gists{/gist_id}","starred_url":"https://api.github.com/users/fullerdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fullerdj/subscriptions","organizations_url":"https://api.github.com/users/fullerdj/orgs","repos_url":"https://api.github.com/users/fullerdj/repos","events_url":"https://api.github.com/users/fullerdj/events{/privacy}","received_events_url":"https://api.github.com/users/fullerdj/received_events","type":"User","site_admin":false},"body":"Add a subcommand, rbd snap limit <image> --limit <integer>, to\r\nlimit the number of snapshots that may be made of a given image.\r\nSpecifying a value less than zero removes the limit. Add an omap\r\nkey to the RBD header for implementation. Add object classes to\r\nset and query the limit. Older OSDs will ignore the limit.\r\n\r\nFixes: http://tracker.ceph.com/issues/15706\r\nSigned-off-by: Douglas Fuller <dfuller@redhat.com>","created_at":"2016-05-16T20:06:16Z","updated_at":"2016-05-17T14:43:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b97c02c5d6b4153ea43026b420a72dbd159e7ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/9151/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/9151/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/9151/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/8611d1696e607bb475ec67c3d727525e98b20fdc","head":{"label":"fullerdj:wip-djf-15706","ref":"wip-djf-15706","sha":"8611d1696e607bb475ec67c3d727525e98b20fdc","user":{"login":"fullerdj","id":959872,"avatar_url":"https://avatars.githubusercontent.com/u/959872?v=3","gravatar_id":"","url":"https://api.github.com/users/fullerdj","html_url":"https://github.com/fullerdj","followers_url":"https://api.github.com/users/fullerdj/followers","following_url":"https://api.github.com/users/fullerdj/following{/other_user}","gists_url":"https://api.github.com/users/fullerdj/gists{/gist_id}","starred_url":"https://api.github.com/users/fullerdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fullerdj/subscriptions","organizations_url":"https://api.github.com/users/fullerdj/orgs","repos_url":"https://api.github.com/users/fullerdj/repos","events_url":"https://api.github.com/users/fullerdj/events{/privacy}","received_events_url":"https://api.github.com/users/fullerdj/received_events","type":"User","site_admin":false},"repo":{"id":32943711,"name":"ceph","full_name":"fullerdj/ceph","owner":{"login":"fullerdj","id":959872,"avatar_url":"https://avatars.githubusercontent.com/u/959872?v=3","gravatar_id":"","url":"https://api.github.com/users/fullerdj","html_url":"https://github.com/fullerdj","followers_url":"https://api.github.com/users/fullerdj/followers","following_url":"https://api.github.com/users/fullerdj/following{/other_user}","gists_url":"https://api.github.com/users/fullerdj/gists{/gist_id}","starred_url":"https://api.github.com/users/fullerdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fullerdj/subscriptions","organizations_url":"https://api.github.com/users/fullerdj/orgs","repos_url":"https://api.github.com/users/fullerdj/repos","events_url":"https://api.github.com/users/fullerdj/events{/privacy}","received_events_url":"https://api.github.com/users/fullerdj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fullerdj/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/fullerdj/ceph","forks_url":"https://api.github.com/repos/fullerdj/ceph/forks","keys_url":"https://api.github.com/repos/fullerdj/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fullerdj/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fullerdj/ceph/teams","hooks_url":"https://api.github.com/repos/fullerdj/ceph/hooks","issue_events_url":"https://api.github.com/repos/fullerdj/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/fullerdj/ceph/events","assignees_url":"https://api.github.com/repos/fullerdj/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/fullerdj/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/fullerdj/ceph/tags","blobs_url":"https://api.github.com/repos/fullerdj/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fullerdj/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fullerdj/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/fullerdj/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fullerdj/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/fullerdj/ceph/languages","stargazers_url":"https://api.github.com/repos/fullerdj/ceph/stargazers","contributors_url":"https://api.github.com/repos/fullerdj/ceph/contributors","subscribers_url":"https://api.github.com/repos/fullerdj/ceph/subscribers","subscription_url":"https://api.github.com/repos/fullerdj/ceph/subscription","commits_url":"https://api.github.com/repos/fullerdj/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/fullerdj/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/fullerdj/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/fullerdj/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/fullerdj/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/fullerdj/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fullerdj/ceph/merges","archive_url":"https://api.github.com/repos/fullerdj/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fullerdj/ceph/downloads","issues_url":"https://api.github.com/repos/fullerdj/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/fullerdj/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/fullerdj/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/fullerdj/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fullerdj/ceph/labels{/name}","releases_url":"https://api.github.com/repos/fullerdj/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/fullerdj/ceph/deployments","created_at":"2015-03-26T18:03:07Z","updated_at":"2016-01-28T20:19:21Z","pushed_at":"2016-05-17T14:18:33Z","git_url":"git://github.com/fullerdj/ceph.git","ssh_url":"git@github.com:fullerdj/ceph.git","clone_url":"https://github.com/fullerdj/ceph.git","svn_url":"https://github.com/fullerdj/ceph","homepage":"http://ceph.com","size":153433,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"8980f840780445fbb6ed28944147811fd0d8a05c","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-17T14:03:18Z","pushed_at":"2016-05-17T14:39:13Z","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":212131,"stargazers_count":2154,"watchers_count":2154,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1271,"mirror_url":null,"open_issues_count":355,"forks":1271,"open_issues":355,"watchers":2154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9151"},"html":{"href":"https://github.com/ceph/ceph/pull/9151"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/9151"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/9151/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9151/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9151/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/8611d1696e607bb475ec67c3d727525e98b20fdc"}}}}